From patchwork Sat Jan 22 06:14:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12720539 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 C5AFEC433FE for ; Sat, 22 Jan 2022 06:14:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6129E6B00B0; Sat, 22 Jan 2022 01:14:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C2A16B00EA; Sat, 22 Jan 2022 01:14:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D9756B00EB; Sat, 22 Jan 2022 01:14:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 3E6046B00B0 for ; Sat, 22 Jan 2022 01:14:45 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 087AA18126931 for ; Sat, 22 Jan 2022 06:14:45 +0000 (UTC) X-FDA: 79056909330.09.B584279 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf14.hostedemail.com (Postfix) with ESMTP id 7C07210001A for ; Sat, 22 Jan 2022 06:14:44 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7B878B820FE; Sat, 22 Jan 2022 06:14:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA2FCC004E1; Sat, 22 Jan 2022 06:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1642832082; bh=wV+2n0iYc7yFLX2ypalYtnppH93hu6tM/wxkaNzRc/E=; h=Date:From:To:Subject:In-Reply-To:From; b=wC+daJrzuoj72YRIKFXTU8lnfACqpNqPI+ETPsr+TvW4TNNgWg8s6lfpZgpBj8uZS Ggiccu2aaMQVznv3cCpwjwqktGS5yz4czkiT01WRiHgBsry7Ai53xtxTaTMpR9JU4y jhfllZDykRotA71w9yyz5NmsVhyLx/E6ZDEW3oGI= Date: Fri, 21 Jan 2022 22:14:41 -0800 From: Andrew Morton To: akpm@linux-foundation.org, ddstreet@ieee.org, geert@linux-m68k.org, hch@lst.de, hughd@google.com, jgross@suse.com, Konrad.wilk@oracle.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, sjenning@redhat.com, torvalds@linux-foundation.org, vitaly.wool@konsulko.com, willy@infradead.org Subject: [patch 59/69] frontswap: remove frontswap_tmem_exclusive_gets Message-ID: <20220122061441.za9VTEB0f%akpm@linux-foundation.org> In-Reply-To: <20220121221021.60533b009c357d660791476e@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=wC+daJrz; dmarc=none; spf=pass (imf14.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: n7kn7ermm68bgs6u8dn49781utfp83nx X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 7C07210001A X-HE-Tag: 1642832084-771990 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: From: Christoph Hellwig Subject: frontswap: remove frontswap_tmem_exclusive_gets frontswap_tmem_exclusive_gets is never called, so remove it. Link: https://lkml.kernel.org/r/20211224062246.1258487-4-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton --- include/linux/frontswap.h | 2 -- mm/frontswap.c | 23 +---------------------- 2 files changed, 1 insertion(+), 24 deletions(-) --- a/include/linux/frontswap.h~frontswap-remove-frontswap_tmem_exclusive_gets +++ a/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); --- a/mm/frontswap.c~frontswap-remove-frontswap_tmem_exclusive_gets +++ a/mm/frontswap.c @@ -32,13 +32,6 @@ static struct frontswap_ops *frontswap_o #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 @@ -161,15 +154,6 @@ void frontswap_register_ops(struct front 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. */ void __frontswap_init(unsigned type, unsigned long *map) @@ -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);