[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] fixed both processes in D state and the /proc/ oopses [Re: [patch] Fixed the race that was oopsing Linux-2.2.0]
>>>>> "AA" == Andrea Arcangeli <andrea@e-mind.com> writes:
AA> On 30 Jan 1999, Eric W. Biederman wrote:
AA> The point is that you can't increment and test a mm->count if you are not
AA> sure that the mm exists on such piece of memory. And if you are sure that
AA> such piece of memory exists you don't need to check it and you can only
AA> increment it ;). Do you see my point now?
The check may be needed if someone is decrementing the count while you are
incrementing. To remove the need for the check would require a lock
on the task struct. (So a new pointer isn't written, and subsequently
the old data freed before you increment your count).
Furthermore I am perfectly aware, the race existed in my code, and that
it relied on fast code paths (not the best). But since it cleared
the interrupts I could if need be garantee on a given machine the code would
always work.
However that is not a very portable way to code and I wouldn't recommend it.
Eric
--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address'
in the body to majordomo@kvack.org. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/