Re: Bad SMP race in getblk()

From: Andrea Arcangeli (andrea@suse.de)
Date: Wed Aug 02 2000 - 16:17:19 EST


On Wed, 2 Aug 2000, Tigran Aivazian wrote:

>But on UP the above alias = __get_hash_table() is not really needed. I
>know that page cache code contains similar "insert unique" tricks which
>hurt UP performance but why not think of a better way to approach it,
>while we are at it?

I agree.

I prefer to do it without lookup too and it's actually trivial to do that
even in SMP. I did a patch against 2.4.0-test5 that should achieve that
purpose (it compiles but I've not booted it).

        ftp://ftp.*.kernel.org/pub/linux/kernel/people/andrea/patches/v2.4/2.4.0-test5/getblk-smp-race-1

And this is a fix for a deadlock during OOM (spotted by Ingo Molnar) a
while ago. If you think it's better to break schedule in two instead of
the below hack that's ok for me (OTOH the performance difference should be
irrelevant at least for the below case, the conditional_schedule() would
get sure more benefit but still the schedule case is a slow path there
too).

        ftp://ftp.*.kernel.org/pub/linux/kernel/people/andrea/patches/v2.4/2.4.0-test5/refill_freelist-oom-deadlock-1

Andrea

-
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/



This archive was generated by hypermail 2b29 : Mon Aug 07 2000 - 21:00:09 EST