From patchwork Tue Oct 22 23:24:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sourav Panda X-Patchwork-Id: 13846251 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 8BC3ED2C57C for ; Tue, 22 Oct 2024 23:24:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CFAA6B00B0; Tue, 22 Oct 2024 19:24:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 180D16B00B9; Tue, 22 Oct 2024 19:24:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 021266B00BA; Tue, 22 Oct 2024 19:24:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D87506B00B0 for ; Tue, 22 Oct 2024 19:24:47 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6C31F1605EA for ; Tue, 22 Oct 2024 23:24:28 +0000 (UTC) X-FDA: 82702820004.02.05D6F46 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf14.hostedemail.com (Postfix) with ESMTP id DBC30100011 for ; Tue, 22 Oct 2024 23:24:26 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=HnmE3i5a; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf14.hostedemail.com: domain of 3PDQYZwsKCEUzv1yh2whukhnvvnsl.jvtspu14-ttr2hjr.vyn@flex--souravpanda.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3PDQYZwsKCEUzv1yh2whukhnvvnsl.jvtspu14-ttr2hjr.vyn@flex--souravpanda.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729639318; 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=dx/bAtd7J34pukh8whXLHvbZ8CIncDKFC5WH0skHh/4=; b=QyqRwWlY4blZY8KeT1nBiHrIEW54vt/lCu/bByps4dQtaK3PSPdKKen5qSVRAiNwbJ3ngx JEJOqZrJEcTgcFUACD4noK85LrHjwP8z03j/QR/M/BLbSgOLEa3aQLN6GgbaHpfSm5quxz KmPh0A8aRFQiPI1nw52ua4laFhnMbk0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729639318; a=rsa-sha256; cv=none; b=mb8yZcHq/Grlg06NihsNtxF/GsolpSKz2hGth0ej2qnSX0Rbo7oTnL/oe3KJo3eHZQxARn UHMSmj2fS+HZWwTtwhPnB15DxmKe2xK65joXjD4IwGTRFfXtBfW6/7MIXNMUb5PHF0p87z RsAEqM+1qVi8d/6WZEMOXPi62P5JAFY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=HnmE3i5a; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf14.hostedemail.com: domain of 3PDQYZwsKCEUzv1yh2whukhnvvnsl.jvtspu14-ttr2hjr.vyn@flex--souravpanda.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3PDQYZwsKCEUzv1yh2whukhnvvnsl.jvtspu14-ttr2hjr.vyn@flex--souravpanda.bounces.google.com Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2e2ca403f5dso5809024a91.1 for ; Tue, 22 Oct 2024 16:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729639484; x=1730244284; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=dx/bAtd7J34pukh8whXLHvbZ8CIncDKFC5WH0skHh/4=; b=HnmE3i5aXJ5IN3GtBbBhwhs9/L5QBWsWMKLZPUTN4JwbjBrC5rfZxsDZMEoGaXDLkT 8ljBkzbW/dZIjpZPu7ceZmUixbInrQEwoqyVWdMV5iWLlpBlKS7j7D+4k/dTtV4uVj8K +d0uEAhOFrrzyHmO7M3F2T+myttAeeAisWMUdHIFC8E13MturOwEOuNuWEdVx0Zy1cyQ qDcs87l3AREaZLJ+hcHrWz5cvjqFkGBTUE2lTL44ZWnvUOuDvxIlvdxjAaryjSesXWq2 7w+uqki1msvNm9RWNCD0pbdzGWzJuQsoNx5BR+/hVnw0RDnA1waNgC6VMjaicgh/6vNc oZhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729639484; x=1730244284; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dx/bAtd7J34pukh8whXLHvbZ8CIncDKFC5WH0skHh/4=; b=Mu9IJXX8fF7IzI5sqnY5/pfJIcp1uSnCV/PmeHv2C2LSqtsNbmQ4IF3mqPBB382BDb Aozm8bRitxdhNwLbtzrniCVgUoth3uk/Z2uLOWRcenTZx/bEvNqbSNyJxPWwuSeE5M3k lCeoz2G0s5/YI8lUPxh82mERY2bNwIGi5y+fQTVjyMfco/2LRE5oaMJhzG+J6x+R+k/O 3QeOktRL6oAAjciS2b/TdCmKpe/5MInGrMszr/FfzhV8ZX5Ym93ag3V5K/l/6GTKGITm vsvig955AlbqVRJIvZxBvEHyFlKrQUA7xAmSgPJSRywNUf14Ywa74bp1gfjhAXZ0lsTf sFAw== X-Forwarded-Encrypted: i=1; AJvYcCVhUPDGvBixI/WIqZsP9u/p6cPjEc8NA0Bx+wHvZr8J4s6FkmQtlMUD3LpVsGPzBd+gBBLkL+PYFA==@kvack.org X-Gm-Message-State: AOJu0YycsLQcVt6IYcStAnR6oDYu3A4+UgPuPcI0f1pvHqyp0fY0jWrT TndUBITVt8+FUfblf5DzExuZ3XxoKAy0S+4HvBN8tiIsUXLakqvNP6alC8b4HopuTmH4UK54kNW 5j0SN/Lwej5TOpeN2VFxGGw== X-Google-Smtp-Source: AGHT+IEWwJ0q7HzgQitOsqrFtJ42q7VF/jH/hgTdsiGeloYBSKWeWUHNFKDOVkkvROJJBljYeVguSl0SeiOObdVWPw== X-Received: from souravbig.c.googlers.com ([fda3:e722:ac3:cc00:4a:2332:ac13:d235]) (user=souravpanda job=sendgmr) by 2002:a17:90b:1a86:b0:2e2:af52:a7b4 with SMTP id 98e67ed59e1d1-2e76b8516c1mr764a91.8.1729639484076; Tue, 22 Oct 2024 16:24:44 -0700 (PDT) Date: Tue, 22 Oct 2024 23:24:40 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241022232440.334820-1-souravpanda@google.com> Subject: [PATCH v2] 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-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: DBC30100011 X-Stat-Signature: wt5ju96fmaobtbcwbxh3nopx816z5dru X-Rspam-User: X-HE-Tag: 1729639466-141306 X-HE-Meta: U2FsdGVkX1/2WGoywiMWwoNdlniis8VnE6J4Oi8PsFltlajU2+oXet+bwiT0L2FWs2RmGuCz44FPAtQjhK40yZ8DS3qlqPktTdEU1wHc1jtNOlmFmx19m9ERY6fsJCMzyDipYuI3uDm9Wqzhn/0lwr9mrA+ohcYDwjrIlqTtemp30N17iS1SlsGgrfy2qcq5jQVrooc6GAQMrRyqhwEcWnXkBqWm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/DPP8tbFXkxs/a13+qZhbhdvFu3uliHWAEljsXnBDZE6JnPL7Y1Zyunf1iEVh4Efk7OWuAQoBFB9Fo11/eN6ECKOe511uInXwAytkXduF6WZnkF+cUMGSvsylc8cNbWekZa2ZNgQXXczGuZQVMtPatiZRZX5/JMfiAG7AIEgABUXSpJFzoWyE8HS+H63lZkP2QFrdSCrqRDb0HIHx+7nZIxUo2ruAS7m4C+uYlbbprHGT6c7On43+GVRKW20QBDSwcrUZ5UkKRh0cIwPhVgHdOcSgYZsnqiFg0mPRx1V/BX8RQyJgrNpu+PCy7i1hj1SSd1ba3239vCidGiTuz9QE9MMPg/RYrKxfq+SMvkXqPp/IoErMWG4jPqa6rdjir+cUMja6Bl75m X-Bogosity: Ham, tests=bogofilter, spamicity=0.302427, 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 correct unit, which is the number of bytes allocated. Fixes: e0a955bf7f61 ("mm/codetag: add pgalloc_tag_copy()") Signed-off-by: Sourav Panda Acked-by: Suren Baghdasaryan Reviewed-by: Pasha Tatashin Reviewed-by: Anshuman Khandual --- Changelog: Added Acked-by: Suren Baghdasaryan Added Reviewed-by: Pasha Tatashin Fixed the nit pointed by Wei in the commit message v1: https://lore.kernel.org/all/20241022205622.133697-1-souravpanda@google.com/ --- 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);