diff options
author | Jack Steiner <steiner@sgi.com> | 2008-06-19 22:51:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:23:28 -0400 |
commit | b6df1b8bc1250191cfee15627697111c1cbda53f (patch) | |
tree | b5991eafa0f5f4e155921bd10d4f44696c271b8d /include/asm-x86/mpspec.h | |
parent | d400524affeb84bdfc2b00cd561fbfb8c09dadd7 (diff) |
x86: fix stack overflow for large values of MAX_APICS
physid_mask_of_physid() causes a huge stack (12k) to be created if the
number of APICS is large. Replace physid_mask_of_physid() with a
new function that does not create large stacks. This is a problem only
on large x86_64 systems.
this paves the way to increase MAX_APICS.
Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: linux-mm@kvack.org
Cc: mingo@elte.hu
Cc: tglx@linutronix.de
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/mpspec.h')
-rw-r--r-- | include/asm-x86/mpspec.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asm-x86/mpspec.h b/include/asm-x86/mpspec.h index 57a991b9c053..b69e7ba7bf1d 100644 --- a/include/asm-x86/mpspec.h +++ b/include/asm-x86/mpspec.h | |||
@@ -101,6 +101,7 @@ typedef struct physid_mask physid_mask_t; | |||
101 | __physid_mask; \ | 101 | __physid_mask; \ |
102 | }) | 102 | }) |
103 | 103 | ||
104 | /* Note: will create very large stack frames if physid_mask_t is big */ | ||
104 | #define physid_mask_of_physid(physid) \ | 105 | #define physid_mask_of_physid(physid) \ |
105 | ({ \ | 106 | ({ \ |
106 | physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ | 107 | physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ |
@@ -108,6 +109,12 @@ typedef struct physid_mask physid_mask_t; | |||
108 | __physid_mask; \ | 109 | __physid_mask; \ |
109 | }) | 110 | }) |
110 | 111 | ||
112 | static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map) | ||
113 | { | ||
114 | physids_clear(*map); | ||
115 | physid_set(physid, *map); | ||
116 | } | ||
117 | |||
111 | #define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} } | 118 | #define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} } |
112 | #define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} } | 119 | #define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} } |
113 | 120 | ||