Re: [patch] Fixed the race that was oopsing Linux-2.2.0

Andrea Arcangeli (andrea@e-mind.com)
Wed, 27 Jan 1999 12:49:26 +0100 (CET)


On Wed, 27 Jan 1999, Richard Gooch wrote:

> The parts of your patch like this are completely bogus! If this fixes

I don't think so. The only reason we was using atomic_t for mm->count was
to not having to spin_lock() around mmput/mmget() because we was
automagically serializeing the changes on mm->count. But now I am forced
to mm_lock when there's a race risk. Places that was only reading
mm->count without other locks was just at race risk and they have to known
what they are doing. An atomic_read() is far from be something of atomic,
it's just a wrapper to see what is there in the variable without knowing
it's internal structure. Note there are places were we don't need to
spin_lock(&mm_lock) because we know we can't race even if we are writing
over mm->count (e.g. recovering from an error after an mm_alloc(), see
fork.c).

Tell me if I missed something.

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/