Re: [PATCH] mm/memory.c, 2.4.1 : memory leak with swap cache (updated)

Rik van Riel (riel@conectiva.com.br)
Fri, 23 Mar 2001 08:21:35 -0300 (BRST)


On Fri, 23 Mar 2001, Richard Jerrell wrote:
> > Your idea is nice, but the patch lacks a few things:
> >
> > - SMP locking, what if some other process faults in this page
> > between the atomic_read of the page count and the test later?
>
> It can't happen. free_pte is called with the page_table_lock held in
> addition to having the mmap_sem downed.

The page_table_lock and the mmap_sem only protect the *current*
task. Think about something like an apache with 500 children who
COW share the same page...

> > - testing if our process is the _only_ user of this swap page,
> > for eg. apache you'll have lots of COW-shared pages .. it would
> > be good to keep the page in memory for our siblings
>
> This is already done in free_page_and_swap_cache.

Ok ...

regards,

Rik

--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

http://www.surriel.com/ http://www.conectiva.com/ http://distro.conectiva.com.br/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/