Re: [Bug #11308] tbench regression on each kernel release from 2.6.22 -> 2.6.28

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Friday, November 21, 2008 - 5:51 am

David Miller a écrit :

Well, this is dust compared to what we currently have.

To allocate a socket we :
0) Do the usual file manipulation (pretty scalable these days)
   (but recent drop_file_write_access() and co slow down a bit)
1) allocate an inode with new_inode()
    This function :
     - locks inode_lock,
     - dirties nr_inodes counter
     - dirties inode_in_use list  (for sockets, I doubt it is usefull)
     - dirties superblock s_inodes.
     - dirties last_ino counter
 All these are in different cache lines of course.
2) allocate a dentry
   d_alloc() takes dcache_lock,
   insert dentry on its parent list (dirtying sock_mnt->mnt_sb->s_root)
   dirties nr_dentry
3) d_instantiate() dentry  (dcache_lock taken again)
4) init_file() -> atomic_inc on sock_mnt->refcount (in case we want to umount this vfs ...)



At close() time, we must undo the things. Its even more expensive because
of the _atomic_dec_and_lock() that stress a lot, and because of two cache 
lines that are touched when an element is deleted from a list.

for (i = 0; i < 1000*1000; i++)
	close(socket(socket(AF_INET, SOCK_STREAM, 0));

Cost if run one one cpu :

real    0m1.561s
user    0m0.092s
sys     0m1.469s

If run on 8 CPUS :

real    0m27.496s
user    0m0.657s
sys     3m39.092s


CPU: Core 2, speed 3000.11 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100
000
samples  cum. samples  %        cum. %     symbol name
164211   164211        10.9678  10.9678    init_file
155663   319874        10.3969  21.3647    d_alloc
147596   467470         9.8581  31.2228    _atomic_dec_and_lock
92993    560463         6.2111  37.4339    inet_create
73495    633958         4.9088  42.3427    kmem_cache_alloc
46353    680311         3.0960  45.4387    dentry_iput
46042    726353         3.0752  48.5139    tcp_close
42784    769137         2.8576  51.3715    kmem_cache_free
37074    806211         2.4762  53.8477    wake_up_inode
36375    842586         2.4295  56.2772    tcp_v4_init_sock
35212    877798         2.3518  58.6291    inotify_d_instantiate
33199    910997         2.2174  60.8465    sysenter_past_esp
31161    942158         2.0813  62.9277    d_instantiate
31000    973158         2.0705  64.9983    generic_forget_inode
28020    1001178        1.8715  66.8698    vfs_dq_drop
19007    1020185        1.2695  68.1393    __copy_from_user_ll
17513    1037698        1.1697  69.3090    new_inode
16957    1054655        1.1326  70.4415    __init_timer
16897    1071552        1.1286  71.5701    discard_slab
16115    1087667        1.0763  72.6464    d_kill
15542    1103209        1.0381  73.6845    __percpu_counter_add
13562    1116771        0.9058  74.5903    __slab_free
13276    1130047        0.8867  75.4771    __fput
12423    1142470        0.8297  76.3068    new_slab
11976    1154446        0.7999  77.1067    tcp_v4_destroy_sock
10889    1165335        0.7273  77.8340    inet_csk_destroy_sock
10516    1175851        0.7024  78.5364    alloc_inode
9979     1185830        0.6665  79.2029    sock_attach_fd
7980     1193810        0.5330  79.7359    drop_file_write_access
7609     1201419        0.5082  80.2441    alloc_fd
7584     1209003        0.5065  80.7506    sock_init_data
7164     1216167        0.4785  81.2291    add_partial
7107     1223274        0.4747  81.7038    sys_close
6997     1230271        0.4673  82.1711    mwait_idle

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.28-rc5: Reported regressions 2.6.26 -&gt; 2.6.27, Rafael J. Wysocki, (Sun Nov 16, 10:38 am)
[Bug #11207] VolanoMark regression with 2.6.27-rc1, Rafael J. Wysocki, (Sun Nov 16, 10:38 am)
[Bug #11308] tbench regression on each kernel release from ..., Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11215] INFO: possible recursive locking detected ps2 ..., Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11698] 2.6.27-rc7, freezes with &amp;gt; 1 s2ram cycle, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11664] acpi errors and random freeze on sony vaio sr, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11569] Panic stop CPUs regression, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11543] kernel panic: softlockup in tick_periodic() ???, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11404] BUG: in 2.6.23-rc3-git7 in do_cciss_intr, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11805] mounting XFS produces a segfault, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11795] ks959-sir dongle no longer works under 2.6.27 ..., Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11836] Scheduler on C2D CPU and latest 2.6.27 kernel, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11843] usb hdd problems with 2.6.27.2, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11865] WOL for E100 Doesn't Work Anymore, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11876] RCU hang on cpu re-hotplug with 2.6.27rc8, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11886] without serial console system doesn't poweroff, Rafael J. Wysocki, (Sun Nov 16, 10:40 am)
[Bug #11983] iwlagn: wrong command queue 31, command id 0x0, Rafael J. Wysocki, (Sun Nov 16, 10:41 am)
[Bug #12039] Regression: USB/DVB 2.6.26.8 --&amp;gt; 2.6.27.6, Rafael J. Wysocki, (Sun Nov 16, 10:41 am)
[Bug #12048] Regression in bonding between 2.6.26.8 and 2. ..., Rafael J. Wysocki, (Sun Nov 16, 10:41 am)
Re: [Bug #11843] usb hdd problems with 2.6.27.2, Luciano Rocha, (Sun Nov 16, 2:37 pm)
Re: [Bug #11805] mounting XFS produces a segfault, Christoph Hellwig, (Mon Nov 17, 7:44 am)
Re: [Bug #11308] tbench regression on each kernel release ..., Christoph Lameter, (Wed Nov 19, 12:43 pm)
Re: [Bug #11308] tbench regression on each kernel release ..., Christoph Lameter, (Thu Nov 20, 4:52 pm)
Re: [Bug #11308] tbench regression on each kernel release ..., Eric Dumazet, (Fri Nov 21, 5:51 am)
Re: [PATCH] fs: pipe/sockets/anon dentries should not have ..., Christoph Hellwig, (Fri Nov 21, 8:36 am)
Re: [Bug #11308] tbench regression on each kernel release ..., Christoph Lameter, (Fri Nov 21, 9:11 am)
Re: [Bug #11308] tbench regression on each kernel release ..., Christoph Lameter, (Fri Nov 21, 11:06 am)
[PATCH 1/6] fs: Introduce a per_cpu nr_dentry, Eric Dumazet, (Wed Nov 26, 4:30 pm)
[PATCH 3/6] fs: Introduce a per_cpu last_ino allocator, Eric Dumazet, (Wed Nov 26, 4:32 pm)
[PATCH 4/6] fs: Introduce a per_cpu nr_inodes, Eric Dumazet, (Wed Nov 26, 4:32 pm)
[PATCH 5/6] fs: Introduce special inodes, Eric Dumazet, (Wed Nov 26, 4:32 pm)
Re: [PATCH 0/6] fs: Scalability of sockets/pipes allocatio ..., Christoph Lameter, (Wed Nov 26, 6:37 pm)
Re: [PATCH 5/6] fs: Introduce special inodes, David Miller, (Thu Nov 27, 1:20 am)
Re: [PATCH 4/6] fs: Introduce a per_cpu nr_inodes, Peter Zijlstra, (Thu Nov 27, 2:32 am)
Re: [PATCH 4/6] fs: Introduce a per_cpu nr_inodes, Peter Zijlstra, (Thu Nov 27, 2:39 am)
Re: [PATCH 0/6] fs: Scalability of sockets/pipes allocatio ..., Christoph Hellwig, (Thu Nov 27, 2:39 am)
Re: [PATCH 1/6] fs: Introduce a per_cpu nr_dentry, Christoph Hellwig, (Thu Nov 27, 2:41 am)
Re: [PATCH 3/6] fs: Introduce a per_cpu last_ino allocator, Christoph Hellwig, (Thu Nov 27, 2:46 am)
Re: [PATCH 4/6] fs: Introduce a per_cpu nr_inodes, Christoph Hellwig, (Thu Nov 27, 2:48 am)
Re: [PATCH 6/6] fs: Introduce kern_mount_special() to moun ..., Christoph Hellwig, (Thu Nov 27, 2:53 am)
Re: [PATCH 4/6] fs: Introduce a per_cpu nr_inodes, Eric Dumazet, (Thu Nov 27, 3:01 am)
Re: [PATCH 4/6] fs: Introduce a per_cpu nr_inodes, Andi Kleen, (Thu Nov 27, 3:07 am)
Re: [PATCH 6/6] fs: Introduce kern_mount_special() to moun ..., Christoph Hellwig, (Thu Nov 27, 3:10 am)
Re: [PATCH 0/6] fs: Scalability of sockets/pipes allocatio ..., Christoph Lameter, (Thu Nov 27, 7:44 am)
Re: [PATCH 4/6] fs: Introduce a per_cpu nr_inodes, Christoph Lameter, (Thu Nov 27, 7:46 am)
Re: [PATCH 0/6] fs: Scalability of sockets/pipes allocatio ..., Christoph Hellwig, (Fri Nov 28, 11:38 pm)
[PATCH v2 5/5] fs: new_inode_single() and iput_single(), Eric Dumazet, (Sat Nov 29, 1:45 am)