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 812A2ECAAD5 for ; Fri, 2 Sep 2022 19:48:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 626058011B; Fri, 2 Sep 2022 15:47:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 587EA80119; Fri, 2 Sep 2022 15:47:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DBC28011B; Fri, 2 Sep 2022 15:47:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2BF8F80119 for ; Fri, 2 Sep 2022 15:47:12 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0FADE1209C3 for ; Fri, 2 Sep 2022 19:47:12 +0000 (UTC) X-FDA: 79868179104.04.A267E50 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id 8B03140096 for ; Fri, 2 Sep 2022 19:47:11 +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=mADqW9cScCqLSjZJPxMJC5WEKhPmFXzGFtDTW1Nq/Fw=; b=wHAHz9Hl5lRg1vkc9uiBdzYl3p 2dx0IINv+/WWSWnzzfYfyUysre0ahZ6bwzjqiXHIcIkgNNMZFse/Leo1zUxdgZqk4ApNyZzEIgHg4 hUcy0lToeQhiWT6SfTCy9pU/IH3roptv3ooKve3rkz3aqZAz52fX4uiIHNw4L8dHKKCEZJvgh+YET iCvNSTNt/y8xt7hQFgjLMLHHvQeE8d7tMFK5VW7vS5wZZxhZQNRItovHGn+nLeNGLUoWnnQVKP6HE 7RMH0UDdNLOaDH+273sVPmb51mHlLZ0czrLZFTuXUPRKTPe5fXtwOP0jJLR1VTNR04aeZHeU2v+Iu xaXvPDjA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUCd5-007IhG-Nl; Fri, 02 Sep 2022 19:47:03 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH v2 48/57] mm: Remove try_to_free_swap() Date: Fri, 2 Sep 2022 20:46:44 +0100 Message-Id: <20220902194653.1739778-49-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220902194653.1739778-1-willy@infradead.org> References: <20220902194653.1739778-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=1662148031; 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=mADqW9cScCqLSjZJPxMJC5WEKhPmFXzGFtDTW1Nq/Fw=; b=qb2xmHK+NDKABYvwLbGCVKPrQei7yEOZ4CgK6zEXglb9FYXLH7+W+yvddmkTb6h/MaK9ZE GZMQduFowZsiJgMVmLwNb7rUjfx19N+k20lqhkLK5GWt/XaUuHHdeQC7FVsyCOXrWlIYRJ IHtsN2JbNRRprw/tmc257UQzpRz1SnM= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=wHAHz9Hl; spf=none (imf27.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662148031; a=rsa-sha256; cv=none; b=mBTgrhaJZeWa8IwLdEt8oNSilAH3cKGSzJkENWN9aR/ampsRCOQYvpWZe4fY/7FT9j0yLI T/0Qs6hCjcZkz9IEM1LH8MYBWegMWXY4dXhGV5UgpUfJb0Gs82pJ3YNXICCb3j8ivQyzLc ixFzF73stl47UoTXPkwkJ6CUGHM1JdM= X-Stat-Signature: p993ja9s3ywf49qj9r6n8d1i6c8tnf7i X-Rspamd-Queue-Id: 8B03140096 X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=wHAHz9Hl; spf=none (imf27.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: rspam01 X-HE-Tag: 1662148031-409902 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 3c7b2f1dbf6e..0b5630dba38e 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