Message ID | 20220808193430.3378317-8-willy@infradead.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 199D1C00140 for <linux-mm@archiver.kernel.org>; Mon, 8 Aug 2022 19:34:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B8058E0002; Mon, 8 Aug 2022 15:34:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 71C4E8E0007; Mon, 8 Aug 2022 15:34:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5451F8E0002; Mon, 8 Aug 2022 15:34:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3496C8E0006 for <linux-mm@kvack.org>; Mon, 8 Aug 2022 15:34:51 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 022ECAB373 for <linux-mm@kvack.org>; Mon, 8 Aug 2022 19:34:50 +0000 (UTC) X-FDA: 79777427982.14.EC5ACC3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP id A7BFC180162 for <linux-mm@kvack.org>; Mon, 8 Aug 2022 19:34:50 +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=25EELXvgziRYyg6Tw20CeFvEjR4VSR3Jcb5bQsXu2dE=; b=DkNcC5txygi3U5yQZ29aksV1wp pevV1udR7jsw2kKSZl++UUSLmpAGMNH4f72eWrltfKoBBhnJZNeUjiLxMGDHHuUQIbR2L1iJG/3u0 +LxS3QQdZBLJuMucpZVYx53OOR8HdhWK4oVgfhlw0fIJ0/eCdswsAZOQ3EqxfXnFyVw25g8g8UsWD B8BqDLTsICgFK35M42if16akN7uf5OYMP1CevvKS04VRAdK+TwNW+ogPyDlD9/HuPBADBZphWa34A YecP32YY53xlRctBGFTSWry9Wr2T1BXedKdHy/ti8cYRDbswPPEVP6uZ4fgAY34XVmLxzPcQyzSLE ciSplqRA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oL8WU-00EAsc-JF; Mon, 08 Aug 2022 19:34:46 +0000 From: "Matthew Wilcox (Oracle)" <willy@infradead.org> To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>, hughd@google.com Subject: [PATCH 07/59] mm: Add split_folio() Date: Mon, 8 Aug 2022 20:33:35 +0100 Message-Id: <20220808193430.3378317-8-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808193430.3378317-1-willy@infradead.org> References: <20220808193430.3378317-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659987290; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=25EELXvgziRYyg6Tw20CeFvEjR4VSR3Jcb5bQsXu2dE=; b=np0oCRkR+W+RBHyhGtTNGmnEEF2fgRS9v7LVzhH7gPHu6gP5QzhzA3Ul7A3DjOo9RKTMcx sEGUoUqucnquJC8wmVWG6NegmEZ7RODtGNwCxXet+Dd0kBetQA3YBp6Db7rlb+oGE9IZyn NgIQK8nj7l508KGkNicm09xB18jYehM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DkNcC5tx; dmarc=none; spf=none (imf16.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659987290; a=rsa-sha256; cv=none; b=l1b1q/OiEJsiu7XiXh22STRORR502kRRVkLln6gfWGnZbNRvcMtI6N3jVJZ1wMLcu/hdHc rM3V2oApy1LluVVynjCtCTNqXe7cq1tWp/twmH3BjDL1UMuCZ0b6uhhb9zjT9HN+jSSrmN +wbC7z6IAMKtBaTvatqONahgBMqNOvk= X-Rspamd-Queue-Id: A7BFC180162 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DkNcC5tx; dmarc=none; spf=none (imf16.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: u3ru9aacryakwt35dez4dx6fm58i3mj7 X-HE-Tag: 1659987290-918756 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: <linux-mm.kvack.org> |
Series |
MM folio changes for 6.1
|
expand
|
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 768e5261fdae..aa0a427284aa 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -435,6 +435,11 @@ static inline int split_folio_to_list(struct folio *folio, return split_huge_page_to_list(&folio->page, list); } +static inline int split_folio(struct folio *folio) +{ + return split_folio_to_list(folio, NULL); +} + /* * archs that select ARCH_WANTS_THP_SWAP but don't support THP_SWP due to * limitations in the implementation like arm64 MTE can override this to diff --git a/mm/shmem.c b/mm/shmem.c index 4ae43cffeda3..de267a23248d 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -629,7 +629,7 @@ static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo, goto move_back; } - ret = split_huge_page(&folio->page); + ret = split_folio(folio); folio_unlock(folio); folio_put(folio); diff --git a/mm/truncate.c b/mm/truncate.c index 0b0708bf935f..c0be77e5c008 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -240,7 +240,7 @@ bool truncate_inode_partial_folio(struct folio *folio, loff_t start, loff_t end) folio_invalidate(folio, offset, length); if (!folio_test_large(folio)) return true; - if (split_huge_page(&folio->page) == 0) + if (split_folio(folio) == 0) return true; if (folio_test_dirty(folio)) return false;
This wrapper removes a need to use split_huge_page(&folio->page). Convert two callers. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- include/linux/huge_mm.h | 5 +++++ mm/shmem.c | 2 +- mm/truncate.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-)