From patchwork Thu Dec 26 21:16:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13921429 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 3ED56E7718F for ; Thu, 26 Dec 2024 21:16:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82C426B0083; Thu, 26 Dec 2024 16:16:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B5326B0085; Thu, 26 Dec 2024 16:16:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A4A26B0088; Thu, 26 Dec 2024 16:16:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4FAB96B0083 for ; Thu, 26 Dec 2024 16:16:47 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id EC1DDA1292 for ; Thu, 26 Dec 2024 21:16:46 +0000 (UTC) X-FDA: 82938368394.24.765DC9A Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf02.hostedemail.com (Postfix) with ESMTP id 7635080011 for ; Thu, 26 Dec 2024 21:15:24 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=SnMXCX+M; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of 3vMdtZwYKCEUz1yluinvvnsl.jvtspu14-ttr2hjr.vyn@flex--surenb.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3vMdtZwYKCEUz1yluinvvnsl.jvtspu14-ttr2hjr.vyn@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735247765; a=rsa-sha256; cv=none; b=wtExAvFDETEPVVhQH+FKBkI7bLynasREqFJMCmi39TC21kExAS09Y7J+yCzxmg/me6EqLA 6NrvkTjwM5i7E9SKOG8nShRSVmWG2J38sQRLZIwKz2spT+NTgiKXgo/DRKcwcUe1R/z3Bq 5fOfNELyM2Rg9CKVfONLwb9RnFUrurg= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=SnMXCX+M; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of 3vMdtZwYKCEUz1yluinvvnsl.jvtspu14-ttr2hjr.vyn@flex--surenb.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3vMdtZwYKCEUz1yluinvvnsl.jvtspu14-ttr2hjr.vyn@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735247765; 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:in-reply-to:references:references:dkim-signature; bh=pfuXd0GrahP2NIiXLpGEz1njL3PbfzffRJS1JIIbtb4=; b=X/f1Gno0lSleYjmZlERsXxxgPFWDVH5VmPZjSOsOjLZCxYS3YAV1WkgnokvL4helETYZJ5 DEZ9VLI2+/tUbqbOINPzKHeyWbOg/nNbhTyhMBZSTTzii6J6UcISaW2M/SCQoCFgtzkcDc RIGxeaFGc9FsD1bkq16OWOEZChYsP74= Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-21661949f23so140432095ad.3 for ; Thu, 26 Dec 2024 13:16:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1735247804; x=1735852604; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=pfuXd0GrahP2NIiXLpGEz1njL3PbfzffRJS1JIIbtb4=; b=SnMXCX+MFIwezukHbc5a9CbZ1/AD3XF7/75LRAon3SCy7/PSB4a0JftG0kfG8tmhZY 9bqzlAtSxNnKxrPNqcQPBh5VuMW734tZy2xaIZrBa6xmejNRTPtJKZTBCbU6ehV4ydNJ k63gXXsKOBk3cdq94Z3n+gRuoK8GP0olREhvYkghZO7dvOOy9VrdPEZgeTR0OAGANAhJ AqwqybTNomFmZbnH5a5brMVHHBlBtSTDdZf8E5mc2SsD+zC1M4vdx3f3yfGwpnqDKo7p CXbVVRoGSJSm0f9IcUnujmsKe2B+e9fbyjYZI4rSkWqmS/zxLNdXpQ8twR/NfvSEbVKj 1mQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735247804; x=1735852604; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pfuXd0GrahP2NIiXLpGEz1njL3PbfzffRJS1JIIbtb4=; b=Eeo6VQyjyiP6clZefCGm+Fsx7qez8v6W5vgMeqGV9PhgXa6EYxnpAUOimYyebYEpCB rI49jbNFILBsR4iVvsTKD8eXm6EZ1A/wlulmsps4fDZGpN0gG9kjAVzf5vWcI9dEloW5 zqIpxHccUQHkGQCSV0kFzN+NVj0uVSdBgDhM2XmueORqxVl8UDAcec69DxH+WxVPp973 GhcKOABX95xRwPDazZ/syPKROe1lGwSo1tBqyFOy2B8hT48BqFr41vUsXylkGaMWJTbc s1FcpCx+1lYr4vHkozZp+a4mX5DVF82+Vzegn6pFtxgoZ5pjINUN3PD/FBgl9V+VMnAh f3Pw== X-Forwarded-Encrypted: i=1; AJvYcCXmq1F2r1Wxv+lmJaJomdMDCDl6YggQ/hHU9OaZUXpidvB1q4Ylr9V1dwsyFs6L6Z76HEYvCCZyWw==@kvack.org X-Gm-Message-State: AOJu0YxzXC0U0cU2m0QVzaByzg8iwz2zl3lJ9SeJiPbS6cfy6jGPn/uW TXJfuw1b0qCV8N66KIs6f5bCZcpsaDTE7TyfLOAOyXQXE4A/dpp014q9jhITx9OwRl3Px5wjBte KDg== X-Google-Smtp-Source: AGHT+IG8zt0lLXNRNgHLYZTdR0wBOYsPANFDIrRsTRrEqiRTBTz8an+nFbGCK3hSlS4zlLagTqqkdmVyqFw= X-Received: from pgbcq3.prod.google.com ([2002:a05:6a02:4083:b0:7fd:50ab:dc45]) (user=surenb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ce0e:b0:216:3d72:1712 with SMTP id d9443c01a7336-219e6f38292mr386695025ad.48.1735247804120; Thu, 26 Dec 2024 13:16:44 -0800 (PST) Date: Thu, 26 Dec 2024 13:16:39 -0800 In-Reply-To: <20241226211639.1357704-1-surenb@google.com> Mime-Version: 1.0 References: <20241226211639.1357704-1-surenb@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241226211639.1357704-2-surenb@google.com> Subject: [PATCH 2/2] alloc_tag: skip pgalloc_tag_swap if profiling is disabled From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, yuzhao@google.com, 00107082@163.com, quic_zhenhuah@quicinc.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , stable@vger.kernel.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7635080011 X-Stat-Signature: q91pq3qfcgg8nqrex1seyd771k15xkkk X-Rspam-User: X-HE-Tag: 1735247724-72366 X-HE-Meta: U2FsdGVkX1/FEMpoNw5HItGUoaXAmerJ6ZP4QBvKj+K12lgqyfSQlfVQYRC7pfxD0ICZH7BQVCjRpAGGphLcjAgNDyaO8/wSntSUrND/lD+mMk/gkd8SbQUzbUkJdCauLamWe2fpYbyM8OIz1x/KUiGSAL+0CCJMsj3fT9/B0r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bk4vZvHovsdPAlcfZ4C4eh5E9VRBuiM128IIPRxY9tU9CCtWZsUlPfLMrQN6szqH+20GKtBO2lGlYjipkC1fA/Ee5LhMYNR2ShyWSYDq/Jv2HKmF3aGpgsdyCslfAwRJkU3bgHmRJR9Z5iPkQ6vgu3mC8CDvctnNASDt2bvvrtYQAyaxQLiDNx12r2IMAW6rYZS8/fWmGEqDKevajvTb4Ev0xAA81mooxDb55mgEeZSi4GLxzoXJnrnIN604Efjq9ZCNKRBOCkvh7ZsAY5nRXgQY+afx3kBObFfS1TR4t0+XSLoII5feNwp75wIZPysVn3GyQpetFXY0uB8Zc4TAD3pG2xcPoJ83hm8naOafxtMTeZTRdGf4WsvHlF8lH X-Bogosity: Ham, tests=bogofilter, spamicity=0.043951, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: When memory allocation profiling is disabled, there is no need to swap allocation tags during migration. Skip it to avoid unnecessary overhead. Fixes: e0a955bf7f61 ("mm/codetag: add pgalloc_tag_copy()") Signed-off-by: Suren Baghdasaryan Cc: stable@vger.kernel.org --- lib/alloc_tag.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 4c373f444eb1..4e5d7af3eaa2 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -197,6 +197,9 @@ void pgalloc_tag_swap(struct folio *new, struct folio *old) union codetag_ref ref_old, ref_new; struct alloc_tag *tag_old, *tag_new; + if (!mem_alloc_profiling_enabled()) + return; + tag_old = pgalloc_tag_get(&old->page); if (!tag_old) return;