From patchwork Tue Aug 13 15:07:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13762200 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 73A52C52D7F for ; Tue, 13 Aug 2024 15:08:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C13886B009F; Tue, 13 Aug 2024 11:08:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B9AD86B00A0; Tue, 13 Aug 2024 11:08:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3D346B00A1; Tue, 13 Aug 2024 11:08:06 -0400 (EDT) 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 844EA6B009F for ; Tue, 13 Aug 2024 11:08:06 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 40A22807FB for ; Tue, 13 Aug 2024 15:08:06 +0000 (UTC) X-FDA: 82447552572.03.E31B5CF Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf10.hostedemail.com (Postfix) with ESMTP id 54E38C0029 for ; Tue, 13 Aug 2024 15:08:04 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=gJOf0M6D; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf10.hostedemail.com: domain of 303a7ZgYKCOoegdQZNSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=303a7ZgYKCOoegdQZNSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723561632; a=rsa-sha256; cv=none; b=I/SD2g6Jihe/WohDdZagkEoxrRFbQIZBIVcg/9MtgguGq6wlGNsYUHf7U8bZEp3gwaRvvs 9CzZPpb511X2RXJK8GtopKScPPN1YwyDG+1aMHfuUEUZ52pLTSFwFrvzSQnBD8j/vqB74U qWLwkV3t4V7Atl8TtjjUC1TW4DASZ6c= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=gJOf0M6D; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf10.hostedemail.com: domain of 303a7ZgYKCOoegdQZNSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=303a7ZgYKCOoegdQZNSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723561632; 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=HItAAQ4Cu003jbkia8AheTp1hPIpjiafpUpcTgjSBk4=; b=cBdykaNfEJ9SiRii8f1o5cXapPm9cJKS8F+JHTecltZZMEvSR1gRehr6BO0Nm1QL/+nged OcFWkA7WBdI0/SnomGJV3PGT0NFqs+lLp/HPiWuOQqe1c3wpsskGnQPpFfhPOuZcvLJRJa TEjAAEPcDSfuc3gr4OkawIERnaev12g= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6698f11853aso111885887b3.0 for ; Tue, 13 Aug 2024 08:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723561683; x=1724166483; 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=HItAAQ4Cu003jbkia8AheTp1hPIpjiafpUpcTgjSBk4=; b=gJOf0M6DILb+mTGvVva31zBJeBy6vesdBwNmjKQa8Q5VXpa7duc1qJck5lyb/AVVbQ ptciIopV6m/kLk06C0evcdjGWfXXyNCAYTLnUC4yCuaBAspuHibxvsl4EVKPITRnf1bm x9Jrn9gk+lvY1Oe4PpSEeXhJS04ltYtKbN7QVpcAhO7YyfyFqG9uQVPIjdoCPmskZLSF TKUesdL5au080XtBL0br+FMXrUOKToKWg2YRjnfskEQ7s+93NCdVtAWc/0xAFQh9xbzv UmhFtzlp8gSKEGlyI8gQS1lnQUb1R4e/U6VOQiWTD1JpamLpFBIDeY4p14v4XU0I9+o4 N1IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723561683; x=1724166483; 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=HItAAQ4Cu003jbkia8AheTp1hPIpjiafpUpcTgjSBk4=; b=WJEb81YNblYgSs7NTfr1PMIzZhGG22PGZhPjtM7+D6bltLAVwEeMlqjZzLmaq/FwkD JdzLpZNbQME0OeF8wHzWmC1DchMahhvUrbx3VpvWzVbts3DV/vVsZeOBO0jeX5EzLlA7 W8XJZqUwRFgsDdjtKq8+AV5r42OX5iauwVXYvGhxS5t9OmRO03tHlv47ZnfPP4h+8vt+ Z7RIYSFugnaVsAzFBieyreEUeTaXJ1n3EkjHucRYaD6KmKkb9BJBeD9HzEnOT6n0B7nI Zo79xX++TjDOLrE8Zw70LL3k/JpJLlw2UD2x1RIY60bNf17gcuLlNySWuMawQPMPdx8v UFeQ== X-Forwarded-Encrypted: i=1; AJvYcCUuG3G0Jv+McuKxCq5oo6Qoviir9KTgrOnWKekOCdDg48hLElY6GWBNVhDS+m324FPiyZXlbF6dbGhAj+n4Rk1earE= X-Gm-Message-State: AOJu0YwLa0e7mdWKsjTPlfWnMb+04E4aEzX+wOH4G3C5pK+tOop/hr/U 99cszYalfZSLmwYh8HmAMAW0MfXnSnm0AStUEr2p+z8gkZehBPsCLhQv5sDIgrbk98hLylPo3lL JRA== X-Google-Smtp-Source: AGHT+IG/nKnomNtLuqj0m6U9iTDpGVWXD3ZvVIbVbvNz/CQySgPPuus4RRP2iUTRkRmZvV/6nAgz4mxWbJE= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:b416:2d8c:d850:78]) (user=surenb job=sendgmr) by 2002:a0d:d146:0:b0:6a9:3d52:79e9 with SMTP id 00721157ae682-6a975ab0573mr1862217b3.4.1723561683324; Tue, 13 Aug 2024 08:08:03 -0700 (PDT) Date: Tue, 13 Aug 2024 08:07:57 -0700 In-Reply-To: <20240813150758.855881-1-surenb@google.com> Mime-Version: 1.0 References: <20240813150758.855881-1-surenb@google.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Message-ID: <20240813150758.855881-2-surenb@google.com> Subject: [PATCH v3 2/2] alloc_tag: mark pages reserved during CMA activation as not tagged From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, david@redhat.com, vbabka@suse.cz, pasha.tatashin@soleen.com, souravpanda@google.com, keescook@chromium.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, surenb@google.com, stable@vger.kernel.org X-Rspamd-Queue-Id: 54E38C0029 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: gnaxcb3t819bjbexyoafz38wzt8955du X-HE-Tag: 1723561684-707963 X-HE-Meta: U2FsdGVkX18ZiL+VhnsePya7hubvhSJO1X4AnroTFD3y41fhU58TqhvLmBNRwesb2ZxX9+3bFEeLMFS+UaqsCYdnol7MjPMD7u6YVGta0XS2L3qhs7DnYUUu3Tpd3QEfeUlgTpTdUq2vXvqy0jjo2gAchILowpifFlizNez3QkLz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WP/2nH4uDnX61QIi6rfcatM1YkqEqvXs5Gq/dWy5DZ626mVrnUGgWb3F5SVSlYZ9h9soanDTpfp981yBNoZxoXIxgzYvNr/TUxb0FCsQNUNha+fwVeU0gZVSQWiWp0Kpk2LwzfxX7OaPkVnpDN24N7AKtJ7qFu36cJ/WzpSQE1Nkj9JcSyZjaFIl6GPZXl8i0jR41iLw0/YAwDbZx7sNCYrsa3fIv4H0aGYy0nrIVynTMfq+sKFof6UwKtdt8HMvWmAqH8yL3QWA+8Gh/CBbsPfyQksdpUONmQ6oLRi6DqU34qj/P39i7Ohs0ZI5FFuyDaDh3SEv0N8ii7Yg7DKtlofiN9rZmuJk1yBD1MPxHERaNo3t+6hRR40Lm0egphNZp9NDGw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.005262, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: During CMA activation, pages in CMA area are prepared and then freed without being allocated. This triggers warnings when memory allocation debug config (CONFIG_MEM_ALLOC_PROFILING_DEBUG) is enabled. Fix this by marking these pages not tagged before freeing them. Fixes: d224eb0287fb ("codetag: debug: mark codetags for reserved pages as empty") Signed-off-by: Suren Baghdasaryan Cc: stable@vger.kernel.org # v6.10 Acked-by: David Hildenbrand --- Changes since v2 [1]: - Add and use clear_page_tag_ref helper, per David Hildenbrand https://lore.kernel.org/all/20240812192428.151825-1-surenb@google.com/ mm/mm_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mm_init.c b/mm/mm_init.c index 907c46b0773f..13c4060bb01a 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2245,6 +2245,8 @@ void __init init_cma_reserved_pageblock(struct page *page) set_pageblock_migratetype(page, MIGRATE_CMA); set_page_refcounted(page); + /* pages were reserved and not allocated */ + clear_page_tag_ref(page); __free_pages(page, pageblock_order); adjust_managed_page_count(page, pageblock_nr_pages);