All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Oprala <ooprala@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov
Subject: Re: setfscreatecon optimizations
Date: Wed, 09 Jan 2013 13:03:26 +0100	[thread overview]
Message-ID: <50ED5C8E.4040202@redhat.com> (raw)
In-Reply-To: <50EC31AE.5040807@tycho.nsa.gov>

[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]

Thank you for the pointers, it helped me out a lot. I tested the patched 
libselinux with
$cp -a dir1 dir2
and got an approx. 20% save in instruction count. The patch is attached.
Thanks,
Ondrej

On 01/08/2013 03:48 PM, Stephen Smalley wrote:
> On 01/08/2013 08:20 AM, Ondrej Oprala wrote:
>> Hi, there have been some attempts on the coreutils mailing list at
>> optimizing cp copying by caching the selinux security context ( please
>> see: 
>> http://lists.gnu.org/archive/html/coreutils/2013-01/msg00012.html ).
>> Would it be possible to perform some kind of caching inside
>> setfscreatecon? For example not going through the whole process of
>> setfscreatecon if the context to be set equals the current one?
>
> I think that should be possible.  The relevant code that would need to 
> be modified is in libselinux/src/procattr.c.  You would likely want to 
> modify the common helper for all of the set*con functions, 
> setprocattrcon_raw().  A conceptually similar cache exists in 
> libselinux/src/setrans_client.c; note the methods used to make it 
> thread-safe and to ensure that it is properly freed. You would need a 
> separate cache for each kind of attribute that can be set, i.e. 
> current, exec, fscreate, keycreate, sockcreate. You could likely also 
> cache the tid.


[-- Attachment #2: DIFF --]
[-- Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2013-01-09 12:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-08 13:20 setfscreatecon optimizations Ondrej Oprala
2013-01-08 14:48 ` Stephen Smalley
2013-01-09 12:03   ` Ondrej Oprala [this message]
2013-01-09 14:30     ` Eric Paris
2013-01-09 14:51       ` Eric Paris
2013-01-09 20:17         ` Ondrej Oprala
2013-01-09 21:30           ` Daniel J Walsh

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=50ED5C8E.4040202@redhat.com \
    --to=ooprala@redhat.com \
    --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.