lkml.org 
[lkml]   [2007]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC 3/8] Flushing and zeroing higher order page cache pages
From
On (19/04/07 09:35), Christoph Lameter didst pronounce:
> ---
> include/linux/pagemap.h | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> Index: linux-2.6.21-rc7/include/linux/pagemap.h
> ===================================================================
> --- linux-2.6.21-rc7.orig/include/linux/pagemap.h 2007-04-18 22:08:36.000000000 -0700
> +++ linux-2.6.21-rc7/include/linux/pagemap.h 2007-04-18 22:09:13.000000000 -0700
> @@ -210,6 +210,33 @@ static inline void wait_on_page_writebac
>
> extern void end_page_writeback(struct page *page);
>
> +/* Support for clearing higher order pages */
> +static inline void clear_mapping_page(struct address_space *a,
> + struct page *page)
> +{
> + int nr_pages = 1 << a->order;
> + int i;
> +
> + for (i = 0; i < nr_pages; i++)
> + clear_highpage(page + i);
> +}

While this looks fine, it seems that clear_huge_page() and
clear_mapping_page() could share a common helper. I also note that
clear_huge_page() calls cond_reched() and this doesn't which may be the
type of different behavior we want to avoid.

That said, if this goes ahead, it might be an excuse to look at using
ramfs as the basis for hugetlbfs instead of it's current approach. I
believe using ramfs for hugepages is something that wli wants anyway.

> +
> +/*
> + * Support for flushing higher order pages.
> + *
> + * A bit stupid: On many platforms flushing the first page
> + * will flush any TLB starting there
> + */
> +static inline void flush_mapping_page(struct address_space *a,
> + struct page *page)
> +{
> + int nr_pages = 1 << a->order;
> + int i;
> +
> + for (i = 0; i < nr_pages; i++)
> + flush_dcache_page(page + i);
> +}
> +
> /*
> * Fault a userspace page into pagetables. Return non-zero on a fault.
> *

I suppose I'll see where this is used later in the patchset. It might be
easier to review if these helpers are introduced at the point they are
used.Not super-sure


> -
> 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/

--
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
-
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/

\
 
 \ /
  Last update: 2007-04-20 13:05    [W:0.253 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site