mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00: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 <kirill.shutemov@linux.intel.com> Acked-by: Hugh Dickins <hughd@google.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
fff4068cba
commit
597d795a2a
5 changed files with 8 additions and 7 deletions
|
@ -19,7 +19,7 @@
|
|||
|
||||
#define USE_CMPXCHG_LOCKREF \
|
||||
(IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \
|
||||
IS_ENABLED(CONFIG_SMP) && !BLOATED_SPINLOCKS)
|
||||
IS_ENABLED(CONFIG_SMP) && SPINLOCK_SIZE <= 4)
|
||||
|
||||
struct lockref {
|
||||
union {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue