diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-18 14:24:46 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-07-18 14:24:46 -0400 |
commit | ce625a801664d8ed7344117bbb57510e4e0e872c (patch) | |
tree | 50e6760a0b1b506b234700afddc7296b28918650 /kernel/audit.c | |
parent | d5b454f2c40c9efd0cc113bc3220ebcb66b7c022 (diff) | |
download | linux-ce625a801664d8ed7344117bbb57510e4e0e872c.tar.gz linux-ce625a801664d8ed7344117bbb57510e4e0e872c.tar.bz2 linux-ce625a801664d8ed7344117bbb57510e4e0e872c.zip |
AUDIT: Reduce contention in audit_serial()
... by generating serial numbers only if an audit context is actually
_used_, rather than doing so at syscall entry even when the context
isn't necessarily marked auditable.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 27ffcf363f8d..d321e251d32b 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -625,7 +625,9 @@ unsigned int audit_serial(void) unsigned int ret; spin_lock_irqsave(&serial_lock, flags); - ret = serial++; + do { + ret = ++serial; + } while (unlikely(!ret)); spin_unlock_irqrestore(&serial_lock, flags); return ret; |