From patchwork Wed Feb 9 09:41:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12739929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01E9C433EF for ; Wed, 9 Feb 2022 09:42:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6507C6B0074; Wed, 9 Feb 2022 04:42:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 600016B0075; Wed, 9 Feb 2022 04:42:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5169D6B007B; Wed, 9 Feb 2022 04:42:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 437866B0074 for ; Wed, 9 Feb 2022 04:42:19 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 020BD96F26 for ; Wed, 9 Feb 2022 09:42:19 +0000 (UTC) X-FDA: 79122750798.20.F3471DA Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf21.hostedemail.com (Postfix) with ESMTP id 7F5831C000E for ; Wed, 9 Feb 2022 09:42:18 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6016EB81FDE; Wed, 9 Feb 2022 09:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4EA0C340E7; Wed, 9 Feb 2022 09:42:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644399736; bh=T+mYubC4DgSvWYTBn4SckuteBDQWitfpW4vxCFz9Xd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t17a+03WpPX5fsyUkiVTqQQb7z0JMhqNvZlsnI+WEPj7FkoPewMVPVXjflLcg9EE9 GsHvy14RTTWBaoF2mawz3tHmklfaoojB+PysLINwOETeXVm84mCSMlG1FAA3H1snEd nugn54oDNGmkwczq7cQREbfICXYt2kEMFIPGXxp7oCH1Guz/yDneb7XqNTO6Uafq7e rNE8DkCmHqu+OtgKl/G87Riq5oSpyI+VbyTr90CKlW6dcJ5nASv8Z9sBw9M6xPPmIu PCEcpl30FDfNoqir6Up3C785j80M0mbJwjo+50juCR7xJouMdlDWZlZnHOCcJAgyjq hq4lCIIWCdeIw== From: SeongJae Park To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park , hughd@google.com Subject: [PATCH for-mm 1/2] mm/internal: Implement no-op mlock_page_drain() for !CONFIG_MMU Date: Wed, 9 Feb 2022 09:41:57 +0000 Message-Id: <20220209094158.21941-2-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220209094158.21941-1-sj@kernel.org> References: <20220209094158.21941-1-sj@kernel.org> X-Rspamd-Queue-Id: 7F5831C000E Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=t17a+03W; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: 7p1cr7996ikgcy7irnji9gyqm7peu9nt X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1644399738-995687 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Signed-off-by: SeongJae Park --- mm/internal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/internal.h b/mm/internal.h index 0d240e876831..248224369b34 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -508,6 +508,7 @@ 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 void mlock_page_drain(int cpu) { } static inline void vunmap_range_noflush(unsigned long start, unsigned long end) { }