From: Andi Kleen <andi@firstfloor.org>
To: linux-fsdevel@vger.kernel.org
Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org,
linux-kernel@vger.kernel.org, npiggin@kernel.dk,
shaohua.li@intel.com, sds@tycho.nsa.gov, jmorris@namei.org,
linux-security-module@vger.kernel.org
Subject: Make RCU dcache work with CONFIG_SECURITY=y
Date: Thu, 21 Apr 2011 17:23:18 -0700 [thread overview]
Message-ID: <1303431801-10540-1-git-send-email-andi@firstfloor.org> (raw)
We found that all .38+ kernels with CONFIG_SECURITY just enables -- but
not even any security module active -- are slower than .37. And also
they don't really scale on larger machines. CONFIG_SECURITY
is a quite common configuration, so this was seen multiple times.
The problem is that with CONFIG_SECURITY every directory permission
check will drop out of the RCU walk and redo a bunch of work
(and not scale of course), just in case the security module
cannot handle it.
This patchkit tries to address this. First it moves the check for
RCU walks into the low level security module, so for the
CONFIG_SECURITY=y selinux=0 at runtime case you always get full
performance. This is an independent patch.
Then it turned out that the two security modules who use the
inode_exec_permission hook that impacts dcache walking -- SMACK
and selinux -- already use RCU internally. So I added two
followon patches that make them not drop out of the RCU walk,
as long as they stay in their RCU "fast" path. For selinux
this means a cache hit only and no audit event. For smack
it means any check as long as auditing is disabled.
I didn't find good test suites for the security modules, so
there wasn't a lot of testing on this unfortunately
(the selinux one for LTP doesn't seem to work). Some close
review of these changes is needed.
On the other hand the VFS changes itself are very straight forward
and the 1/1 patch is very straight forward (and a win in itself)
The bottom line is with this patchkit a CONFIG_SECURITY=y
kernel has as good VFS performance as a kernel with CONFIG_SECURITY
disabled.
-Andi
next reply other threads:[~2011-04-22 0:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-22 0:23 Andi Kleen [this message]
2011-04-22 0:23 ` [PATCH 1/3] SECURITY: Move exec_permission RCU checks into security modules Andi Kleen
2011-04-22 0:46 ` Eric Paris
2011-04-22 4:34 ` Christoph Hellwig
2011-04-22 15:25 ` Andi Kleen
2011-04-22 15:27 ` Christoph Hellwig
2011-04-22 0:23 ` [PATCH 2/3] SELINUX: Make selinux cache VFS RCU walks safe Andi Kleen
2011-04-22 0:45 ` Eric Paris
2011-04-22 15:16 ` Andi Kleen
2011-04-22 0:23 ` [PATCH 3/3] SMACK: Make smack directory access check RCU safe Andi Kleen
2011-04-22 1:40 ` Make RCU dcache work with CONFIG_SECURITY=y Shaohua Li
2011-04-22 18:26 ` Linus Torvalds
2011-04-22 21:16 ` Andi Kleen
2011-04-22 21:32 ` Casey Schaufler
2011-04-22 21:17 ` Eric Paris
2011-04-22 23:29 ` Linus Torvalds
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=1303431801-10540-1-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=akpm@linux-foundation.org \
--cc=jmorris@namei.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=npiggin@kernel.dk \
--cc=sds@tycho.nsa.gov \
--cc=shaohua.li@intel.com \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox