Re: [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v6

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

 



On Mon, 9 Jun 2008, Russ Anderson wrote:

> -#define PAGE_FLAGS	(1 << PG_lru   | 1 << PG_private   | 1 << PG_locked | \
> +#define PAGE_FLAGS_BASE	(1 << PG_lru   | 1 << PG_private   | 1 << PG_locked | \
>  			 1 << PG_buddy | 1 << PG_writeback | \
>  			 1 << PG_slab  | 1 << PG_swapcache | 1 << PG_active)
> +
> +#ifdef CONFIG_PAGEFLAGS_EXTENDED
> +PAGEFLAG(MemError, memerror)
> +#define	PAGE_FLAGS	(PAGE_FLAGS_BASE | 1UL << PG_memerror)
> +#else
> +PAGEFLAG_FALSE(MemError)
> +#define	PAGE_FLAGS	(PAGE_FLAGS_BASE)
> +#endif

Hmmmm... That doesnt look nice. It would be good if we had some definition 
that  allows the simple oring with a flag mask. That mask should be 
zero if the flag is always false.

#ifdef CONFIG_PAGEFLAGS_EXTENDED
PAGEFLAG(MemError, memerror)
#define MemError_mask (1 << PG_memerror)
#else
PAGEFLAG_FALSE(MemError)
#define MemError_mask 0
#endif

#define	PAGE_FLAGS	(PAGE_FLAGS_BASE | MemError_mask)

Maybe we could have the PAGEFLAG and the PAGEFLAG_FALSE macros generate 
these definitions?

--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux