From patchwork Tue Oct 22 20:56:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sourav Panda X-Patchwork-Id: 13846162 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 2BAC2CDD0EA for ; Tue, 22 Oct 2024 20:56:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A0476B00B4; Tue, 22 Oct 2024 16:56:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94FBD6B00B7; Tue, 22 Oct 2024 16:56:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8174B6B00B8; Tue, 22 Oct 2024 16:56:31 -0400 (EDT) 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 646196B00B4 for ; Tue, 22 Oct 2024 16:56:31 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 9983240548 for ; Tue, 22 Oct 2024 20:56:21 +0000 (UTC) X-FDA: 82702446078.30.B30F229 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf06.hostedemail.com (Postfix) with ESMTP id 6A48B180016 for ; Tue, 22 Oct 2024 20:56:17 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=0Lk+VvPE; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 3exEYZwsKCD4xtzwf0ufsiflttlqj.htrqnsz2-rrp0fhp.twl@flex--souravpanda.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3exEYZwsKCD4xtzwf0ufsiflttlqj.htrqnsz2-rrp0fhp.twl@flex--souravpanda.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729630551; a=rsa-sha256; cv=none; b=uClNh8+GJjePUlPFuQ3dyaRngBD3kf6u54BrGbiLeC24hnlEp/urzNXc8w/oAITKhap7A4 q5+P9rRZig1bIGxhNyxYK6OiiUL9rsMYxL374a3EZIgiG3LxINtUcrgHaUZqawLfae+Rz7 LPtWnCwH38znlH85w0HFggSUrq16OIg= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=0Lk+VvPE; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 3exEYZwsKCD4xtzwf0ufsiflttlqj.htrqnsz2-rrp0fhp.twl@flex--souravpanda.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3exEYZwsKCD4xtzwf0ufsiflttlqj.htrqnsz2-rrp0fhp.twl@flex--souravpanda.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729630551; 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=Ta+9b5++FGBmxha8thwxDd9QOf2hx71icgR85vxLNHw=; b=VyKoVJmGDEsFejDieOH2Xn+Rb5DXrxDu3i75tJUEsg+w30f7LksYs13rC0IC8/D8QskUdj WucctcqUf/JgzYmpPxRyxJUVhMMRJ9MZmQ5BmF+MCZHP2ohEfcnZnsxdPW6IL7i9q0hfbY JAizAMpjVaDIZCuIeBhDRESHcmUTkPU= Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e17bb508bb9so10607334276.2 for ; Tue, 22 Oct 2024 13:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729630588; x=1730235388; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Ta+9b5++FGBmxha8thwxDd9QOf2hx71icgR85vxLNHw=; b=0Lk+VvPEw24WkVxnv5i/825W4owyzYdoBWzGyE1AmpjtCRb2f2gjx9RcDC5JX7Ym+B V1BZc418Ea0zYZdiQeDtyHJSjQOHmfdOd9xg7aW7xHz81yCC4MzmGHL7+MHKqp65b9pD 3J58+jloVO4/VVCAIMo2GG9MKzELnvjfAIbDMH+2/YwpEmXgKTXZl/rwzyFIpi/6QInY S0mtJe3kHvlutf6oYOzW2QlLw0tVCa56I9jvb4p2s2kUzYEgtS24Ospo78VSJZL2zuDq /lB2aRBuP4NhDYlyX+29Jo66YjyJoJMEFbocIpdrxsZbXelVyi+pHJrCToCIJzsWAqHt h75A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729630588; x=1730235388; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ta+9b5++FGBmxha8thwxDd9QOf2hx71icgR85vxLNHw=; b=lKAMOa9CD6VvSS2zUofK2EtsmhdXV8UamKFkTaXu/StPFEdqcO9an9+Xz/EkgVK0gL tjKUQDABmKhG6CBFBW/xka95PSSUFsr7am6nfOt9SN7Mg5FyHfPTP/Dx9bsb2GOfpJlm qeavAX+8scqmMoICk8L+Xytn0/SQeQpXNIb5dKg5DT9o5CZX76D5HBmr9iQ8hf3AqDOY nCBzrNVKra0IRCl5hyq0kbf1dnQJ7asrBpcPJJZc2Mw/vMJg8l4HaxfpUUHtI9/BLI+r KkIBDq6ygqoSGb+qhm1ORJkK6Op4ZtWH71dXDVJNIa+kIREMNT7/yBIRkW22D4X/MLXZ TAvQ== X-Forwarded-Encrypted: i=1; AJvYcCV/nm1PbIobHB6kJuQO0OJynuaIhxcSmku0pBs6Y0c5DZUzWnsZ+rlHI8plYXrU5iSAuoEifYx9NQ==@kvack.org X-Gm-Message-State: AOJu0Yzwp7+bAEFSnjRyB8Aa5r1KakhPj2N0RZJ66Ss8iVaxvGFfFYn/ juhH6kzhPLgx5OUdqcLiaOBI0dR52osxGl0B3Ddm2SevDeq5yX0zRJzvtfLZLIo7Ke2wgZWcrsR e/Sw0/4K9G0n6ln12qvdV9g== X-Google-Smtp-Source: AGHT+IGon+dXZEYxGcXSPtmacn8QlE7P8CHLHHb2+HCeuXHqkcSNt/6q6VLRsLJeRjYLFhxF45PjmfdNpCSWu+RPCA== X-Received: from souravbig.c.googlers.com ([fda3:e722:ac3:cc00:4a:2332:ac13:d235]) (user=souravpanda job=sendgmr) by 2002:a05:6902:1818:b0:e2e:3131:337f with SMTP id 3f1490d57ef6-e2e3a624ed7mr157276.4.1729630587656; Tue, 22 Oct 2024 13:56:27 -0700 (PDT) Date: Tue, 22 Oct 2024 20:56:22 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241022205622.133697-1-souravpanda@google.com> Subject: [PATCH] mm/codetag: fix arg in pgalloc_tag_copy alloc_tag_sub From: Sourav Panda To: akpm@linux-foundation.org, surenb@google.com, yuzhao@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, weixugc@google.com Cc: Sourav Panda X-Rspam-User: X-Stat-Signature: dkbeamcirb78u855wjzbu4icwe91ohap X-Rspamd-Queue-Id: 6A48B180016 X-Rspamd-Server: rspam02 X-HE-Tag: 1729630577-268076 X-HE-Meta: U2FsdGVkX18W+PcksHiqoYhxtGtjspxM8B1zKPojzyQN9mucqa96iJgxPweA9HXKSKhWwJal6O3lUR5jeKLrZwnY3pbDrAJjosHT7oJNKnExLQgoym0K+WeSq4lLktYt/lHTfk1cPlI/OL8NshhopCOlX2WPOzzJxVdrlZgZ65kRkuBkw3MJRMvjM6gE9AK3ca5bHw0Ng/p7XoIJkEqgQpocxGfrasVVI+Ptgc28484g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kx7qtAK2e4UGGlqqktqPq8BOWpTLwHk63FNLUm5oKOf9hwT4KJX/009yE4nMz8pBhQadWGsiFXv/+ct8RuU7sDzf9qzH6289cTm/txRlfjJsC0XGzkJCMx6TheHUmzASuixrqIk2dcqeNnvhuo2WOJ5rTBf9XHaCTDaN2Xp33PM1G0Bll0Mh4X/VFMaLP/JrVswzywgIF1Sdbh5o7v9nwqJf/8S0KZnUd3DhpDBKwXAOBkkjPdz3P0hYbM7iEqYQNaZCjKlJsWYNzneqmXGNGh5ARONt2i7V47b94IBs3EtZMYHuHjxMvhrK X-Bogosity: Ham, tests=bogofilter, spamicity=0.001761, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: alloc_tag_sub() takes bytes as opposed to number of pages as argument. Currently pgalloc_tag_copy() passes the number of pages. This fix passes the current unit, which is the number of bytes allocated. Fixes: e0a955bf7f61 ("mm/codetag: add pgalloc_tag_copy()") Signed-off-by: Sourav Panda Reviewed-by: Pasha Tatashin Acked-by: Suren Baghdasaryan --- include/linux/mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index ecf63d2b0582..2890001c8b97 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4203,7 +4203,7 @@ static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) /* Clear the old ref to the original allocation tag. */ clear_page_tag_ref(&old->page); /* Decrement the counters of the tag on get_new_folio. */ - alloc_tag_sub(ref, folio_nr_pages(new)); + alloc_tag_sub(ref, folio_size(new)); __alloc_tag_ref_set(ref, tag);