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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFABCC00140 for ; Mon, 8 Aug 2022 19:35:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4AB696B0074; Mon, 8 Aug 2022 15:35:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40F5E6B0075; Mon, 8 Aug 2022 15:35:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F08F9940023; Mon, 8 Aug 2022 15:35:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C6BB9940023 for ; Mon, 8 Aug 2022 15:35:51 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9FBC78015D for ; Mon, 8 Aug 2022 19:35:51 +0000 (UTC) X-FDA: 79777430502.12.82476E5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 36C1BA0164 for ; Mon, 8 Aug 2022 19:35:51 +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=OsFrXHvB8cYITjSSiLVE8LTYqmXFfAMGQNN9DW2H+TI=; b=Vy/LP8K3DIV3TPPNdUJ+0BCZwD yVP+NVZToRNK464d01Ig6gV3ZCN9FewXFXseN0uaVXUBQWYa8yTJTUyeZ4RC4gfzXbrL5tpgX6/S1 2E2z+Cxhh0wNGxBEp4Gbjfg5WCa8XP9KqKZw+mFXBdwLfgivkJs1l4u7QY3awsSP+wMhzFsIF6XtY 7Bl5XNiMiNNmvMR9+8+OxQu3laJXgpiW+b0MZ9wmmzvZqyvSeNNQZo9TIS6mQV/f3KQMKIUGauBkm CHK0h5y2AkXfBREkAdxwUUcaaAM21emvpTP0fwRvblBjZDi4P8dW/S+7uqtzqiNc1ekQkZ4gEutSt FV/QwOKA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oL8XQ-00EB1w-Ed; Mon, 08 Aug 2022 19:35:46 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , hughd@google.com Subject: [PATCH 51/59] mm: Remove try_to_free_swap() Date: Mon, 8 Aug 2022 20:34:19 +0100 Message-Id: <20220808193430.3378317-52-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=1659987351; a=rsa-sha256; cv=none; b=hgZYe5PT6Gg6L0dE5CGjIjTbRSrg0q/z8pnvv0m7+QHhkikzTpb5HpWy6konMwssjN/j1k GfmUsS5ItKwR+RN/GmdpkruvlZCpGge8tpvglB58Q3o87kMRC4biAdWOncxGtnYtHxFUeE Sqs553uavftfmfwd2kH140BbVruvdsA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="Vy/LP8K3"; dmarc=none; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659987351; 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=OsFrXHvB8cYITjSSiLVE8LTYqmXFfAMGQNN9DW2H+TI=; b=xlwuCVXyhLUt4f9kXsAP90FkGoHCd0aWStu/1mIoQSLSqInEpiEHTAaAi/rwZRcRaxVXOb gHTFSa8swesi8UVmeeZCt4YEwT0hkSLJYWK2KL3No8HLV42BBEb0iNyXTZN4G155QYv1Gn AvuywCvmfT+wjAgMUDJLm46TorYPvE8= X-Rspamd-Server: rspam10 X-Stat-Signature: 63rbbozw37jnpaja75nid5q6aaqh8i7q Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="Vy/LP8K3"; dmarc=none; spf=none (imf25.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-Queue-Id: 36C1BA0164 X-HE-Tag: 1659987351-997479 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: All callers have now been converted to folio_free_swap() and we can remove this wrapper. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/swap.h | 6 ------ mm/folio-compat.c | 7 ------- mm/memory.c | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 8178ec471fe3..3be59affca63 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -506,7 +506,6 @@ extern int __swp_swapcount(swp_entry_t entry); extern int swp_swapcount(swp_entry_t entry); extern struct swap_info_struct *page_swap_info(struct page *); extern struct swap_info_struct *swp_swap_info(swp_entry_t entry); -extern int try_to_free_swap(struct page *); struct backing_dev_info; extern int init_swap_address_space(unsigned int type, unsigned long nr_pages); extern void exit_swap_address_space(unsigned int type); @@ -591,11 +590,6 @@ static inline int swp_swapcount(swp_entry_t entry) return 0; } -static inline int try_to_free_swap(struct page *page) -{ - return 0; -} - static inline swp_entry_t folio_alloc_swap(struct folio *folio) { swp_entry_t entry; diff --git a/mm/folio-compat.c b/mm/folio-compat.c index 06d47f00609b..e1e23b4947d7 100644 --- a/mm/folio-compat.c +++ b/mm/folio-compat.c @@ -146,10 +146,3 @@ void putback_lru_page(struct page *page) { folio_putback_lru(page_folio(page)); } - -#ifdef CONFIG_SWAP -int try_to_free_swap(struct page *page) -{ - return folio_free_swap(page_folio(page)); -} -#endif diff --git a/mm/memory.c b/mm/memory.c index b6f2ccda4f45..76b0e67399a1 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3838,7 +3838,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) if (swapcache) { /* - * Make sure try_to_free_swap or swapoff did not release the + * Make sure folio_free_swap() or swapoff did not release the * swapcache from under us. The page pin, and pte_same test * below, are not enough to exclude that. Even if it is still * swapcache, we need to check that the page's swap has not -- 2.35.1