From: Jack Steiner Date: Mon, 5 Dec 2005 19:56:50 +0000 (-0600) Subject: [IA64] Limit the maximum NODEDATA_ALIGN() offset X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=acb7f67280128a9ddaa756ff10212391d28caec4;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [IA64] Limit the maximum NODEDATA_ALIGN() offset The per-node data structures are allocated with strided offsets that are a function of the node number. This prevents excessive cache-aliasing from occurring. On systems with a large number of nodes, the strided offset becomes too large. This patch restricts the maximum offset to 32MB. This is far larger than the size of any current L3 cache. Signed-off-by: Jack Steiner Signed-off-by: Tony Luck --- diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index 0f776b032d3..c87d6d1d581 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c @@ -50,8 +50,10 @@ static nodemask_t memory_less_mask __initdata; * To prevent cache aliasing effects, align per-node structures so that they * start at addresses that are strided by node number. */ +#define MAX_NODE_ALIGN_OFFSET (32 * 1024 * 1024) #define NODEDATA_ALIGN(addr, node) \ - ((((addr) + 1024*1024-1) & ~(1024*1024-1)) + (node)*PERCPU_PAGE_SIZE) + ((((addr) + 1024*1024-1) & ~(1024*1024-1)) + \ + (((node)*PERCPU_PAGE_SIZE) & (MAX_NODE_ALIGN_OFFSET - 1))) /** * build_node_maps - callback to setup bootmem structs for each node