mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 11:31:31 +00:00
Update tsacct.c
Optimize acct_update_integrals by replacing local_irq_save with a more fine-grained spinlock (tsk->mm->page_table_lock) to reduce locking overhead. This minimizes the time interrupts are disabled while still ensuring the integrity of the accounting data.
This commit is contained in:
parent
906bd684e4
commit
4cd3b6f0a6
@ -154,10 +154,10 @@ void acct_update_integrals(struct task_struct *tsk)
|
||||
u64 utime, stime;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
spin_lock_irqsave(&tsk->mm->page_table_lock, flags);
|
||||
task_cputime(tsk, &utime, &stime);
|
||||
__acct_update_integrals(tsk, utime, stime);
|
||||
local_irq_restore(flags);
|
||||
spin_unlock_irqrestore(&tsk->mm->page_table_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user