diff options
| author | Miao Wang <[email protected]> | 2024-08-13 17:12:13 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-09-02 03:26:08 +0000 |
| commit | 6963f00813f49375360544fe923e62f2070601af (patch) | |
| tree | 06eee27ff50a9d13db724066971d43dbe6ecf9c5 /mm/vmalloc.c | |
| parent | mm: accept to promo watermark (diff) | |
| download | kernel-6963f00813f49375360544fe923e62f2070601af.tar.gz kernel-6963f00813f49375360544fe923e62f2070601af.zip | |
mm: vmalloc: add optimization hint on page existence check
In commit 21e516b913c1 ("mm: vmalloc: dump page owner info if page is
already mapped"), a BUG_ON macro was changed into an if statement, where
the compiler optimization hint introduced in the BUG_ON macro was removed
along with this change. This patch adds back the hint.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 21e516b913c1 ("mm: vmalloc: dump page owner info if page is already mapped")
Signed-off-by: Miao Wang <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Hariom Panthi <[email protected]>
Cc: "Uladzislau Rezki (Sony)" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/vmalloc.c')
| -rw-r--r-- | mm/vmalloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 884e21fed28f..dfa8f09e7e9d 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -105,7 +105,7 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, if (!pte) return -ENOMEM; do { - if (!pte_none(ptep_get(pte))) { + if (unlikely(!pte_none(ptep_get(pte)))) { if (pfn_valid(pfn)) { page = pfn_to_page(pfn); dump_page(page, "remapping already mapped page"); |
