All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ole Kliemann <ole@plastictree.net>
To: selinux@tycho.nsa.gov
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: SELinux performance depending on type count
Date: Fri, 10 Aug 2012 23:38:45 +0200	[thread overview]
Message-ID: <20120810213845.GQ2296@telvanni> (raw)
In-Reply-To: <20120807130244.GE2085@telvanni>


[-- Attachment #1.1: Type: text/plain, Size: 1714 bytes --]

On Tue, Aug 07, 2012 at 03:02:44PM +0200, Ole Kliemann wrote:
> And would it be better performance-wise to run a MCS-policy with 
> say categories c0.cn than to have types c0_t, ... cn_t?

I can measure a performance impact here too using a test analog 
to the one used to measure the attribute-spam.

With 10000 categories:

I reside in system_u:system_r:unconfined_t:s0.
I run the script. Average walltime is about 6.67sec.


$ runcon -l s0:c0.c9999

Now I'm system_u:system_r:unconfined_t:s0:c0.c9999.
I rerun the script. Average walltime is about 39sec.

Ouch! :-/


$ runcon -l s0:c0.c999
Now I'm system_u:system_r:unconfined_t:s0:c0.c999.
I rerun the script. Average walltime is about 7.89sec.


With 1000 categories:

system_u:system_r:unconfined_t:s0               6.53sec
system_u:system_r:unconfined_t:s0:c0.c9         6.63sec
system_u:system_r:unconfined_t:s0:c0.c99        6.73sec
system_u:system_r:unconfined_t:s0:c0.c999       7.89sec

That's almost 19% increase still at full range!


But several points:

It's different than with attribute-spam. There is no lag, no 
CPU spikes in kworker threads. It's just a smooth increase in 
runtime, even at 10k. 

It only matters in what range you run. You seldom will be running 
something in the full range. The results for c0.c9 will be the 
most realistic for everyday usage. There is no big difference 
measurable. (At this point variance comes into play, would need 
bigger data base to say something.)

The test script is kind of far away from everyday usage. 


So bottom line is: Unless one goes berserk with 10k running in 
full range, this looks like no problem.


I attached both versions.

[-- Attachment #1.2: choke1000.tar.bz2 --]
[-- Type: application/octet-stream, Size: 9860 bytes --]

[-- Attachment #1.3: choke10000.tar.bz2 --]
[-- Type: application/octet-stream, Size: 19838 bytes --]

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2012-08-10 21:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07 13:02 SELinux performance depending on type count Ole Kliemann
2012-08-07 14:12 ` David Quigley
2012-08-07 17:07 ` William Roberts
2012-08-07 17:36   ` Daniel J Walsh
2012-08-08 20:44 ` Ole Kliemann
2012-08-09 10:45   ` Adam Tkac
2012-08-09 11:56     ` Ole Kliemann
2012-08-10 12:11 ` Ole Kliemann
2012-08-10 13:00   ` Stephen Smalley
2012-08-10 14:36     ` Ole Kliemann
2012-08-10 15:05       ` Stephen Smalley
2012-08-10 15:43         ` Ole Kliemann
2012-08-10 15:44         ` Ole Kliemann
2012-08-10 16:08           ` Stephen Smalley
2012-08-10 16:18             ` Stephen Smalley
2012-08-10 17:00               ` Ole Kliemann
2012-08-10 18:08                 ` Stephen Smalley
2012-08-10 18:46                   ` Ole Kliemann
2012-08-10 18:55                     ` Stephen Smalley
2012-08-10 19:11                       ` Ole Kliemann
2012-08-10 19:19                         ` Stephen Smalley
2012-08-10 19:26                           ` Ole Kliemann
2012-08-10 19:50                             ` Stephen Smalley
2012-08-10 21:38 ` Ole Kliemann [this message]
2012-08-13 12:35   ` Stephen Smalley
2012-08-27 15:28     ` Ole Kliemann
2012-08-27 16:24       ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120810213845.GQ2296@telvanni \
    --to=ole@plastictree.net \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.