path: root/drivers/base
diff options
authorHugh Dickins <>2009-12-14 17:59:02 -0800
committerLinus Torvalds <>2009-12-15 08:53:17 -0800
commita70caa8ba48f21f46d3b4e71b6b8d14080bbd57a (patch)
tree2f6ab917400f82b9d16f1e945ba101a25f5d6281 /drivers/base
parent1cb1729b1385884648170d9d1d3aa0c66780d64b (diff)
mm: stop ptlock enlarging struct page
CONFIG_DEBUG_SPINLOCK adds 12 or 16 bytes to a 32- or 64-bit spinlock_t, and CONFIG_DEBUG_LOCK_ALLOC adds another 12 or 24 bytes to it: lockdep enables both of those, and CONFIG_LOCK_STAT adds 8 or 16 bytes to that. When 2.6.15 placed the split page table lock inside struct page (usually sized 32 or 56 bytes), only CONFIG_DEBUG_SPINLOCK was a possibility, and we ignored the enlargement (but fitted in CONFIG_GENERIC_LOCKBREAK's 4 by letting the spinlock_t occupy both page->private and page->mapping). Should these debugging options be allowed to double the size of a struct page, when only one minority use of the page (as a page table) needs to fit a spinlock in there? Perhaps not. Take the easy way out: switch off SPLIT_PTLOCK_CPUS when DEBUG_SPINLOCK or DEBUG_LOCK_ALLOC is in force. I've sometimes tried to be cleverer, kmallocing a cacheline for the spinlock when it doesn't fit, but given up each time. Falling back to mm->page_table_lock (as we do when ptlock is not split) lets lockdep check out the strictest path anyway. And now that some arches allow 8192 cpus, use 999999 for infinity. (What has this got to do with KSM swapping? It doesn't care about the size of struct page, but may care about random junk in page->mapping - to be explained separately later.) Signed-off-by: Hugh Dickins <> Cc: Izik Eidus <> Cc: Andrea Arcangeli <> Cc: Nick Piggin <> Cc: KOSAKI Motohiro <> Cc: Rik van Riel <> Cc: Lee Schermerhorn <> Cc: Andi Kleen <> Cc: KAMEZAWA Hiroyuki <> Cc: Wu Fengguang <> Cc: Minchan Kim <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'drivers/base')
0 files changed, 0 insertions, 0 deletions