[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46F13B6C.7020501@redhat.com>
Date: Wed, 19 Sep 2007 11:08:28 -0400
From: Rik van Riel <riel@...hat.com>
To: Christoph Lameter <clameter@....com>
CC: Andy Whitcroft <apw@...dowen.org>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
Christoph Hellwig <hch@....de>, Mel Gorman <mel@...net.ie>,
David Chinner <dgc@....com>
Subject: Re: [RFC 13/26] SLUB: Add SlabReclaimable() to avoid repeated reclaim
attempts
Christoph Lameter wrote:
> Add a flag SlabReclaimable() that is set on slabs with a method
> that allows defrag/reclaim. Clear the flag if a reclaim action is not
> successful in reducing the number of objects in a slab. The reclaim
> flag is set again if all objects have been allocated from it.
>
> Signed-off-by: Christoph Lameter <clameter@....com>
> ---
> mm/slub.c | 42 ++++++++++++++++++++++++++++++++++++------
> 1 file changed, 36 insertions(+), 6 deletions(-)
>
> Index: linux-2.6/mm/slub.c
> ===================================================================
> --- linux-2.6.orig/mm/slub.c 2007-08-28 20:10:37.000000000 -0700
> +++ linux-2.6/mm/slub.c 2007-08-28 20:10:47.000000000 -0700
> @@ -107,6 +107,8 @@
> #define SLABDEBUG 0
> #endif
>
> +#define SLABRECLAIMABLE (1 << PG_dirty)
> +
> static inline int SlabFrozen(struct page *page)
> {
> return page->flags & FROZEN;
> @@ -137,6 +139,21 @@ static inline void ClearSlabDebug(struct
> page->flags &= ~SLABDEBUG;
> }
>
> +static inline int SlabReclaimable(struct page *page)
> +{
> + return page->flags & SLABRECLAIMABLE;
> +}
> +
> +static inline void SetSlabReclaimable(struct page *page)
> +{
> + page->flags |= SLABRECLAIMABLE;
> +}
> +
> +static inline void ClearSlabReclaimable(struct page *page)
> +{
> + page->flags &= ~SLABRECLAIMABLE;
> +}
Why is it safe to not use the normal page flag bit operators
for these page flags operations?
--
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is. Each group
calls the other unpatriotic.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists