mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
mm: do not allocate page->ptl dynamically, if spinlock_t fits to long
In struct page we have enough space to fit long-size page->ptl there, but we use dynamically-allocated page->ptl if size(spinlock_t) is larger than sizeof(int). It hurts 64-bit architectures with CONFIG_GENERIC_LOCKBREAK, where sizeof(spinlock_t) == 8, but it easily fits into struct page. Signed-off-by: Kirill A. Shutemov <[email protected]> Acked-by: Hugh Dickins <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
fff4068cba
commit
597d795a2a
5 changed files with 8 additions and 7 deletions
|
|
@ -22,6 +22,6 @@ void foo(void)
|
|||
#ifdef CONFIG_SMP
|
||||
DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));
|
||||
#endif
|
||||
DEFINE(BLOATED_SPINLOCKS, sizeof(spinlock_t) > sizeof(int));
|
||||
DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
|
||||
/* End of constants */
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue