diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-12-01 21:44:50 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-12-04 09:11:28 +0100 |
commit | c332813b51cbe807d539bb059b81235abf1e3fdd (patch) | |
tree | 6cdca0850c8f281fe95bb30c54dc75620c9fed34 /arch/x86/mm/debug_pagetables.c | |
parent | 8609d1b5daa36350e020e737946c40887af1743a (diff) | |
download | linux-c332813b51cbe807d539bb059b81235abf1e3fdd.tar.bz2 |
x86/mm/mtrr: Mark the 'range_new' static variable in mtrr_calc_range_state() as __initdata
'range_new' doesn't seem to be used after init. It is only passed
to memset(), sum_ranges(), memcmp() and x86_get_mtrr_mem_range(), the
latter of which also only passes it on to various *range*
library functions.
So mark it __initdata to free up an extra page after init.
Its contents are wiped at every call to mtrr_calc_range_state(),
so it being static is not about preserving state between calls,
but simply to avoid a 4k+ stack frame. While there, add a
comment explaining this and why it's safe.
We could also mark nr_range_new as __initdata, but since it's
just a single int and also doesn't carry state between calls (it
is unconditionally assigned to before it is read), we might as
well make it an ordinary automatic variable.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Toshi Kani <toshi.kani@hp.com>
Link: http://lkml.kernel.org/r/1449002691-20783-1-git-send-email-linux@rasmusvillemoes.dk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/mm/debug_pagetables.c')
0 files changed, 0 insertions, 0 deletions