From patchwork Fri Dec 24 06:22:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12698823 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 1E63EC433FE for ; Fri, 24 Dec 2021 06:23:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3A306B007B; Fri, 24 Dec 2021 01:23:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DE8C86B007D; Fri, 24 Dec 2021 01:23:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BEEFB6B007E; Fri, 24 Dec 2021 01:23:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id B0AC56B007B for ; Fri, 24 Dec 2021 01:23:09 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 745D6181AC9C6 for ; Fri, 24 Dec 2021 06:23:09 +0000 (UTC) X-FDA: 78951695298.19.981B0A7 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf13.hostedemail.com (Postfix) with ESMTP id 4A8032000E for ; Fri, 24 Dec 2021 06:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=gHqv6kMDsq/2+y1n4ZZkTVYmU0VIRJiHvL8ybQks4bw=; b=eX99TK5vA8W9CJKecAaI2PFNuU GuyMw9RXR48sk3sYubW92CcupEDBWC1oj8RM+7vAyLz6NJXtvx20kbgNllyxKaBsgQ44+YDCitYBe BHIjWysMsh+dnDsLDhwFMjOfbpoO10huxP+bnNH60zrj9mJ/8s5bYtd6ETmP75wbrcEBb67EPmPsC 0yxtgyWqhayzUdZ3VW8w6giyQKeny1FzsFaMK4JbOx/1H4SFCLY4uZK66IyYAAhpJj9Auwz7xJdca yWEo95XfCGSCasonwBQQT9EQlWSqSPp0NSGM3D0L5ubP0QPXDxZbl3gJJGJB900IVYhhDr8F0QB/x ecqKL6tQ==; Received: from p4fdb0b85.dip0.t-ipconnect.de ([79.219.11.133] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0dyk-00Dn0B-AW; Fri, 24 Dec 2021 06:22:58 +0000 From: Christoph Hellwig To: Andrew Morton , Konrad Rzeszutek Wilk Cc: Hugh Dickins , Seth Jennings , Dan Streetman , Vitaly Wool , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 03/13] frontswap: remove frontswap_tmem_exclusive_gets Date: Fri, 24 Dec 2021 07:22:36 +0100 Message-Id: <20211224062246.1258487-4-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211224062246.1258487-1-hch@lst.de> References: <20211224062246.1258487-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Stat-Signature: bdp3bt8u54a7to65aay7m4x1qt5exux4 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4A8032000E Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=eX99TK5v; spf=none (imf13.hostedemail.com: domain of BATV+afcec93cc8ffef6ccdbc+6697+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+afcec93cc8ffef6ccdbc+6697+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-HE-Tag: 1640326979-220998 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: frontswap_tmem_exclusive_gets is never called, so remove it. Signed-off-by: Christoph Hellwig --- include/linux/frontswap.h | 2 -- mm/frontswap.c | 23 +---------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h index 4a03fda415725..83a56392cc7f6 100644 --- a/include/linux/frontswap.h +++ b/include/linux/frontswap.h @@ -26,8 +26,6 @@ struct frontswap_ops { extern void frontswap_register_ops(struct frontswap_ops *ops); extern void frontswap_shrink(unsigned long); extern unsigned long frontswap_curr_pages(void); -#define FRONTSWAP_HAS_EXCLUSIVE_GETS -extern void frontswap_tmem_exclusive_gets(bool); extern bool __frontswap_test(struct swap_info_struct *, pgoff_t); extern void __frontswap_init(unsigned type, unsigned long *map); diff --git a/mm/frontswap.c b/mm/frontswap.c index 51a662a839559..dba7f087ee862 100644 --- a/mm/frontswap.c +++ b/mm/frontswap.c @@ -32,13 +32,6 @@ static struct frontswap_ops *frontswap_ops __read_mostly; #define for_each_frontswap_ops(ops) \ for ((ops) = frontswap_ops; (ops); (ops) = (ops)->next) -/* - * If enabled, the underlying tmem implementation is capable of doing - * exclusive gets, so frontswap_load, on a successful tmem_get must - * mark the page as no longer in frontswap AND mark it dirty. - */ -static bool frontswap_tmem_exclusive_gets_enabled __read_mostly; - #ifdef CONFIG_DEBUG_FS /* * Counters available via /sys/kernel/debug/frontswap (if debugfs is @@ -160,15 +153,6 @@ void frontswap_register_ops(struct frontswap_ops *ops) } EXPORT_SYMBOL(frontswap_register_ops); -/* - * Enable/disable frontswap exclusive gets (see above). - */ -void frontswap_tmem_exclusive_gets(bool enable) -{ - frontswap_tmem_exclusive_gets_enabled = enable; -} -EXPORT_SYMBOL(frontswap_tmem_exclusive_gets); - /* * Called when a swap device is swapon'd. */ @@ -296,13 +280,8 @@ int __frontswap_load(struct page *page) if (!ret) /* successful load */ break; } - if (ret == 0) { + if (ret == 0) inc_frontswap_loads(); - if (frontswap_tmem_exclusive_gets_enabled) { - SetPageDirty(page); - __frontswap_clear(sis, offset); - } - } return ret; } EXPORT_SYMBOL(__frontswap_load);