Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2628371pxv; Sun, 11 Jul 2021 20:40:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlQQoYsaTQGy75Hm2zteqEMgRosLO0tRY00Ritf9oOSPX9rLfCR4DXhPOZgsOKI36usTOx X-Received: by 2002:a17:907:3d88:: with SMTP id he8mr50494553ejc.296.1626061240575; Sun, 11 Jul 2021 20:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626061240; cv=none; d=google.com; s=arc-20160816; b=XKQfx7hTRFW2btOH4who4lgaixLSkUYxRrLjgb6o/mlm0xUM5gvaXg8gGucjbIRjID WofZlxpdevMg2yH/IjTn+8oWy6H5WDTLt4iRonaTjsyqzUAIJmajZj7cba2qIGkQ+sTs tSTYzzBYKAOnitFrNlwVeU46raiek8ZSEJkBtgmDHs+GKpT/MXc9h/B1SImjjHbE7FBg 9BVexxUb4zAEQSSTA0urXb1Mpvd94g4RxaFj8RrXdMnfkWW7iObzh9bBUsQckfC5sQpF /hWRW8SiroNGwdqN7gosm2qVSpLWKUMe0I86mPf8uoamhfW0zdFO1UFvaErd8boc1LDJ jNog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=m/Bg7LKZhCW6/qjbVSylrDx69jh8HyrsyM7lKpeyuoc=; b=DbW1yvd2VEM4a1gDMzis0+Peqx0WzSnBvyNnzycY9F1E2lNTDTVQFeLsziCORYJsVt L2AHcEA2EBFRrDtQrxEPggShvkUihoY0AYWT137yy8y38dF4B0/kTNijhQ30KQnxqHqz k3WWyePyWiclBLhdJtGu8aJp8sga5Z6U6sF3JrC09edDCWGC/mWlS/UGPupkJz276F07 9RP2e0v2aoEaYGD07SUHyvW/gxDwXTQtMBtXAo7/l5jk3yVLYgVKs2BxcyhOpDcfpmsA hwkdgGJM1pO7NLORpxL4fLgHKw/QePm0t1cROKvD+tg1GuPB7n0fvelP73X9verDIc4I W+MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Q3/W6DYB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r14si13158736edw.524.2021.07.11.20.40.17; Sun, 11 Jul 2021 20:40:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Q3/W6DYB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233245AbhGLDkP (ORCPT + 99 others); Sun, 11 Jul 2021 23:40:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233045AbhGLDkO (ORCPT ); Sun, 11 Jul 2021 23:40:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57EC1C0613DD; Sun, 11 Jul 2021 20:37:27 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 *folio) return PAGE_SIZE << folio_order(folio); } +#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 = 0; i < folio_nr_pages(folio); i++) { + ret = arch_make_page_accessible(folio_page(folio, i)); + if (ret) + break; + } + + return ret; +} +#endif + /* * Some inline functions in vmstat.h depend on page_zone() */ -- 2.30.2