Quantcast
Channel: lkml.org : Shesha Sreenivasamurthy
Viewing all articles
Browse latest Browse all 1267

Re: write_lock_irq(&tasklist_lock)

$
0
0
Linus Torvalds writes: (Summary) It covers too much, but trying to split it up has never worked well.
split it up has never worked well.
It's usually not a huge problem because there are so few writers, but what you're seeing is the writer starvation issue because readers can be plentiful.
plentiful.

[...]

I use write_unlock instead of write_lock_irq in portion of code? You absolutely need write_lock_irq(), because taking the tasklist_lock without disabling interrupts will deadlock very quickly due to an interrupt taking the tasklist_lock for reading.
taking the tasklist_lock for reading.
That said, the write_lock_irq(&tasklist_lock) could possibly be replaced with something like
with something like
static void tasklist_write_lock(void)
   {
         unsigned long flags;

Viewing all articles
Browse latest Browse all 1267