From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59353C43460 for ; Wed, 5 May 2021 16:06:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F0FAC613B3 for ; Wed, 5 May 2021 16:06:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0FAC613B3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 589796B0073; Wed, 5 May 2021 12:06:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 538D36B0074; Wed, 5 May 2021 12:06:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 400D96B0075; Wed, 5 May 2021 12:06:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 269166B0073 for ; Wed, 5 May 2021 12:06:44 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E583B5825 for ; Wed, 5 May 2021 16:06:43 +0000 (UTC) X-FDA: 78107655486.38.61A34B5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 601A713A for ; Wed, 5 May 2021 16:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=V5YX9ZMAcZXWVYDziUuUHkUQUGYF/zIoLuAsJD8P4xQ=; b=hPK2Kio968bjYkacnz3ZBDz/w1 fjyvBe3xngJdARj48yvpC33cAfE1/E3pwEstBPwjcba0ig0Ra0MDvo8c8Bz4LH3mN7AstGk4Xy8H6 fp+AhM/XSv/Ago9xxNYGEzNqRNWZAbM8LYGKpuEw4kmPMmM4AlciBuzGyHzegLNdNZnBHM2ZEkWyB RsryE/qQbqyvxWywSBXkM+OCzlPeltBtKLeAeDFM07cS8nDei/Ny0J/j8YFb/ix+aaMNT1J5V0I+g GKLXQ/jseOok0CTX9wsQJxJBMuevCVkHs0NdahzT3uKYdugrwY0Vp2hnp1neL6tS0HjEf+wIRCLRL WFYQXmrw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1leK0t-000Yur-7F; Wed, 05 May 2021 16:04:49 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org Subject: [PATCH v9 47/96] mm: Add arch_make_folio_accessible Date: Wed, 5 May 2021 16:05:39 +0100 Message-Id: <20210505150628.111735-48-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210505150628.111735-1-willy@infradead.org> References: <20210505150628.111735-1-willy@infradead.org> MIME-Version: 1.0 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=hPK2Kio9; dmarc=none; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam03 X-Stat-Signature: nzjw8dt46ez7hwyozso54i6wfbkx45ko X-Rspamd-Queue-Id: 601A713A Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620230798-889616 Content-Transfer-Encoding: quoted-printable 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: As a default implementation, call arch_make_page_accessible n times. If an architecture can do better, it can override this. Also move the default implementation of arch_make_page_accessible() from gfp.h to mm.h. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/gfp.h | 6 ------ include/linux/mm.h | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 11da8af06704..a503d928e684 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -508,12 +508,6 @@ static inline void arch_free_page(struct page *page,= int order) { } #ifndef HAVE_ARCH_ALLOC_PAGE static inline void arch_alloc_page(struct page *page, int order) { } #endif -#ifndef HAVE_ARCH_MAKE_PAGE_ACCESSIBLE -static inline int arch_make_page_accessible(struct page *page) -{ - return 0; -} -#endif =20 struct page *__alloc_pages(gfp_t gfp, unsigned int order, int preferred_= nid, nodemask_t *nodemask); diff --git a/include/linux/mm.h b/include/linux/mm.h index 6bfc43309e4b..75279db82040 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1725,6 +1725,27 @@ static inline size_t folio_size(struct folio *foli= o) return PAGE_SIZE << folio_order(folio); } =20 +#ifndef HAVE_ARCH_MAKE_PAGE_ACCESSIBLE +static inline int arch_make_page_accessible(struct page *page) +{ + return 0; +} +#endif + +#ifndef HAVE_ARCH_MAKE_FOLIO_ACCESSIBLE +static inline int arch_make_folio_accessible(struct folio *folio) +{ + int ret, i; + for (i =3D 0; i < folio_nr_pages(folio); i++) { + ret =3D arch_make_page_accessible(folio_page(folio, i)); + if (ret) + break; + } + + return ret; +} +#endif + /* * Some inline functions in vmstat.h depend on page_zone() */ --=20 2.30.2