Skip to content

Commit

Permalink
sched: numa: Fix build error if CONFIG_NUMA_BALANCING && !CONFIG_TRAN…
Browse files Browse the repository at this point in the history
…SPARENT_HUGEPAGE

Michal Hocko reported that the following build error occurs if
CONFIG_NUMA_BALANCING is set without THP support

  kernel/sched/fair.c: In function ‘task_numa_work’:
  kernel/sched/fair.c:932:55: error: call to ‘__build_bug_failed’ declared with attribute error: BUILD_BUG failed

The problem is that HPAGE_PMD_SHIFT triggers a BUILD_BUG() on
!CONFIG_TRANSPARENT_HUGEPAGE. This patch addresses the problem.

Reported-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Dec 17, 2012
1 parent a4f1de1 commit 221392c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ void task_numa_work(struct callback_head *work)
continue;

/* Skip small VMAs. They are not likely to be of relevance */
if (((vma->vm_end - vma->vm_start) >> PAGE_SHIFT) < HPAGE_PMD_NR)
if (vma->vm_end - vma->vm_start < HPAGE_SIZE)
continue;

do {
Expand Down

0 comments on commit 221392c

Please sign in to comment.