lkml.org 
[lkml]   [2008]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[02/14] vcompound: pageflags: Add PageVcompound()
    Add a another page flag that can be used to figure out if a compound
    page is virtually mapped. The mark is necessary since we have to know
    when freeing pages if we have to destroy a virtual mapping.

    No additional flag is needed. We use PG_swapcache together with PG_compound
    (similar to PageHead() and PageTail()) to signal that a compound
    page is virtually mapped. PG_swapcache is not used at this point since
    compound pages cannot be put onto the LRU (yet).

    Signed-off-by: Christoph Lameter <clameter@sgi.com>
    ---
    include/linux/page-flags.h | 18 ++++++++++++++++++
    1 file changed, 18 insertions(+)

    Index: linux-2.6.25-rc5-mm1/include/linux/page-flags.h
    ===================================================================
    --- linux-2.6.25-rc5-mm1.orig/include/linux/page-flags.h 2008-03-20 17:40:16.141487362 -0700
    +++ linux-2.6.25-rc5-mm1/include/linux/page-flags.h 2008-03-20 17:41:58.768233703 -0700
    @@ -196,6 +196,24 @@ static inline int PageHighMem(struct pag
    }
    #endif

    +/*
    + * PG_swapcache is used in combination with PG_compound to indicate
    + * that a compound page was allocated via vmalloc.
    + */
    +#define PG_vcompound_mask ((1L << PG_compound) | (1L << PG_swapcache))
    +#define PageVcompound(page) ((page->flags & PG_vcompound_mask) \
    + == PG_vcompound_mask)
    +
    +static inline void __SetPageVcompound(struct page *page)
    +{
    + page->flags |= PG_vcompound_mask;
    +}
    +
    +static inline void __ClearPageVcompound(struct page *page)
    +{
    + page->flags &= ~PG_vcompound_mask;
    +}
    +
    #ifdef CONFIG_SWAP
    PAGEFLAG(SwapCache, swapcache)
    #else
    --


    \
     
     \ /
      Last update: 2008-03-21 07:23    [W:0.022 / U:93.200 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site