Skip to content

Commit

Permalink
mm/highmem: fix CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP
Browse files Browse the repository at this point in the history
The kernel test robot found that __kmap_local_sched_out() was not
correctly skipping the guard pages when DEBUG_KMAP_LOCAL_FORCE_MAP was
set.[1] This was due to DEBUG_HIGHMEM check being used.

Change the configuration check to be correct.

[1] https://lore.kernel.org/lkml/20210304083825.GB17830@xsang-OptiPlex-9020/

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 0e91a0c ("mm/highmem: Provide CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP")
Signed-off-by: Ira Weiny <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Oliver Sang <[email protected]>
Cc: Chaitanya Kulkarni <[email protected]>
Cc: David Sterba <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
weiny2 authored and torvalds committed Mar 25, 2021
1 parent a024b7c commit 487cfad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ void __kmap_local_sched_out(void)
int idx;

/* With debug all even slots are unmapped and act as guard */
if (IS_ENABLED(CONFIG_DEBUG_HIGHMEM) && !(i & 0x01)) {
if (IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL) && !(i & 0x01)) {
WARN_ON_ONCE(!pte_none(pteval));
continue;
}
Expand Down Expand Up @@ -654,7 +654,7 @@ void __kmap_local_sched_in(void)
int idx;

/* With debug all even slots are unmapped and act as guard */
if (IS_ENABLED(CONFIG_DEBUG_HIGHMEM) && !(i & 0x01)) {
if (IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL) && !(i & 0x01)) {
WARN_ON_ONCE(!pte_none(pteval));
continue;
}
Expand Down

0 comments on commit 487cfad

Please sign in to comment.