[RFC] [Stacking v4 3/3] Cleaned up stacker patch

From: Serge Hallyn (serue@private)
Date: Fri Dec 03 2004 - 10:04:02 PST


Hi,

Attached is a cleaned up version of stacker.

Changes:
  1. uses RCU to protect the list elements.
  2. capable() now just uses RETURN_ERROR_IF_ANY_ERROR explicitly.
  3. stacker exports lsm_adopt_next_secondary(char *name), which will
delegate stacking of the next loaded LSM to the module identified by
(name).
  4. stacker doesn't touch the get/setprocattr functions.  There's no
point messing with that unless/until userspace code can handle it, as
there's no clean way to handle all cases otherwise.
  5. mod_unreg_security is removed.  All modules use unregister_security
() regardless of whether they were loaded using register_security() or
mod_reg_security().  In this way, if capability() was escalated by
selinux from secondary to a primary module, it doesn't end up
unregistering the wrong way.

I attach lmbench results on a 700Mhz 4-way SMP box comparing a stock -
rc2-bk7 kernel with no stacking patches at all (nostack.lmbench), one
with the stacking patches applied (chain-newrcu.lmbench), and one with
roughly the same stacker.c, except rather than protect the list with
rcu, we do not free memory when a LSM is unloaded, so no RCU protection
in CALL_ALL and RETURN_ERROR_IF_ANY_ERROR.

thanks,
-serge
--
=======================================================
Serge Hallyn
Security Software Engineer, IBM Linux Technology Center
serue@private




                 L M B E N C H  2 . 0   S U M M A R Y
                 ------------------------------------


Basic system parameters
----------------------------------------------------
Host                 OS Description              Mhz
                                                    
--------- ------------- ----------------------- ----
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700

Processor, Processes - times in microseconds - smaller is better
----------------------------------------------------------------
Host                 OS  Mhz null null      open selct sig  sig  fork exec sh  
                             call  I/O stat clos TCP   inst hndl proc proc proc
--------- ------------- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ----
vega.ltc. Linux 2.6.10-  700 0.30 1.10 10.8 12.7  37.0 1.45 5.47 250. 1119 3825
vega.ltc. Linux 2.6.10-  700 0.30 1.13 10.9 12.8  38.2 1.43 5.57 249. 1110 3816
vega.ltc. Linux 2.6.10-  700 0.30 1.12 11.0 12.8  38.8 1.44 5.54 249. 1120 3835
vega.ltc. Linux 2.6.10-  700 0.30 1.11 10.9 12.8  36.5 1.43 5.57 249. 1156 3827

MEAN                              1.12 10.9 12.8  37.6 1.44 5.54 249  1126 3826
STDEV                              .01  0.1  .04   0.9 0.01 0.04  .4    18    7
CI (95%)

Context switching - times in microseconds - smaller is better
-------------------------------------------------------------
Host                 OS 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K
                        ctxsw  ctxsw  ctxsw ctxsw  ctxsw   ctxsw   ctxsw
--------- ------------- ----- ------ ------ ------ ------ ------- -------
vega.ltc. Linux 2.6.10-  11.6   15.9   32.3   17.7   33.1    16.7    32.8
vega.ltc. Linux 2.6.10-  11.0   16.1   32.9   16.4   31.3    16.3    33.1
vega.ltc. Linux 2.6.10-  11.6   15.7   32.5   18.6   31.8    16.9    34.0
vega.ltc. Linux 2.6.10-  11.1   15.7   32.5   17.9   32.8    17.2    32.8

MEAN                     11.3   15.9   32.6   17.7   32.3    16.8    33.2
STDEV                     0.3    0.2    0.2    0.8    0.7     0.3     0.5
CI (95%)

*Local* Communication latencies in microseconds - smaller is better
-------------------------------------------------------------------
Host                 OS 2p/0K  Pipe AF     UDP  RPC/   TCP  RPC/ TCP
                        ctxsw       UNIX         UDP         TCP conn
--------- ------------- ----- ----- ---- ----- ----- ----- ----- ----
vega.ltc. Linux 2.6.10-  11.6  53.1 61.5             100.1       179.
vega.ltc. Linux 2.6.10-  11.0  46.2 72.9              98.5       178.
vega.ltc. Linux 2.6.10-  11.6  54.9 69.9             128.4       179.
vega.ltc. Linux 2.6.10-  11.1  55.6 68.9              99.2       181.

MEAN                     11.3  52.5 68.3             106.6       179
STDEV                     0.3   3.7  4.2              12.6         1
CI (95%)

File & VM system latencies in microseconds - smaller is better
--------------------------------------------------------------
Host                 OS   0K File      10K File      Mmap    Prot    Page	
                        Create Delete Create Delete  Latency Fault   Fault 
--------- ------------- ------ ------ ------ ------  ------- -----   ----- 
vega.ltc. Linux 2.6.10-   80.5   42.5  209.6   79.6    11.2K 0.220 4.00000
vega.ltc. Linux 2.6.10-   80.6   42.7  210.4   79.9    11.1K 0.269 5.00000
vega.ltc. Linux 2.6.10-   80.9   42.6  208.1   80.1    11.1K 0.200 5.00000
vega.ltc. Linux 2.6.10-   80.6   43.0  208.9   80.0    11.3K 0.230 4.00000

MEAN                      80.7   42.7  209.3   79.9    11.2K 0.230 4.5
STDEV                      0.2    0.2    0.9    0.2     0.1K 0.025 0.5
CI (95%)

*Local* Communication bandwidths in MB/s - bigger is better
-----------------------------------------------------------
Host                OS  Pipe AF    TCP  File   Mmap  Bcopy  Bcopy  Mem   Mem
                             UNIX      reread reread (libc) (hand) read write
--------- ------------- ---- ---- ---- ------ ------ ------ ------ ---- -----
vega.ltc. Linux 2.6.10- 291. 283. 198.  278.8  331.7  185.9  158.5 328. 202.6
vega.ltc. Linux 2.6.10- 292. 284. 196.  282.2  327.9  185.9  147.0 331. 202.9
vega.ltc. Linux 2.6.10- 294. 282. 197.  282.1  331.4  187.0  146.6 328. 202.8
vega.ltc. Linux 2.6.10- 293. 283. 199.  278.8  328.0  185.8  145.2 328. 204.9

MEAN                    293  283  198   280.5  329.8  186.2  149.3 329  203.3
STDEV                     1    1    1     1.7    1.8    0.5    5.3   1    0.9
CI (95%)

Memory latencies in nanoseconds - smaller is better
    (WARNING - may not be correct, check graphs)
---------------------------------------------------
Host                 OS   Mhz  L1 $   L2 $    Main mem    Guesses
--------- -------------  ---- ----- ------    --------    -------
vega.ltc. Linux 2.6.10-   700 4.329   13.0  183.3
vega.ltc. Linux 2.6.10-   700 4.284   12.9  181.3
vega.ltc. Linux 2.6.10-   700 4.284   12.9  181.2
vega.ltc. Linux 2.6.10-   700 4.286   12.9  181.3



                 L M B E N C H  2 . 0   S U M M A R Y
                 ------------------------------------


Basic system parameters
----------------------------------------------------
Host                 OS Description              Mhz
                                                    
--------- ------------- ----------------------- ----
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700

Processor, Processes - times in microseconds - smaller is better
----------------------------------------------------------------
Host                 OS  Mhz null null      open selct sig  sig  fork exec sh  
                             call  I/O stat clos TCP   inst hndl proc proc proc
--------- ------------- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ----
vega.ltc. Linux 2.6.10-  700 0.30 1.97 15.0 18.5  36.6 1.43 6.20 258. 1172 4011
vega.ltc. Linux 2.6.10-  700 0.30 2.02 15.2 18.4  38.0 1.43 6.31 257. 1179 4041
vega.ltc. Linux 2.6.10-  700 0.30 1.99 15.2 18.7  38.2 1.44 6.13 257. 1189 4041
vega.ltc. Linux 2.6.10-  700 0.30 1.99 15.3 18.7  36.4 1.43 6.18 255. 1176 4043

MEAN                              1.99 15.2 18.6  37.3 1.43 6.21 257  1179 4034
STDEV                             0.02  0.1  0.1   0.8 .004 0.07   1     6   13
CI (95%)

Context switching - times in microseconds - smaller is better
-------------------------------------------------------------
Host                 OS 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K
                        ctxsw  ctxsw  ctxsw ctxsw  ctxsw   ctxsw   ctxsw
--------- ------------- ----- ------ ------ ------ ------ ------- -------
vega.ltc. Linux 2.6.10-  10.1   14.6   31.3   14.9   30.8    16.5    41.8
vega.ltc. Linux 2.6.10-  10.1   14.6   26.1   15.4   33.1    16.0    33.1
vega.ltc. Linux 2.6.10-  10.3   14.6   32.0   15.2   32.9    14.7    32.8
vega.ltc. Linux 2.6.10-  10.4   14.5   31.3   15.0   33.1    15.0    35.2

MEAN                     10.2   14.6   30.2   15.1   32.5    15.6    35.7
STDEV                     0.1   0.04    2.4    0.2    1.0     0.7     3.6
CI (95%)

*Local* Communication latencies in microseconds - smaller is better
-------------------------------------------------------------------
Host                 OS 2p/0K  Pipe AF     UDP  RPC/   TCP  RPC/ TCP
                        ctxsw       UNIX         UDP         TCP conn
--------- ------------- ----- ----- ---- ----- ----- ----- ----- ----
vega.ltc. Linux 2.6.10-  10.1  49.8 97.2             104.8       186.
vega.ltc. Linux 2.6.10-  10.1  48.6 86.7             127.8       187.
vega.ltc. Linux 2.6.10-  10.3  48.9 96.3             105.3       189.
vega.ltc. Linux 2.6.10-  10.4  49.7 100.             103.7       187.

MEAN                     10.2  49.3 95.1             110.4       187
STDEV                     0.1   0.5  5.0              10.1         1
CI (95%)

File & VM system latencies in microseconds - smaller is better
--------------------------------------------------------------
Host                 OS   0K File      10K File      Mmap    Prot    Page	
                        Create Delete Create Delete  Latency Fault   Fault 
--------- ------------- ------ ------ ------ ------  ------- -----   ----- 
vega.ltc. Linux 2.6.10-   88.3   46.4  213.9   82.6    12.0K       5.00000
vega.ltc. Linux 2.6.10-   88.9   46.8  214.4   82.9    11.4K       4.00000
vega.ltc. Linux 2.6.10-   89.0   46.7  215.5   82.6    11.1K       4.00000
vega.ltc. Linux 2.6.10-   88.2   46.3  214.5   81.9    11.0K       5.00000

MEAN                      88.6   46.6  214.6   82.5    11.4K       4.5
STDEV                      0.4    0.2    0.6    0.4     0.4K       0.5
CI (95%)

*Local* Communication bandwidths in MB/s - bigger is better
-----------------------------------------------------------
Host                OS  Pipe AF    TCP  File   Mmap  Bcopy  Bcopy  Mem   Mem
                             UNIX      reread reread (libc) (hand) read write
--------- ------------- ---- ---- ---- ------ ------ ------ ------ ---- -----
vega.ltc. Linux 2.6.10- 292. 283. 200.  277.8  328.0  183.8  145.1 331. 202.8
vega.ltc. Linux 2.6.10- 289. 283. 196.  277.9  331.5  183.7  146.6 331. 202.9
vega.ltc. Linux 2.6.10- 288. 283. 198.  281.5  328.0  185.3  145.2 328. 202.4
vega.ltc. Linux 2.6.10- 288. 282. 196.  277.3  331.5  185.9  145.3 331. 205.4

MEAN                    289  283  198   278.6  329.8  184.7  145.6 330  203.4
STDEV                     2   .4    2     1.7    1.8    0.9    0.6   1    1.2
CI (95%)

Memory latencies in nanoseconds - smaller is better
    (WARNING - may not be correct, check graphs)
---------------------------------------------------
Host                 OS   Mhz  L1 $   L2 $    Main mem    Guesses
--------- -------------  ---- ----- ------    --------    -------
vega.ltc. Linux 2.6.10-   700 4.329   13.0  184.9
vega.ltc. Linux 2.6.10-   700 4.329   13.0  184.9
vega.ltc. Linux 2.6.10-   700 4.330   13.0  184.8
vega.ltc. Linux 2.6.10-   700 4.329   13.0  182.9



                 L M B E N C H  2 . 0   S U M M A R Y
                 ------------------------------------


Basic system parameters
----------------------------------------------------
Host                 OS Description              Mhz
                                                    
--------- ------------- ----------------------- ----
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700
vega.ltc. Linux 2.6.10-       i686-pc-linux-gnu  700

Processor, Processes - times in microseconds - smaller is better
----------------------------------------------------------------
Host                 OS  Mhz null null      open selct sig  sig  fork exec sh  
                             call  I/O stat clos TCP   inst hndl proc proc proc
--------- ------------- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ----
vega.ltc. Linux 2.6.10-  700 0.30 1.86 14.4 17.2  36.5 1.43 5.71 260. 1167 4024
vega.ltc. Linux 2.6.10-  700 0.30 1.89 14.7 17.5  40.7 1.45 5.77 259. 1179 3984
vega.ltc. Linux 2.6.10-  700 0.30 1.88 14.6 17.4  41.6 1.43 5.77 258. 1166 4043
vega.ltc. Linux 2.6.10-  700 0.30 1.88 14.4 17.2  36.7 1.45 5.67 260. 1183 4052

MEAN                         0.30 1.88 14.5 17.3  38.9 1.44 5.73 259  1174 4026
STDEV                             0.01  0.1  0.1   2.3 0.01 0.04   1     7   26
CI (95%)

Context switching - times in microseconds - smaller is better
-------------------------------------------------------------
Host                 OS 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K
                        ctxsw  ctxsw  ctxsw ctxsw  ctxsw   ctxsw   ctxsw
--------- ------------- ----- ------ ------ ------ ------ ------- -------
vega.ltc. Linux 2.6.10-  10.1   14.5   31.6   15.0   32.8    14.9    32.9
vega.ltc. Linux 2.6.10-  10.2   14.6   31.1   14.8   32.8    15.6    32.4
vega.ltc. Linux 2.6.10-  10.0   14.8   31.7   15.2   32.3    14.8    38.3
vega.ltc. Linux 2.6.10- 9.900   14.3   31.4   14.8   32.1    15.8    32.9

MEAN                    10.05   14.6   31.5   15.0   32.5    15.3    34.1
STDEV                    0.11    0.2    0.2    0.2    0.3     0.4     2.4
CI (95%)

*Local* Communication latencies in microseconds - smaller is better
-------------------------------------------------------------------
Host                 OS 2p/0K  Pipe AF     UDP  RPC/   TCP  RPC/ TCP
                        ctxsw       UNIX         UDP         TCP conn
--------- ------------- ----- ----- ---- ----- ----- ----- ----- ----
vega.ltc. Linux 2.6.10-  10.1  46.4 55.6             127.2       187.
vega.ltc. Linux 2.6.10-  10.2  49.2 93.3             104.3       188.
vega.ltc. Linux 2.6.10-  10.0  44.2 85.9             129.0       187.
vega.ltc. Linux 2.6.10- 9.900  45.6 97.4             104.6       188.

MEAN                    10.05  46.4 83.1             116.3       188
STDEV                    0.11   1.8 16.4              11.8         1
CI (95%)

File & VM system latencies in microseconds - smaller is better
--------------------------------------------------------------
Host                 OS   0K File      10K File      Mmap    Prot    Page	
                        Create Delete Create Delete  Latency Fault   Fault 
--------- ------------- ------ ------ ------ ------  ------- -----   ----- 
vega.ltc. Linux 2.6.10-   89.9   45.5  215.2   82.3    11.0K       5.00000
vega.ltc. Linux 2.6.10-   90.6   45.9  217.9   81.5    11.1K       4.00000
vega.ltc. Linux 2.6.10-   90.8   45.8  218.4   83.0    10.7K 0.027 4.00000
vega.ltc. Linux 2.6.10-   90.4   45.9  215.7   81.7    10.8K 0.052 4.00000

MEAN                      90.4   45.8  216.8   82.1    10.9K 0.040 4.250
STDEV                      0.3    0.2    1.4    0.6     0.2K 0.013 0.433
CI (95%)

*Local* Communication bandwidths in MB/s - bigger is better
-----------------------------------------------------------
Host                OS  Pipe AF    TCP  File   Mmap  Bcopy  Bcopy  Mem   Mem
                             UNIX      reread reread (libc) (hand) read write
--------- ------------- ---- ---- ---- ------ ------ ------ ------ ---- -----
vega.ltc. Linux 2.6.10- 289. 281. 233.  281.9  331.6  183.6  145.0 331. 205.3
vega.ltc. Linux 2.6.10- 288. 282. 197.  277.7  327.7  186.0  145.0 331. 202.5
vega.ltc. Linux 2.6.10- 293. 283. 194.  281.6  331.6  183.8  144.0 328. 202.3
vega.ltc. Linux 2.6.10- 291. 282. 195.  281.6  327.8  183.7  145.0 327. 202.4

MEAN                    290  282  205   280.7  329.7  184.3  144.8 329  203.1
STDEV                     2    1   16     1.7    1.9    1      0.4   2    1.3
CI (95%)

Memory latencies in nanoseconds - smaller is better
    (WARNING - may not be correct, check graphs)
---------------------------------------------------
Host                 OS   Mhz  L1 $   L2 $    Main mem    Guesses
--------- -------------  ---- ----- ------    --------    -------
vega.ltc. Linux 2.6.10-   700 4.285   12.9  182.8
vega.ltc. Linux 2.6.10-   700 4.329   13.0  184.8
vega.ltc. Linux 2.6.10-   700 4.328   13.0  184.8
vega.ltc. Linux 2.6.10-   700 4.284   12.8  182.8



This archive was generated by hypermail 2.1.3 : Fri Dec 03 2004 - 08:58:29 PST