1. 01 4月, 2012 2 次提交
    • L
      selinux: inline avc_audit() and avc_has_perm_noaudit() into caller · cdb0f9a1
      Linus Torvalds 提交于
      Now that all the slow-path code is gone from these functions, we can
      inline them into the main caller - avc_has_perm_flags().
      
      Now the compiler can see that 'avc' is allocated on the stack for this
      case, which helps register pressure a bit.  It also actually shrinks the
      total stack frame, because the stack frame that avc_has_perm_flags()
      always needed (for that 'avc' allocation) is now sufficient for the
      inlined functions too.
      
      Inlining isn't bad - but mindless inlining of cold code (see the
      previous commit) is.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cdb0f9a1
    • L
      selinux: don't inline slow-path code into avc_has_perm_noaudit() · a554bea8
      Linus Torvalds 提交于
      The selinux AVC paths remain some of the hottest (and deepest) codepaths
      at filename lookup time, and we make it worse by having the slow path
      cases take up I$ and stack space even when they don't trigger.  Gcc
      tends to always want to inline functions that are just called once -
      never mind that this might make for slower and worse code in the caller.
      
      So this tries to improve on it a bit by making the slow-path cases
      explicitly separate functions that are marked noinline, causing gcc to
      at least no longer allocate stack space for them unless they are
      actually called.  It also seems to help register allocation a tiny bit,
      since gcc now doesn't take the slow case code into account.
      
      Uninlining the slow path may also allow us to inline the remaining hot
      path into the one caller that actually matters: avc_has_perm_flags().
      I'll have to look at that separately, but both avc_audit() and
      avc_has_perm_noaudit() are now small and lean enough that inlining them
      may make sense.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a554bea8
  2. 31 3月, 2012 37 次提交
  3. 30 3月, 2012 1 次提交