From patchwork Thu Feb 10 04:44:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 12741264 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 C8F29C433EF for ; Thu, 10 Feb 2022 04:44:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 437D16B0073; Wed, 9 Feb 2022 23:44:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E7336B0074; Wed, 9 Feb 2022 23:44:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AEED6B0075; Wed, 9 Feb 2022 23:44:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id 1C9A76B0073 for ; Wed, 9 Feb 2022 23:44:07 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CBF658249980 for ; Thu, 10 Feb 2022 04:44:06 +0000 (UTC) X-FDA: 79125628092.11.537AFD3 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by imf18.hostedemail.com (Postfix) with ESMTP id 65A561C0004 for ; Thu, 10 Feb 2022 04:44:06 +0000 (UTC) Received: by mail-qv1-f49.google.com with SMTP id d7so3820627qvk.2 for ; Wed, 09 Feb 2022 20:44:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=tykP6A+1QiN/WUxXun1yzu3aSQmRUSLJhXM2phvBN3Q=; b=Yhfics8+0BCXVT5QhAMpDcd67wSh80Ctx+hE7SLJh8Yk1NQ8d/ngD2uN1xSu3jdbKq GLp7I4iqXbDwkguGDSYwV0dXlUzfvewJ413sHF3cSHVyxxu+OxDnOS9WG+tfQxMjIOH/ eBX9lpn1ZuP45ozLu0YUovHTZUGKKP4LJT1X1g63uJmIynGIeu+RpfDteCcQo0x0x8WU 5Roit5DX2FlbImEeOEejzF/oP6/oceWtPOOMguSavzSc5wQROKWPCSDs8N+rdt467kaG EskAZLlrFpfG8olc3XZII9MCYk+Nv73jI094G5w95kB9bLCiPs7LLr2eFaDVl7kEraJf iOLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=tykP6A+1QiN/WUxXun1yzu3aSQmRUSLJhXM2phvBN3Q=; b=6UC3Ha1V+f8SwnmesS8qGXx6Y6YfH9pSrY7w6EmxpzYmQOF3yLL2AbAUEQUz2lwzta cUW0XaGNwC4W20jCPXPhTvg2FaDSFEgxsYlM5vxQGN+EStsjNCaYKLXkEymQ9gBo38FD do0zq1iNZnFU9vJaNEeyLdym0/wKm378ESOaGs+qUlZ1hxOcU5nnXT6djfi6sL76zHFu Z7nE9hJzohFf8nzPoH5FhP7ySW566+JcwBUO/VMFa8YEJMLsU8dN037A7mG4paxfxbPl HBenWqBjc36eRKzpkWUbyLudKu7lJJ5IgToTc7r1lxReVoKwgFoLMjNZFuRXUCwazuZg CL3Q== X-Gm-Message-State: AOAM53210CWCJRmysvxzW7XMf+k3ciIKXXx1Z5GPGT4VVWbNa+ar9iCy JszyMuaJkEKADFV7HL/17rw3dQ== X-Google-Smtp-Source: ABdhPJxZrrfE2d+GE8taLM2418X4thCCHbiRj+8fI5S001YY8xhXyTOSRsschiao9BsHJSfbQIYs9Q== X-Received: by 2002:a05:6214:1bc7:: with SMTP id m7mr2415342qvc.37.1644468245514; Wed, 09 Feb 2022 20:44:05 -0800 (PST) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id g11sm10299690qtg.49.2022.02.09.20.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 20:44:04 -0800 (PST) Date: Wed, 9 Feb 2022 20:44:02 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton , Stephen Rothwell cc: Hugh Dickins , SeongJae Park , Andrew Morton , Geert Uytterhoeven , Naresh Kamboju , Linux MM , Linux Kernel Mailing List Subject: [PATCH for-mm 1/2 v2] mm/internal: Implement no-op mlock_page_drain() for !CONFIG_MMU In-Reply-To: Message-ID: <8eae6026-098-befb-92d3-b9ad2ad57776@google.com> References: <20220209094158.21941-1-sj@kernel.org> <20220209094158.21941-2-sj@kernel.org> <715a8b2e-1048-c098-8b89-bcf3c13cbd75@google.com> MIME-Version: 1.0 X-Stat-Signature: rfjd9aj5yhy4cdrzojxxhojhmtqzi5xj X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Yhfics8+; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of hughd@google.com designates 209.85.219.49 as permitted sender) smtp.mailfrom=hughd@google.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 65A561C0004 X-HE-Tag: 1644468246-157275 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: From: SeongJae Park 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 Signed-off-by: Hugh Dickins --- 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) { }