From patchwork Mon Feb 19 13:33:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13562698 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 5405AC48BF8 for ; Mon, 19 Feb 2024 13:34:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D92708D0005; Mon, 19 Feb 2024 08:34:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D439D6B007E; Mon, 19 Feb 2024 08:34:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD28F8D0005; Mon, 19 Feb 2024 08:34:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 99A2B6B007D for ; Mon, 19 Feb 2024 08:34:31 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 68C46A03C4 for ; Mon, 19 Feb 2024 13:34:31 +0000 (UTC) X-FDA: 81808647942.27.DCFDB43 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) by imf27.hostedemail.com (Postfix) with ESMTP id A08A840026 for ; Mon, 19 Feb 2024 13:34:29 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.180 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708349669; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FB3wHGJgRL5d+Axn88/lWUMH/HggPplS++B6a9lglMM=; b=EJFsZ0ukr6bxvgdhfEQgCusbvXssscTdk35x+QByuYbww27k1WaXxU37c6gUvkqN83P3IR eDu8FzzF32oRhYPTrhi6ePURviZ0ZrEcv8C5tuoXeqJ8DeXFWwWqnFWer14+5m9p+CAGBC Mrzh+acjfPcRlyTlPr9hn5ipozbrIoY= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.180 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=bytedance.com (policy=quarantine) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708349669; a=rsa-sha256; cv=none; b=WtTAsrab5JcUzFjFi4Y2MlVbczB0B/mowt7HsTzfv2ECcmLxuIyyNHT7+D7+42P8PloTqW pdNNvQ3PLd6P1TwKRIxNFFk+cNpHxtDaqedbYoIDiDYsXE+8SJ8Im5Wo8y8izhgfR4MgKZ SILafG3Q0bHkOrlJAC8EENjp008tQSo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Date: Mon, 19 Feb 2024 13:33:53 +0000 Subject: [PATCH 3/3] mm/zsmalloc: remove unused zspage->isolated MIME-Version: 1.0 Message-Id: <20240219-b4-szmalloc-migrate-v1-3-34cd49c6545b@bytedance.com> References: <20240219-b4-szmalloc-migrate-v1-0-34cd49c6545b@bytedance.com> In-Reply-To: <20240219-b4-szmalloc-migrate-v1-0-34cd49c6545b@bytedance.com> To: nphamcs@gmail.com, yosryahmed@google.com, Sergey Senozhatsky , Minchan Kim , Andrew Morton , hannes@cmpxchg.org Cc: linux-mm@kvack.org, Chengming Zhou , linux-kernel@vger.kernel.org X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: A08A840026 X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam-User: X-Stat-Signature: 9o5j9sxa1mqk97ge8zargjxffpo1yqgt X-Rspamd-Server: rspam01 X-Rspam: Yes X-HE-Tag: 1708349669-378582 X-HE-Meta: U2FsdGVkX1+Y2+URIxLg051cGmMEkTpMc63108CKqmt1SoOJE/OAGkbKccQi6MhRaRe1J8LB//NLykw5WCOstN11ZIuvTLsfm2Z0lsKLDZEQHe/zq9+tOX8sMSpVEVCBCUKgSAjD7eL2upDLFMzTeCb0439yXbQ9s2/ayDcr13LH0vSTV3kworni9ICWnApzhL6au1f1wQZ2w+rP+BUZiGTylsjpUOVKnXHLk9DueZ/KRYM5SThndqHMc546msvE3MbriYhFMjuxLJb/iN4/jqPafycddB22qpw4Mg/T441kvkLBCgv0yVboNzncucDgZtuf2Xa2AqnEnOHBYi2sXCE6jX+nRrnRnf40QSYhSmQRiQBnjCmMIFYKYnpWGY93/tRfv4ldJDjEexJXBdH56YmN8jlVf4NvYilTJdRIBYNL3/3nJGU/nkJmzYujYdmXzaxu/R9v74rtPoHBOAV96r58fAAugm1vNstV1C4z1I44xF2QBx7DZn38I/IHbyeKsqTqKhCJD/0PCM2ZNJnTMXfo7XmbAHc3f6vIh257HTPMpVadHARcaL431EPi/Vm6g8rIaw/dcq1PmyFJA83/iTmzMv/79p9PCpUCYvtOLGml0cxXmJWHWwsoKMZvPMuZ/CYWP6x9znr/6SHN1xXjWpCpM1ugby3PEnkfgLB4IyeIvQusGiVQMXJbZm2d5p/t89oQvVDzQ24wRM8zPFWVqFZmS9SpmJ8MwkJuYTtJG4GbkY9epQfOvHVtw2Y5XZ8wvqBEc2zWaQIoJYmI0gyCiI1+TeodJzxuDZjUuLtpHFH4mXXyKhE9Hs/VD2xNAiUP+/iG5tMz/z+9NCmhYnBLw6VRcsmhcQ4gO4ZegYVkfOjmwyZKO/ZUQ0umTieu3BKyE6sUSzNsOuN65QoqzcqNNdeX39ggCQ5aJ6Zo6NqUtYO9ew2xGa55fUmjWzcR6aZGBs58aLxxgUxZMaF9lAK 00OPhPAu SZX6fhUotP2R+Pwr3wMPD7ffUWIOxKdG21dU+YPNASm62KMlJqFqltoT/7ohWtgZj0XCuhu5If00Sv17aijrGSjcuwW0dvKZIorocb2pNlVsWyR1Uux6Yjx0weAyXubHZIv+JSUBFq3jegrrYIS3gZUDvbE68saNU4wNmmyvyZDCtWlc80Ik7L9pZrsyOQJw+zjdJQq2Z0mPknwG2FcS1UDP0AdPTLeoLsYvH7CObQCajwqNO4nle9v/xderuwdWtfstBLkHCDnoqOb70jenw6MSQjQdTD+yVFKKwrqvPUB/fdTtWahfiy+SSnchB3GXORFJErIawRC7wNuU= 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: List-Subscribe: List-Unsubscribe: The zspage->isolated is not used anywhere, we don't need to maintain it, which needs to hold the heavy pool lock to update it, so just remove it. Signed-off-by: Chengming Zhou --- mm/zsmalloc.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f2ae7d4c6f21..a48f4651d143 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -116,7 +116,6 @@ #define HUGE_BITS 1 #define FULLNESS_BITS 4 #define CLASS_BITS 8 -#define ISOLATED_BITS 5 #define MAGIC_VAL_BITS 8 #define MAX(a, b) ((a) >= (b) ? (a) : (b)) @@ -246,7 +245,6 @@ struct zspage { unsigned int huge:HUGE_BITS; unsigned int fullness:FULLNESS_BITS; unsigned int class:CLASS_BITS + 1; - unsigned int isolated:ISOLATED_BITS; unsigned int magic:MAGIC_VAL_BITS; }; unsigned int inuse; @@ -1732,17 +1730,6 @@ static void migrate_write_unlock(struct zspage *zspage) } #ifdef CONFIG_COMPACTION -/* Number of isolated subpage for *page migration* in this zspage */ -static void inc_zspage_isolation(struct zspage *zspage) -{ - zspage->isolated++; -} - -static void dec_zspage_isolation(struct zspage *zspage) -{ - VM_BUG_ON(zspage->isolated == 0); - zspage->isolated--; -} static const struct movable_operations zsmalloc_mops; @@ -1771,21 +1758,12 @@ static void replace_sub_page(struct size_class *class, struct zspage *zspage, static bool zs_page_isolate(struct page *page, isolate_mode_t mode) { - struct zs_pool *pool; - struct zspage *zspage; - /* * Page is locked so zspage couldn't be destroyed. For detail, look at * lock_zspage in free_zspage. */ VM_BUG_ON_PAGE(PageIsolated(page), page); - zspage = get_zspage(page); - pool = zspage->pool; - spin_lock(&pool->lock); - inc_zspage_isolation(zspage); - spin_unlock(&pool->lock); - return true; } @@ -1850,7 +1828,6 @@ static int zs_page_migrate(struct page *newpage, struct page *page, kunmap_atomic(s_addr); replace_sub_page(class, zspage, newpage, page); - dec_zspage_isolation(zspage); /* * Since we complete the data copy and set up new zspage structure, * it's okay to release the pool's lock. @@ -1872,16 +1849,7 @@ static int zs_page_migrate(struct page *newpage, struct page *page, static void zs_page_putback(struct page *page) { - struct zs_pool *pool; - struct zspage *zspage; - VM_BUG_ON_PAGE(!PageIsolated(page), page); - - zspage = get_zspage(page); - pool = zspage->pool; - spin_lock(&pool->lock); - dec_zspage_isolation(zspage); - spin_unlock(&pool->lock); } static const struct movable_operations zsmalloc_mops = {