Skip to content
Commit 20d4e80d authored by John Johansen's avatar John Johansen
Browse files

apparmor: only get a label reference if the fast path check fails

The common fast path check can be done under rcu_read_lock() and
doesn't need a reference count on the label. Only take a reference
count if entering the slow path.

Fixes reported hackbench regression
  - sha1 79e178a5 ("Merge tag 'apparmor-pr-2019-12-03' of
    git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor")

  hackbench -l (256000/#grp) -g #grp
   128 groups     19.679 ±0.90%

  - previous sha1 01d1dff6 ("Merge tag 's390-5.5-2' of
    git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux"

)

  hackbench -l (256000/#grp) -g #grp
   128 groups     3.1689 ±3.04%

Reported-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Tested-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Tested-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fixes: bce4e7e9 ("apparmor: reduce rcu_read_lock scope for aa_file_perm mediation")
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent 9c95a278
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment