From: Andy Whitcroft Date: Wed, 1 Feb 2006 11:05:27 +0000 (-0800) Subject: [PATCH] GFP_ZONETYPES: calculate from GFP_ZONEMASK X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ce2ea89ba101d976907128441ba3aca72a8804b9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] GFP_ZONETYPES: calculate from GFP_ZONEMASK GFP_ZONETYPES calculate from GFP_ZONEMASK GFP_ZONETYPES's value is directly related to the value of GFP_ZONEMASK. It takes one of two forms depending whether the top bit of GFP_ZONEMASK is a 'loner'. Supply both forms, enabling the loner. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 88c30f844abf..ebfc238cc243 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -98,11 +98,14 @@ struct per_cpu_pageset { * of three zone modifier bits, we could require up to eight zonelists. * If the left most zone modifier is a "loner" then the highest valid * zonelist would be four allowing us to allocate only five zonelists. + * Use the first form for GFP_ZONETYPES when the left most bit is not + * a "loner", otherwise use the second. * * NOTE! Make sure this matches the zones in */ #define GFP_ZONEMASK 0x07 -#define GFP_ZONETYPES 5 +/* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */ +#define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */ /* * On machines where it is needed (eg PCs) we divide physical memory