From: Paul Jackson Date: Thu, 7 Dec 2006 04:31:49 +0000 (-0800) Subject: [PATCH] memory page_alloc zonelist caching reorder structure X-Git-Tag: v2.6.20-rc1~145^2^2~354 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7253f4ef04b1cd138baf2b29a95473743ac0a307;p=linux-2.6 [PATCH] memory page_alloc zonelist caching reorder structure Rearrange the struct members in the 'struct zonelist_cache' structure, so as to put the readonly (once initialized) z_to_n[] array first, where it will come right after the zones[] array in struct zonelist. This pretty much eliminates the chance that the two frequently written elements of 'struct zonelist_cache', the fullzones bitmap and last_full_zap times, will end up on the same cache line as the performance sensitive, frequently read, never (after init) written zones[] array. Keeping frequently written data off frequently read cache lines is good for performance. Thanks to Rohit Seth for the suggestion. Signed-off-by: Paul Jackson Cc: Rohit Seth Cc: Paul Menage Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 09bf9d8d7b..da6002dec2 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -352,8 +352,8 @@ struct zone { struct zonelist_cache { - DECLARE_BITMAP(fullzones, MAX_ZONES_PER_ZONELIST); /* zone full? */ unsigned short z_to_n[MAX_ZONES_PER_ZONELIST]; /* zone->nid */ + DECLARE_BITMAP(fullzones, MAX_ZONES_PER_ZONELIST); /* zone full? */ unsigned long last_full_zap; /* when last zap'd (jiffies) */ }; #else