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 9F652C07E99 for ; Mon, 12 Jul 2021 03:37:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 53E7161004 for ; Mon, 12 Jul 2021 03:37:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53E7161004 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 711DB6B0095; Sun, 11 Jul 2021 23:37:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C2116B0098; Sun, 11 Jul 2021 23:37:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 563126B0099; Sun, 11 Jul 2021 23:37:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 360956B0095 for ; Sun, 11 Jul 2021 23:37:28 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 527421846F747 for ; Mon, 12 Jul 2021 03:37:27 +0000 (UTC) X-FDA: 78352525734.01.CF4C6A7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 08E1850000A0 for ; Mon, 12 Jul 2021 03:37:26 +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=m/Bg7LKZhCW6/qjbVSylrDx69jh8HyrsyM7lKpeyuoc=; b=Q3/W6DYBK+UQ8FmnedQL9fC7Yk Jz8juBG+EV5kBSkzw9APtbnt2n5Lez0abGrD0I7Lwkwq3ht8pfC+Y3b/XMeTNQNDgQbSXJd8kwucG GTRTthExhcgmlBOQaBuF/0lD28btPAr00pEbtVg4XROONLSGzMb1rjoMKum/82yLCrSCsTT3ytjih S663IKayXhIimJTVR0X6CyBrGLt+gkWMrrWna0UBabNyhy5NL85qNzDKi2vKAeg9Om6/LQRx7B7pQ E+oaMwal+VT7BliCYPMfGGrSkfcO/gbxKxgaOm8sDUkvR8cOPxUgGzRdXTwRDx+dX8dgPsA+Lf2eZ zpScvTTQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2mkE-00GoqJ-1U; Mon, 12 Jul 2021 03:36:40 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v13 055/137] mm: Add arch_make_folio_accessible() Date: Mon, 12 Jul 2021 04:05:39 +0100 Message-Id: <20210712030701.4000097-56-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210712030701.4000097-1-willy@infradead.org> References: <20210712030701.4000097-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="Q3/W6DYB"; 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; dmarc=none X-Rspamd-Server: rspam05 X-Stat-Signature: cp7z973jqshyqk64eegnxa436m4sgxph X-Rspamd-Queue-Id: 08E1850000A0 X-HE-Tag: 1626061046-776477 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 55b2ec1f965a..dc5ff40608ce 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -520,12 +520,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 fa5974870660..12e78faa3519 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1731,6 +1731,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