>
> This my patch should fix all races (both UP and SMP). Please try it out.
> It's against 2.3.27pre4. As the anonymous swapin we are protected by the
> per-mm semaphore, in shm we must protect us with a per-shm-segment
> semaphore to handle the swapin case safely. The design is almost the same
> as in the anonymous swapin then.
Intersting idea. I thought about acquiring the kernel lock a bit earlier,
but perhaps I can avoid that with a semaphore.
>
> The only ordering rule I added is that shm_lock must be acquired _before_
> pagecache_lock.
>
Yes.
> I am stressing the code with your shmtst on SMP and it works fine here.
>
> I suggest applying my race fixes to the stock kernel as the design looks
> like the right one to me now.
>
I don't like the semaphore, because (AFAICS, I'm only looking at the diff)
you single-thread the swapin code (per-segment, but still single thread)
I'll think about it,
Manfred
-
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/