mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
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>
This commit is contained in:
parent
d5b454f2c4
commit
ce625a8016
2 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue