Message ID | 20220808193430.3378317-38-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 48631C00140 for <linux-mm@archiver.kernel.org>; Mon, 8 Aug 2022 19:36:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DD2E6940019; Mon, 8 Aug 2022 15:36:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5E5D94000C; Mon, 8 Aug 2022 15:36:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B85F4940019; Mon, 8 Aug 2022 15:36:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A423D94000C for <linux-mm@kvack.org>; Mon, 8 Aug 2022 15:36:02 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 84217A0856 for <linux-mm@kvack.org>; Mon, 8 Aug 2022 19:36:02 +0000 (UTC) X-FDA: 79777430964.31.C879AE7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id 2A39A100054 for <linux-mm@kvack.org>; Mon, 8 Aug 2022 19:36:02 +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=pI4aU5Niep/H4leC+h0AKItoqsaUlWZ93voTFp62Ql4=; b=SO/NCllTl+45tpF8hjtXwSaW/I 4sIOllg3eWSKa7fvEqfCz4a60f6v7FzdL15pda6mDYwmgMYehdqxxbhhb6sdFhF+mmuMtZDl95Gxz hHjy24Ri7dymukknWgsK/nCkoTxXJ1oqvh/B9G7uY+6UrBfdPB7LjAx2GpcX7ahJfAVb9baX5VpLG srE4qoN1P2FpQMHuhQoyfgIqsqYyqyfQ79vlvuCOy06YTmVql1kyHErttDuKhK4i2OEU/5Wjl+jo5 LVoLbjUJlgwjSVjXe0DC5HL262lf78bKM9HmmZOCTb9cZxNj/v6KGvk9ZB/0kYUdSMohnIi+f5l6N DwFJMaSw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oL8XC-00EAz0-Ln; Mon, 08 Aug 2022 19:35:30 +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 37/59] swapfile: Convert try_to_unuse() to use a folio Date: Mon, 8 Aug 2022 20:34:05 +0100 Message-Id: <20220808193430.3378317-38-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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659987362; a=rsa-sha256; cv=none; b=cQP0s4+uWoKRBKJzzNRg3HqelvORW3WgbWRqJwkyXTpTcWsrxYE15ERCbS7sS5vrwkhlh7 mK1anPTXuGoaQUYl064byQZcDPBY58dkFLA40V8l/92EMNSr4bB67EPkpfCQXcGbDaLZiw Id5waBG+4E6VaoDCI5+Fi71TBm1ofKc= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="SO/NCllT"; spf=none (imf14.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659987362; 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=pI4aU5Niep/H4leC+h0AKItoqsaUlWZ93voTFp62Ql4=; b=7jD5TDXxHEKPJ34LCA6ZoXWbdvTPgCHJkpPIS6C7+1PpjKNfRI3g8JN42KFdTJlbyKpWwj R1kviLb1jnFrLsHv/UiSMJhju/eI85PWMpbUyQyG/IYClmvLRV/uI19BsFTuZg+sZVV0Im zRVDdRXjH5VKa9swdzL1DIN5s1mXGN0= X-Rspamd-Queue-Id: 2A39A100054 X-Rspam-User: X-Rspamd-Server: rspam11 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="SO/NCllT"; spf=none (imf14.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-Stat-Signature: qe6uq33zd9d7x11jo3kkpu8ou3mqcp7h X-HE-Tag: 1659987362-934193 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/mm/swapfile.c b/mm/swapfile.c index 186511a8ef4f..df85eb73f34e 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2026,7 +2026,7 @@ static int try_to_unuse(unsigned int type) struct list_head *p; int retval = 0; struct swap_info_struct *si = swap_info[type]; - struct page *page; + struct folio *folio; swp_entry_t entry; unsigned int i; @@ -2076,21 +2076,21 @@ static int try_to_unuse(unsigned int type) (i = find_next_to_unuse(si, i)) != 0) { entry = swp_entry(type, i); - page = find_get_page(swap_address_space(entry), i); - if (!page) + folio = filemap_get_folio(swap_address_space(entry), i); + if (!folio) continue; /* - * It is conceivable that a racing task removed this page from - * swap cache just before we acquired the page lock. The page + * It is conceivable that a racing task removed this folio from + * swap cache just before we acquired the page lock. The folio * might even be back in swap cache on another swap area. But - * that is okay, try_to_free_swap() only removes stale pages. + * that is okay, folio_free_swap() only removes stale folios. */ - lock_page(page); - wait_on_page_writeback(page); - try_to_free_swap(page); - unlock_page(page); - put_page(page); + folio_lock(folio); + folio_wait_writeback(folio); + folio_free_swap(folio); + folio_unlock(folio); + folio_put(folio); } /*
Saves five calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- mm/swapfile.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)