On Fri, 2006-09-01 at 11:41 -0700, Dave Hansen wrote: > While something like the following wouldn't be scalable, it would > functionally work, right? > > +static void __page_discard(struct page *page) > +{ > + spin_lock(discard_lock); > ... > + spin_unlock(discard_lock); > +} > > +void __delete_from_swap_cache(struct page *page) > +{ > + spin_lock(discard_lock); > ... > + spin_unlock(discard_lock); > +} > > +void __remove_from_page_cache(struct page *page) > +{ > + spin_lock(discard_lock); > ... > + spin_unlock(discard_lock); > +} Any kind of locking won't work. You need the information that a page has been discarded until the page has been freed. Only then the fact that the page has been discarded may enter nirvana. Any kind of lock needs to be freed again to allow the next discard fault to happen. Since you don't when the last page reference is returned you cannot hold the lock until the page is free. -- blue skies, Martin. Martin Schwidefsky Linux for zSeries Development & Services IBM Deutschland Entwicklung GmbH "Reality continues to ruin my life." - Calvin. -- VGER BF report: H 0 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Dave Hansen <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- References:
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Dave Hansen <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Martin Schwidefsky <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Andy Whitcroft <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Martin Schwidefsky <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Dave Hansen <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Martin Schwidefsky <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Dave Hansen <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Martin Schwidefsky <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Dave Hansen <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Martin Schwidefsky <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Dave Hansen <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Martin Schwidefsky <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Dave Hansen <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Martin Schwidefsky <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- From: Dave Hansen <[email protected]>
- Re: [patch 3/9] Guest page hinting: volatile page cache.
- Prev by Date: [2.6.19 PATCH 1/7] ehea: interface to network stack
- Next by Date: Re: [PATCH 03/22][RFC] Unionfs: Branch management functionality
- Previous by thread: Re: [patch 3/9] Guest page hinting: volatile page cache.
- Next by thread: Re: [patch 3/9] Guest page hinting: volatile page cache.
- Index(es):