On Wed, Jul 14, 2010 at 03:56:43PM -0700, Linus Torvalds wrote:
But then, even if you ensure that, don't we need to also fill lower level
entries for the new mapping.
Also, why is this a worry for vmalloc but not for kmalloc? Don't we also
risk to add a new memory mapping for new memory allocated with kmalloc?
But then how did the previous tasks get this new mapping? You said
we don't walk through every process page tables for vmalloc.
I would understand this race if we were to walk on every processes page
tables and add the new mapping on them, but we missed one new task that
forked or so, because we didn't lock (or just rcu).
Yeah.
So the parts of the problem I don't understand are:
- why don't we have this problem with kmalloc() ?
- did I understand well the race that makes the fault necessary,
ie: we walk the tasklist lockless, add the new mapping if
not present, but we might miss a task lately forked, but
the fault will fix that.
Thanks.
--