Skip to content

Commit

Permalink
mm/page_alloc: Revert pahole zero-sized workaround
Browse files Browse the repository at this point in the history
Commit dbbee9d ("mm/page_alloc: convert per-cpu list protection to
local_lock") folded in a workaround patch for pahole that was unable to
deal with zero-sized percpu structures.

A superior workaround is achieved with commit a0b8200 ("kbuild:
skip per-CPU BTF generation for pahole v1.18-v1.21").

This patch reverts the dummy field and the pahole version check.

Fixes: dbbee9d ("mm/page_alloc: convert per-cpu list protection to local_lock")
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Jul 10, 2021
1 parent 1e16624 commit 6bce244
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,6 @@ config DEBUG_INFO_BTF
config PAHOLE_HAS_SPLIT_BTF
def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119")

config PAHOLE_HAS_ZEROSIZE_PERCPU_SUPPORT
def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "122")

config DEBUG_INFO_BTF_MODULES
def_bool y
depends on DEBUG_INFO_BTF && MODULES && PAHOLE_HAS_SPLIT_BTF
Expand Down
11 changes: 0 additions & 11 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,6 @@ static DEFINE_MUTEX(pcp_batch_high_lock);

struct pagesets {
local_lock_t lock;
#if defined(CONFIG_DEBUG_INFO_BTF) && \
!defined(CONFIG_DEBUG_LOCK_ALLOC) && \
!defined(CONFIG_PAHOLE_HAS_ZEROSIZE_PERCPU_SUPPORT)
/*
* pahole 1.21 and earlier gets confused by zero-sized per-CPU
* variables and produces invalid BTF. Ensure that
* sizeof(struct pagesets) != 0 for older versions of pahole.
*/
char __pahole_hack;
#warning "pahole too old to support zero-sized struct pagesets"
#endif
};
static DEFINE_PER_CPU(struct pagesets, pagesets) = {
.lock = INIT_LOCAL_LOCK(lock),
Expand Down

0 comments on commit 6bce244

Please sign in to comment.