[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] shm cleanups



Hi Ingo,

Ingo Molnar <mingo@chiara.csoma.elte.hu> writes:

> On 3 Nov 1999, Christoph Rohland wrote:
> 
> > I did test it a lot on SMP/HIGHMEM. Since 2.3.25 with and without this
> > breaks on swapping shm and other high memory load conditions I could
> > not verify everything. But I would like to see this in the mainstream
> > kernel. I will then proceed debugging the swapping issues.
> 
> (i can see the problems too, but i've got no explanation either, working
> on it as well.)
> 
> -- mingo

After applying the following patch against ipc/shm.c (thanks to Larry
Woodman <woodman@missioncriticallinux.com> for the first one):

--- 2.3.25/ipc/shm.c    Tue Nov  2 12:46:29 1999
+++ make25/ipc/shm.c    Thu Nov  4 12:47:14 1999
@@ -788,10 +789,10 @@
                unlock_kernel();
                return 0;
        }
-       if (page_count(page_map))
+       if (page_count(page_map) != 1)
                goto check_table;
        if (!(page_map = prepare_highmem_swapout(page_map)))
-               goto check_table;
+               goto failed;
        shp->shm_pages[idx] = swp_entry_to_pte(swap_entry);
        swap_successes++;
        shm_swp++;
791c791
< 	if (page_count(page_map))
---
> 	if (page_count(page_map) != 1)

I get the same behaviour for shm swapping as on 2.3.22 as long as I
only use 1G memory (HIGHMEM setting is always 64GB).

I do get swapping also with 8GB of RAM, but it runs out of memory
before running out of swap space since prepare_highmem_swapout is
failing way to often.

(It then locks up since it cannot free the shm segments and so is
unable to free the memory. This should be perhaps addressed later in
the oom handler. It cannot handle the case where nearly all memory is
allocted in shm segments)

Greetings
          Christoph
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/