Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2440804rbb; Wed, 28 Feb 2024 01:40:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX3qAPn2uqvCVSZEcGCHfiuOxPT5zXcclsZnk0HsB694ebfoZKRVK++y5kzw+ingemMxyPqijaAJaq62Ku3nJEqwjMtuq6MOZETxiR7xA== X-Google-Smtp-Source: AGHT+IEvSio/6aV3hJL7oN/3GsdPoxnIdigTxvqvL8SAljUU8tINlffkkzaZPZjYZFdZzXiFBQE4 X-Received: by 2002:a17:906:d108:b0:a43:d1a5:e907 with SMTP id b8-20020a170906d10800b00a43d1a5e907mr2522565ejz.58.1709113250440; Wed, 28 Feb 2024 01:40:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709113250; cv=pass; d=google.com; s=arc-20160816; b=TbaUg18XzkGuJFlt5OMP7xYwgQS7o0/99BBq6k90UCl/3Kfr9V9lFe/qGjGdC979UM /1QD/7aGd1nyPhtEh9nEUhAlQo04H+NcTfEFNDUFnGfJ0ZwMjb1WFhuDB2sqIk8+7gbK kf+xZEbtsdRek+dgeNqd8/m6j0B3Uu3IBe2tMiDzDcVRuTsQx1Siv368+oxXE65zFhfU h0KdIFg2ibeJMHCQq7tSX7a9Ljm8lYCzrTpPmPuScYYLe1FwLEhKrclP2zqg6Y3dJP/+ tAOupnf6TrDn4fqnHxt2aOGfDtBUu2ogE8H153mSBLgNKw8TPL3w0Pk/lDG43Ejspijr Tu0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Nf202lJoRWN6o1Z/oehgQE2q0xI7gvW3sKmUDPYuALw=; fh=5BvqvVi/8m7lS1yGIg8wlNlFY4OXF6ZlqXcKemj1x+0=; b=ITZSGyRIhoQMYycIZwzWE9a+dbl86nKmfgq6e/UWR0vEA2g5aCEiVEwhlCAbMRitw9 gVq2swX2yoD3vFyrYQjthbJIBD3BaLyJ6Q2uQNhF2swWDM/wyQiUtn5dZf9t3xeoOebk HvkYoLmt8e0QAaGHhYb2crqq5gzcWWlMkL4TXLL6HJZgTDseTTt1nJxUJPmCnu7IYl6M mUq0JabLhdyliizxE94XYtiDGPE45L3YMD6vZQ4ccjxMwsDt9LkiFTJzReiQ+PXAKT4m rBnPnMG7lLFXG4CrO7dQk50qzH/7rnNYjnzFnMKjlSIxWOb4LbKIUe/K4zt5pt6qowvq Pz/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M89tswzd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84784-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id mj18-20020a170906af9200b00a4312cdf19dsi1643772ejb.871.2024.02.28.01.40.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 01:40:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M89tswzd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84784-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F1B4F1F22AE8 for ; Wed, 28 Feb 2024 09:40:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFF9A3612E; Wed, 28 Feb 2024 09:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M89tswzd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECF9436103 for ; Wed, 28 Feb 2024 09:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709113242; cv=none; b=rC1XlYisAMkEZngBWT66A5JVi9z9VVh30LaPF34l7YDYTwdPCt5Zj0hmzF8I+TlfcuiLOiOpTl2QzflVE8y3/O3oCpERgWjZbg29yKvE/SnHzGT4jPqIyB8d4L1ftIWQRvjvn9zBb7P63qgwmqnlMv2h75CrTT8Ti3W/kfj+6XE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709113242; c=relaxed/simple; bh=lvoTs/0UXElm44f/AN9pIyL/qzddZIntAlgjTtgGHwc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=uSGYPvRG261l1KOS/RZEn52Io0AD7qi5WsUhhlpkm0ycHtP/vieF7dWLIYDPffFAAQnwW5aDYg0su1wkFUn74D6Ew18PVTfYVWdaum58pMYUUdaKE3++fXLJ4FLASWURBf/3FPb4RN8xM7yDNL6YyJX79qiqWpoLBDeCDD/ldiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M89tswzd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63376C433F1; Wed, 28 Feb 2024 09:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709113241; bh=lvoTs/0UXElm44f/AN9pIyL/qzddZIntAlgjTtgGHwc=; h=From:To:Cc:Subject:Date:From; b=M89tswzdasInlvO4kCicJK0gvJxK5iNT5k2Pzi5h1eJa6leEUEkKjhGDDg8wuX0hq 4yuhv7ypmp6YVKnk1yarUuspZBWhdxtLRs5TcpxgznyTKCwdNJiwp/7C0sgcvAlIKn 3zUY87S59TPo8j1pfIycdz140Hf99KJJj68f79Ko9lSo1lwhI/kxNdKZ++FMVwmtV4 FNynQe2hL4T1n7qOzhoEqB51U9JY5gmftA7YdC4sM8GOgsRVCjnb5inVq9HjT85MMo kw+grGrhicACNWXBYv9emNyTn9vt5C5T4zLepkUcHHYCjjTemcp4Zbx1pkMoKm5WhV FlqPCpg1RqfXQ== From: Arnd Bergmann To: Minchan Kim , Sergey Senozhatsky , Andrew Morton , Chengming Zhou Cc: Arnd Bergmann , Nhat Pham , Domenico Cerasuolo , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/zsmalloc: move get_zspage_lockless into #ifdef Date: Wed, 28 Feb 2024 10:40:31 +0100 Message-Id: <20240228094036.2267912-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann It's only used from inside of an #ifdef section, causing a warning otherwise: mm/zsmalloc.c:735:23: error: unused function 'get_zspage_lockless' [-Werror,-Wunused-function] 735 | static struct zspage *get_zspage_lockless(struct page *page) | ^~~~~~~~~~~~~~~~~~~ Move it down into that block to avoid adding another #ifdef. Fixes: 2258bdebb55e ("mm/zsmalloc: don't hold locks of all pages when free_zspage()") Signed-off-by: Arnd Bergmann --- mm/zsmalloc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 1a044690b389..11422305d819 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -731,14 +731,6 @@ static struct zspage *get_zspage(struct page *page) return zspage; } -/* Only used in zs_page_migrate() to get zspage locklessly. */ -static struct zspage *get_zspage_lockless(struct page *page) -{ - struct zspage __rcu **private = (struct zspage __rcu **)&page->private; - - return rcu_dereference(*private); -} - static struct page *get_next_page(struct page *page) { struct zspage *zspage = get_zspage(page); @@ -1651,6 +1643,13 @@ static void migrate_write_unlock(struct zspage *zspage) } #ifdef CONFIG_COMPACTION +/* Only used in zs_page_migrate() to get zspage locklessly. */ +static struct zspage *get_zspage_lockless(struct page *page) +{ + struct zspage __rcu **private = (struct zspage __rcu **)&page->private; + + return rcu_dereference(*private); +} static const struct movable_operations zsmalloc_mops; -- 2.39.2