From patchwork Thu Nov 28 20:39:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Sperbeck X-Patchwork-Id: 13888325 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 CD71BD70DEB for ; Thu, 28 Nov 2024 20:40:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01B4D6B0083; Thu, 28 Nov 2024 15:40:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F0DE26B0085; Thu, 28 Nov 2024 15:40:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD4A96B0088; Thu, 28 Nov 2024 15:40:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BF1056B0083 for ; Thu, 28 Nov 2024 15:40:15 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3B19F12086E for ; Thu, 28 Nov 2024 20:40:15 +0000 (UTC) X-FDA: 82836670896.06.E212F6E Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf22.hostedemail.com (Postfix) with ESMTP id E1662C0012 for ; Thu, 28 Nov 2024 20:40:04 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=4tTZgcD3; spf=pass (imf22.hostedemail.com: domain of 3LNVIZwkKCDsgpmboYbZhdlldib.Zljifkru-jjhsXZh.lod@flex--jsperbeck.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3LNVIZwkKCDsgpmboYbZhdlldib.Zljifkru-jjhsXZh.lod@flex--jsperbeck.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732826410; 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:in-reply-to: references:dkim-signature; bh=pGk8bO659Gdwu4si5LtMHbyU77sFm+9rlypvNi4hI1U=; b=MOoX9LG5hThnpfR2xwqwDI56ZnbDurCStiWcD6VqWuccTAN8QSuTPy/Kiqs8xit1f2UyYA E3QEOM3nZXN+bhUQ9q8/Z05aSXbdn7Xk07tIq+ADChoQAF1aFh+OfoGIMwwSV+N2eAeoJ1 eUY2bG5ftycnMza9veQJIA16gvgC6o4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732826410; a=rsa-sha256; cv=none; b=M7FliMkA58fLMnwGPI+FHLGMMGRyPugVIMf8uwHk6O3ZErdcWnBAu53hq440Hc8FHyfz6l 4T9AeN6jk+ER5Cwgy9SHbA3KJBhkHG/OM8znqp4LKZGksNI3ldyiPzy36ie0S74T0OlYTF aXFj2z7bMG0fjbmMp3VnGVnysCsfyBM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=4tTZgcD3; spf=pass (imf22.hostedemail.com: domain of 3LNVIZwkKCDsgpmboYbZhdlldib.Zljifkru-jjhsXZh.lod@flex--jsperbeck.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3LNVIZwkKCDsgpmboYbZhdlldib.Zljifkru-jjhsXZh.lod@flex--jsperbeck.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-20e67b82aa6so9449935ad.0 for ; Thu, 28 Nov 2024 12:40:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1732826412; x=1733431212; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=pGk8bO659Gdwu4si5LtMHbyU77sFm+9rlypvNi4hI1U=; b=4tTZgcD3rrZeVeoh04ktn2+gm1INRBRr78NIstaG40X0IY9qCjZbsi+221nc6ov+e7 DUFaWUdTTCHNLoRyeq3lVhQNXCFAWzPeKWvYLEP2dNYZWKSb7di1xruRXqMg14EM1zAI Nt9zvDt/uR7B1cmO2pyA1uvTBFhIPtVV8hEUAMypBAy8PmvKeZUhnNhQzv9hp8mOPRJP PBuq4Cl1/LoN7Fa0W+icW4MANm2kK7Rgi3q7E54hm4FfLg88fWn5yIo6JJzpkaAXWfSx 5nZwUuEGS3ydMbi3X4ZgmxoZ53tsqTvLOot1y4jPamXa0iNpnIZlb3Y5zgnfJEuLB6dB 993w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732826412; x=1733431212; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pGk8bO659Gdwu4si5LtMHbyU77sFm+9rlypvNi4hI1U=; b=RBZjBafe5hMnqn3xfs2m9yr6e4HCQ4SG7Ji+LwnyKXvndjOrR3SIeHblZHRxatigUc HYtHu+0x7m7UUK9r+O2TJTEiIuGmSzobjIuuMxmxiScYI9KZSTXqIh8gdvzZ7CCOKqMy 33E7v+/lCM//qpareoNCCAfoFf/+WIdjHcG4PHrn12RSm+/RdBCqj+dKlxqSFyvHb1EB G/pDpCuKGODUTYd4vNU1BUDb4wgYqwg3+nXeYGZUxsg0qHwCt1/lvgorufbXDFWX834f lnIXN64F9Ap3ggW4WdIIgGJ50TE/bbQp0LuxBs29krzddzaflaCNty39Iy8UHm2+DxlO brDg== X-Forwarded-Encrypted: i=1; AJvYcCV1FfZ87Ems3zm0DpLwKr9FfOh48XmMTCTVTAxwMcVKyjel/a6KV9c1jV41C+my1dnPDd9LIwiS4A==@kvack.org X-Gm-Message-State: AOJu0YznFYcy0QzZ3TkFD9aZm3/lJLxu8qjX9ViEdPUrv23J/+RvU0Hp XxIOvMlD9b7F05UJiy++ZzgTNaaFLcT+DfNWF6YfgurF6enkI3WayLmwVzHZfGvhWnHuxRmxNoL 4iPxeV6vJL0Tusw== X-Google-Smtp-Source: AGHT+IFDox9vopnXYUEG8CG2I5eMAAIE/yxMUeakJhOILWCxtW68hh+uiFnnogv2HA6ltR7OQxaASLO5KmJUslU= X-Received: from plxe8.prod.google.com ([2002:a17:902:ef48:b0:212:2d10:e55]) (user=jsperbeck job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:dacf:b0:211:fb9c:b1ce with SMTP id d9443c01a7336-215010967dfmr104811145ad.17.1732826412132; Thu, 28 Nov 2024 12:40:12 -0800 (PST) Date: Thu, 28 Nov 2024 12:39:59 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241128203959.726527-1-jsperbeck@google.com> Subject: [PATCH] mm: memcg: declare do_memsw_account inline From: John Sperbeck To: Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, John Sperbeck X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E1662C0012 X-Stat-Signature: pycese7bme1coutijsiqeptbi7i85mzs X-Rspam-User: X-HE-Tag: 1732826404-829810 X-HE-Meta: U2FsdGVkX1/AzqCBe1qp5+EVwUYtuQYys53YNTn8eYx+XJFRujC2cZuuaFZ3hHHVXTIQwsea95cNlqoolcD8xzLWq/vkxt1r2bqJWV38cLblRbycK0Tx8FhNG1c5AgpgfLFWiNszzaDekZPfaHDWR6Y0/wTQKw77s1QgR1t3MltybB5wHdSdEOwcBLatQKfOgIOAzqftDor1puMGx08N7yzageSKei4fzRpTq+/0iaeSPGV/Diy2X8lub620wa35aWpT5cHO3sTtghvgWhiPtD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WzvuJiP6TmwxIbQaYD4HrZLLy5ZT5hbKBsyjt58sGaFG2V5Kg+zkmVG97cEB+VtueNTCOSvH/bw+oRyh8NZNQdtV/pU9jmXPQXOjpOqtTekEswZr2JArue8cO+tEOx88DKJqH6Y1fBPJegFrAGDGtGgTwM0OsugA59aJBl4HdO+BzwI2XefnvnKEo0t04zBdRPgZPNCVjDYzADmEfzWhqGI62G/CTUxuoeJz0h3j/9KAbZzc= 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: In commit 66d60c428b23 ("mm: memcg: move legacy memcg event code into memcontrol-v1.c"), the static do_memsw_account() function was moved from a .c file to a .h file. Unfortunately, the traditional inline keyword wasn't added. If a file (e.g., a unit test) includes the .h file, but doesn't refer to do_memsw_account(), it will get a warning like: mm/memcontrol-v1.h:41:13: warning: unused function 'do_memsw_account' [-Wunused-function] 41 | static bool do_memsw_account(void) | ^~~~~~~~~~~~~~~~ Fixes: 66d60c428b23 ("mm: memcg: move legacy memcg event code into memcontrol-v1.c") Signed-off-by: John Sperbeck Acked-by: Roman Gushchin --- mm/memcontrol-v1.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h index 0e3b82951d91..144d71b65907 100644 --- a/mm/memcontrol-v1.h +++ b/mm/memcontrol-v1.h @@ -38,7 +38,7 @@ void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n); iter = mem_cgroup_iter(NULL, iter, NULL)) /* Whether legacy memory+swap accounting is active */ -static bool do_memsw_account(void) +static inline bool do_memsw_account(void) { return !cgroup_subsys_on_dfl(memory_cgrp_subsys); }