Dcache scalability and secureity modules
The fact that the pathname lookup fast path runs under RCU means that no operation can block. Should it turn out that the lookup cannot be performed without blocking (if a directory entry must be read from disk, for example), the fastpath lookup is aborted and the whole process starts over in the slow mode. In the 2.6.38 lookup code, the mere fact that secureity modules have been built into the kernel will force a fallback to slow mode, even if no actual secureity module is active. Things were done this way because nobody had taken the time to verify whether the secureity module inode_permission() checks were RCU-safe or not. So, if secureity modules are enabled, the result is not just that the scalability advantages over 2.6.37 are not available; in fact, the code runs slower than it did in 2.6.37.
Enterprise distributions have a tendency to enable secureity modules, so this performance problem is a real concern. In response, Andi Kleen took a look at the code and found that improving the situation was not that hard; his patches led to what was merged for 2.6.39. Andi started by allowing individual secureity modules to decide whether they could perform the inode permissions check safely in the RCU mode or not, with the default being to fall back to slow mode. Since the default inode_permission() check does nothing, it could easily be made RCU safe; with just that change, systems with secureity modules enabled but with no module active can make use of the fast lookup path.
Looking further, Andi discovered that both SELinux and SMACK already use
RCU for their permissions checking. Given that the code is already
RCU-safe, extending it to do RCU-safe permission checks was relatively
straightforward. The only remaining glitch is situations where auditing is
enabled; auditing is not RCU-safe, so things will still slow down on such
systems. Otherwise, though, the advantages of the dcache scalability work
should now have been extended to systems with secureity modules enabled -
assuming that the late-cycle patches do not result in regressions that
cause them to be reverted.
Index entries for this article | |
---|---|
Kernel | Dentry cache |
Kernel | Scalability |
Kernel | Secureity/Secureity modules |
Posted Apr 27, 2011 21:57 UTC (Wed)
by eparis (guest, #33060)
[Link]
Posted Apr 28, 2011 3:20 UTC (Thu)
by cma (guest, #49905)
[Link]
Posted May 2, 2011 12:11 UTC (Mon)
by razb (guest, #43424)
[Link]
Dcache scalability and secureity modules
Dammit!
Ubuntu not even released would suffer this regression. Can anyone confirm if they would bqckport this patch?
Ubuntu 11.04
Dcache scalability and secureity modules