Re: Helding the Kernel lock while doing IO???

From: Andrea Arcangeli (andrea@suse.de)
Date: Sat May 06 2000 - 08:16:50 EST


On 6 May 2000, Juan J. Quintela wrote:

>I am losing some detail?

kernel lock is released by schedule(). (the only problem of swapin are the
races with swapoff)

>diff -u -urN --exclude=CVS --exclude=*~ --exclude=.#* --exclude=TAGS pre7-6/ipc/shm.c testing2/ipc/shm.c
>--- pre7-6/ipc/shm.c Fri May 5 23:58:56 2000
>+++ testing2/ipc/shm.c Sat May 6 02:39:17 2000
>@@ -1379,10 +1379,11 @@
> if (!page) {
> lock_kernel();
> swapin_readahead(entry);
>- page = read_swap_cache(entry);
>+ page = read_swap_cache_async(entry, 0);
> unlock_kernel();
> if (!page)
> goto oom;
>+ wait_on_page(page);
> }
> delete_from_swap_cache(page);
> page = replace_with_highmem(page);
>diff -u -urN --exclude=CVS --exclude=*~ --exclude=.#* --exclude=TAGS pre7-6/mm/memory.c testing2/mm/memory.c
>--- pre7-6/mm/memory.c Fri May 5 23:58:56 2000
>+++ testing2/mm/memory.c Sat May 6 02:02:53 2000
>@@ -1038,11 +1038,10 @@
> if (!page) {
> lock_kernel();
> swapin_readahead(entry);
>- page = read_swap_cache(entry);
>+ page = read_swap_cache_async(entry, 0);
> unlock_kernel();
> if (!page)
> return -1;
>-
> flush_page_to_ram(page);
> flush_icache_page(vma, page);
> }

The above patch would break swapin.

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 : Sun May 07 2000 - 21:00:19 EST