The above looks wrong. I don't know the code, but just by looking at
where the locking and interrupts are, I can take a guess.
Lets add a little more of the code:
local_irq_disable();
if (current_is_kswapd())
__count_vm_events(KSWAPD_STEAL, nr_freed);
__count_zone_vm_events(PGSTEAL, zone, nr_freed);
spin_lock(&zone->lru_lock);
/*
I'm guessing the __count_zone_vm_events and friends need interrupts
disabled here, probably due to per cpu stuff. But if you enable
interrupts before the spin_lock() you may let an interrupt come in and
invalidate what was done above it.
So no, I do not think enabling interrupts here is a good thing.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
okay, and since we have already done local_irq_disable(), then that is
why we only need the spin_lock() and not the spin_lock_irq() flavour?
Yes, spin_lock_irq() is equivalent to spin_lock() + irq_disable().
Now, we already disabled irq. then, we only need spin_lock().
So, I don't think shrink_inactive_list need any fix.
Thanks for the explanation!