Re: [patch 3/9] Guest page hinting: volatile page cache.

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

 



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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux