From patchwork Thu Nov 30 10:12:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Patchwork-Id: 13474217 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 DF193C4167B for ; Thu, 30 Nov 2023 10:14:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E0528D0041; Thu, 30 Nov 2023 05:14:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 791818D0001; Thu, 30 Nov 2023 05:14:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60A618D0041; Thu, 30 Nov 2023 05:14:01 -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 471508D0001 for ; Thu, 30 Nov 2023 05:14:01 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 00A0C8016C for ; Thu, 30 Nov 2023 10:14:00 +0000 (UTC) X-FDA: 81514209882.08.92B2722 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) by imf18.hostedemail.com (Postfix) with ESMTP id 26BE11C000A for ; Thu, 30 Nov 2023 10:13:58 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=X9qSQs+0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.160.51 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701339239; 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=PU52qx6dxOM5bnh08PClP7wM+YBrueR/AqMAxCI8vXw=; b=NrbBZTITFxAmYTiVT8ijfIpTxZMfOKhK9jMjtG5XRAe/SOkl24K3sVVeQtlU4DxQqspPH+ zBFSKccLxQThkcWnSgaZ2gWz0byWtYpELJnQ3iDQi3e4Fp/O7KFtvrEzASde82qZw2hDO/ S1+wN7zI3Jqk9/SMNnKregDytF4o7uY= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=X9qSQs+0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.160.51 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701339239; a=rsa-sha256; cv=none; b=dQYOlCMZ1SCV2doPak4q0z0dHpQdyFwG0/Pi7/vOY8QL21L9TXflzzhOeiXqVI8eY+oYhu f/r4jA+1oEF8x9VJloSWVqrVxmEussGG/B5Wj4L3RlVLzQ9fj6/zoioYR4YKbs1770Uxx5 9XIgnO8r3SgA54tVnzfzgVNE05MxPVQ= Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1f9efd5303cso364743fac.0 for ; Thu, 30 Nov 2023 02:13:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701339238; x=1701944038; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PU52qx6dxOM5bnh08PClP7wM+YBrueR/AqMAxCI8vXw=; b=X9qSQs+0JncdiXNN5MRK4ogbZRfI4b9WjhyDY1W2h1n8pOC0r9wktFwByIExvMB5ZN QHAF89+gzoLD53q9/SVS4+QSYAZL9IU2B00uZs/A+rGlXNXM+1bs55KBKHblDEZj9rzl qL0UKVbJ7zR+YeJIQnlRrmvCVCERhoRQMfNJtGbkCtr//eM0U7BY50eSzaU4vlKw896x ECymnYIVIXlH+xAPQXSBQtG9LiVei3OJAwFVAvZnJOAecXip2vrNav49bobSFTIrZnL5 RR2MO1Y8uLFKQebOTA+cL9Lau/+qKl79OcgM9KN7GwhdAk3JIDEIPQr0zIEQPMeJ40Jk E0Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701339238; x=1701944038; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PU52qx6dxOM5bnh08PClP7wM+YBrueR/AqMAxCI8vXw=; b=BCfbPhM9btKPR1C03rhujoDIgdjcv7sryHxVe1ydH9PDJxi/a7cpsMw9utQ2AD5g4O wj2MSy073i7inlw+cuKSDYv1ua9+HoSGKhgqPgKXHvkc8McjD2RQsnv7wTdJXZFYV0Sw qgh7KNk0cP5pzVNAGpbmgVjpbDIwQDOnt5TNt1KkospiRuc+bar6ckmAlL49TpxmV5he DUIYsQEvPw1CEPc+Id3eu7hSFoclubZ9y3LAcWCWJ9cBMhcBRvMdQr70jwmALSCAZs3H x1r7BXi0QuuQI9IWOlTYSKiBUq6rSExy4ZqCdOysP7YT4wfMhGMORWPT8UheP8UnnPkx EnBg== X-Gm-Message-State: AOJu0YwNKoGzo5wio9rjDZZRj9Fh8sIzgsjcEkwMoj4elfBfo8c9YhiW Wp84xCYmzrJ5lPSv7equ8pDg0pHT/b4= X-Google-Smtp-Source: AGHT+IF7xPs3osFcbAXtafC8zymTOpCuIX1QgOTCKCbFxpoQBFHGu5Zy/7PQlDhV6/BLbAm79OJ8QQ== X-Received: by 2002:a05:6871:3293:b0:1f9:69e2:7909 with SMTP id mp19-20020a056871329300b001f969e27909mr28828128oac.8.1701339238198; Thu, 30 Nov 2023 02:13:58 -0800 (PST) Received: from localhost.localdomain ([1.245.180.67]) by smtp.gmail.com with ESMTPSA id r27-20020aa78b9b000000b006900cb919b8sm841402pfd.53.2023.11.30.02.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 02:13:57 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Minchan Kim , Sergey Senozhatsky Cc: Matthew Wilcox , Mike Rapoport , Yosry Ahmed , linux-mm@kvack.org, Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [RFC PATCH v3 20/21] mm/zsmalloc: remove now unused helper functions Date: Thu, 30 Nov 2023 19:12:41 +0900 Message-Id: <20231130101242.2590384-21-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231130101242.2590384-1-42.hyeyoo@gmail.com> References: <20231130101242.2590384-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: ou4km4pdjw4edsm7t8zqgnuz6iwi8wza X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 26BE11C000A X-HE-Tag: 1701339238-920942 X-HE-Meta: U2FsdGVkX1+a+2FM8IjMBbMm+mtlNObY9dEDo1y630mGV0Y4+9AMli/nV5V7guWeYu8+Iu+F/DBGl/0hXs7qbCSFBlLCvYNyJOmrdtPJho9oO8vrDxL3RdRgq/wNA6jUnXJEwQMTippg0W1WZ7LGzTnTpe3FENbqF3eoqrO9/TuyjKC7mRu5TJzMyqNXS+i4ZMu+dUSJ4rO3ss1klCN0lkcrE3RLfzSihvYPGw2oOR2dvCPbsgT9PvNoSc22yhuST29kje1Nlk3G7WwEn0vMpgCtD+e49JTYeA0PVyPEeqkYMrb4QCaRg/MJ3KbQk6S3zh0ady9IBJpa4lXcqGnJanMl62i+5rSD/tOV9SZTEuoUPG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12pwU7foHb1YEKCPaPPD4J/GL3Iufs7rKLQ4f/ce35hPp4jT/OgBYPMrXJ9dexdfmoSmXwFzLngs6 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000024, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: All users of is_first_page(), get_first_page(), get_next_page() are now converted to use new helper functions that takes zsdesc. Remove now unused helper functions. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- mm/zsmalloc.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 1ff83081616b..65387cd4cc5d 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -585,12 +585,7 @@ static DEFINE_PER_CPU(struct mapping_area, zs_map_area) = { .lock = INIT_LOCAL_LOCK(lock), }; -static __maybe_unused int is_first_page(struct page *page) -{ - return PagePrivate(page); -} - -static __maybe_unused int is_first_zsdesc(struct zsdesc *zsdesc) +static int is_first_zsdesc(struct zsdesc *zsdesc) { return PagePrivate(zsdesc_page(zsdesc)); } @@ -607,15 +602,7 @@ static inline void mod_zspage_inuse(struct zspage *zspage, int val) zspage->inuse += val; } -static __maybe_unused inline struct page *get_first_page(struct zspage *zspage) -{ - struct page *first_page = zsdesc_page(zspage->first_zsdesc); - - VM_BUG_ON_PAGE(!is_first_page(first_page), first_page); - return first_page; -} - -static __maybe_unused struct zsdesc *get_first_zsdesc(struct zspage *zspage) +static struct zsdesc *get_first_zsdesc(struct zspage *zspage) { struct zsdesc *first_zsdesc = zspage->first_zsdesc; @@ -911,17 +898,7 @@ static struct zspage *get_zspage(struct zsdesc *zsdesc) return zspage; } -static __maybe_unused struct page *get_next_page(struct page *page) -{ - struct zspage *zspage = get_zspage(page_zsdesc(page)); - - if (unlikely(ZsHugePage(zspage))) - return NULL; - - return (struct page *)page->index; -} - -static __maybe_unused struct zsdesc *get_next_zsdesc(struct zsdesc *zsdesc) +static struct zsdesc *get_next_zsdesc(struct zsdesc *zsdesc) { struct zspage *zspage = get_zspage(zsdesc);