From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Hugh Dickins <hughd@google.com>, SeongJae Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Naresh Kamboju <naresh.kamboju@linaro.org>,
Linux MM <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH for-mm 1/2 v2] mm/internal: Implement no-op mlock_page_drain() for !CONFIG_MMU
Date: Wed, 9 Feb 2022 20:44:02 -0800 (PST) [thread overview]
Message-ID: <8eae6026-098-befb-92d3-b9ad2ad57776@google.com> (raw)
In-Reply-To: <CAMuHMdV7EaHK5zJAbLU9eKwMYxFdAQ0TiS+Ydg56mGkBv09dHA@mail.gmail.com>
From: SeongJae Park <sj@kernel.org>
Commit 4b3b8bd6c8287 ("mm/munlock: mlock_page() munlock_page() batch by
pagevec") in -mm tree[1] implements 'mlock_page_drain()' under
CONFIG_MMU only, but the function is used by 'lru_add_drain_cpu()',
which defined outside of CONFIG_MMU. As a result, below build error
occurs.
/linux/mm/swap.c: In function 'lru_add_drain_cpu':
/linux/mm/swap.c:637:2: error: implicit declaration of function 'mlock_page_drain' [-Werror=implicit-function-declaration]
637 | mlock_page_drain(cpu);
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
/linux/scripts/Makefile.build:289: recipe for target 'mm/swap.o' failed
This commit fixes it by implementing no-op 'mlock_page_drain()' for
!CONFIG_MMU case, similar to 'mlock_new_page()'.
[1] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-munlock-mlock_page-munlock_page-batch-by-pagevec.patch
[hughd: add need_mlock_page_drain() stub too]
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Hugh Dickins <hughd@google.com>
---
Andrew, Stephen, please add as fix to
mm-munlock-mlock_page-munlock_page-batch-by-pagevec.patch
Thanks!
mm/internal.h | 2 ++
1 file changed, 2 insertions(+)
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -508,6 +508,8 @@ static inline void mlock_vma_page(struct page *page,
static inline void munlock_vma_page(struct page *page,
struct vm_area_struct *vma, bool compound) { }
static inline void mlock_new_page(struct page *page) { }
+static inline bool need_mlock_page_drain(int cpu) { return false; }
+static inline void mlock_page_drain(int cpu) { }
static inline void vunmap_range_noflush(unsigned long start, unsigned long end)
{
}
next prev parent reply other threads:[~2022-02-10 4:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 9:41 [PATCH for-mm 0/2] Fix trivial build errors on -mm tree SeongJae Park
2022-02-09 9:41 ` [PATCH for-mm 1/2] mm/internal: Implement no-op mlock_page_drain() for !CONFIG_MMU SeongJae Park
2022-02-09 15:37 ` Hugh Dickins
2022-02-09 16:19 ` Geert Uytterhoeven
2022-02-10 4:37 ` Hugh Dickins
2022-02-10 4:44 ` Hugh Dickins [this message]
2022-02-10 7:58 ` [PATCH for-mm 1/2 v2] " SeongJae Park
2022-02-11 3:58 ` Stephen Rothwell
2022-02-09 9:41 ` [PATCH for-mm 2/2] mm/gup: Make migrate_device_page() fails always if !CONFIG_DEVICE_PRIVATE SeongJae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8eae6026-098-befb-92d3-b9ad2ad57776@google.com \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=naresh.kamboju@linaro.org \
--cc=sfr@canb.auug.org.au \
--cc=sj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox