From patchwork Mon Aug 12 18:44:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13760951 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 2046AC3DA7F for ; Mon, 12 Aug 2024 18:45:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DF076B00A0; Mon, 12 Aug 2024 14:45:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78F0A6B00B1; Mon, 12 Aug 2024 14:45:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62FCF6B00B6; Mon, 12 Aug 2024 14:45:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 38D0D6B00A0 for ; Mon, 12 Aug 2024 14:45:02 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7FCB3C02F9 for ; Mon, 12 Aug 2024 18:45:01 +0000 (UTC) X-FDA: 82444470402.24.05DB881 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf20.hostedemail.com (Postfix) with ESMTP id A76561C0015 for ; Mon, 12 Aug 2024 18:44:59 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=pePve21L; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of 3Kli6ZgYKCAEtvsfochpphmf.dpnmjovy-nnlwbdl.psh@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3Kli6ZgYKCAEtvsfochpphmf.dpnmjovy-nnlwbdl.psh@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723488288; a=rsa-sha256; cv=none; b=QzBSZ3X+m4bNHLmkgd8Dh0bXP10FloCy+MCdPKhdvrzNWo7SfUNCsxklxDFC4xEmr/5GbG eDBPe/zlHiSH+leiXVzL5+JXFD1eWuQXoiEsyz1s+E/XDsFK+frAV72dBAzgVvifQ35RpI CQwdOo60oVAqw7trgXDS1RaLql+D1zM= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=pePve21L; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of 3Kli6ZgYKCAEtvsfochpphmf.dpnmjovy-nnlwbdl.psh@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3Kli6ZgYKCAEtvsfochpphmf.dpnmjovy-nnlwbdl.psh@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723488288; 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=8xfjsLS0qWmUfrN2bGiDc953k4XM6QAa2JwY+lrUcSM=; b=zxfVWObxrF7baz46KdBIAEspGlmI8XtN3cn6Im+zsA3oudvv9x1rqp3UxTt/aQMCwf4QOS 9KXy8uMwXIjm1IX1Dv0UUgjU79XDajxtumLEeFu0Xx3IPde/Gsp7cUfFcbVIw83BLsPB7n ngPLb1JHzcrA0uNVT9JM/x2NuiJZj7c= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-68d1d966c06so109016187b3.0 for ; Mon, 12 Aug 2024 11:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723488299; x=1724093099; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=8xfjsLS0qWmUfrN2bGiDc953k4XM6QAa2JwY+lrUcSM=; b=pePve21LHayB090WaFpwwz+diswFG/B91EeIhs6ZxYo5Fa1q8XncKJrrUJYpZglu4L znPm3f0m/XGpu1HpQXR3A8IYP+aTT9dIX6yLEk6mbKcFQbpJ0FR5JREcwmcT/Ank3CJd TiN40ipCscb4jvEP428SbW3irsSVlKmIwEl2QDQQ86QBLXLpIsOllfFqwclvyQhdzQIv liJOhvsFLKXehQHgpqoVS5e2bfhfsf6+3wH7UW/twNRPEmWYa+unCPQ4YS/en1NyHqHD ei24SfX8ZP3CsCZZR8SuWKcFoVnhT1JsPiShdg1axcYDoZV1XkH3J4N1JTUfYGDXcQVF +A3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723488299; x=1724093099; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8xfjsLS0qWmUfrN2bGiDc953k4XM6QAa2JwY+lrUcSM=; b=Pa/yOEY982NbbBQYFV2WOBhfzX0wLVSZTza6KNWEav4QOfwRh0sfD25vXUEjhKTaOa GVG/xNQ2t/kzUi8b594QsyX9xiytsTF2FUsApqRIqvltRjotQTn5zc4mOwx+xSr/zize 1Mp9YgV9szAlUWOSFO2tKt9CKAfwu3yrovNzz9VYnnwsvmHi+dMJHOxA1a4B2bBukB0o l3fC9dISDLmFlhiygLu/vrBm/cnJxdbhHo5VNCMnpFQ0J0UxTGeF0iRpbyLYe2J+c911 MWXh9RnlfqhLkxE95jcjd0ULNz+9c32cFqDZ81UYuB7/JoMNHmOfmz3q9OEzREFXMcFu bRXg== X-Forwarded-Encrypted: i=1; AJvYcCXwVF0pwBdOG+v/RR2Cc6skRtHK4V/t2Bc3jZlFQIxH+c0sWXhIfHqM8wEo/atSE7IItg6fyTh82Zsb5HwRNtWccKc= X-Gm-Message-State: AOJu0YyTP3HEntAQkL3dQjH8XBU5bPlROiukVaq6XZUmzMliK1rkwfdQ 0SQdOolxPvPdab0OcCj3nIbYWvRIzTHxfJycjZhMD1fzf6G5NjyDlRIt0wEiWlIXRo202WbBj3h SvQ== X-Google-Smtp-Source: AGHT+IE01xHH4pviDkRute4+F54n9w40B7TDMBtndwx7WiSzaMMX3jLH0he1cbHjQL8t5nUEOC5H3JdOvf8= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:3912:1e97:a514:421a]) (user=surenb job=sendgmr) by 2002:a81:b40c:0:b0:69f:9a89:4ba5 with SMTP id 00721157ae682-6a9718f32b3mr24227b3.2.1723488298676; Mon, 12 Aug 2024 11:44:58 -0700 (PDT) Date: Mon, 12 Aug 2024 11:44:55 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Message-ID: <20240812184455.86580-1-surenb@google.com> Subject: [PATCH 1/1] alloc_tag: mark pages reserved during CMA activation as not tagged From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, hch@infradead.org, 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 X-Rspam-User: X-Rspamd-Queue-Id: A76561C0015 X-Rspamd-Server: rspam01 X-Stat-Signature: os41qgadsjkyewshrkarmp8yxp9e3k1k X-HE-Tag: 1723488299-853954 X-HE-Meta: U2FsdGVkX19gNJYF0wvwXl4yJwx2s+aOivfeNKXzokikGeatveSFEfSU9gXiU7uYxOW+Vk/6Mbsl8siwoZtDuL2sU8HBDmYjuP/6dzjZAypg9Sf5mQYe+YBfPCTVqzsH3VguRuoe4TMv4I9Fj1W4mz3YXkK+bLWFDt3jK4/kHxz8FQdavVwSby4L9ZHbm9dlhGh51JR24mkMDGax4NwTihMiei30cHFYuzfzSeC8SB+Wjcy2Zg+PM7ZTlb3RH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z1wenTHKvQZ5f89paLW0L8IQaMStNtLW5PWBLGqHH0L9AeXRZ46yVMRSdpoVN/rN20VX0mcWeMj6Ol3TigvdduKaZ6mSPRn307D3BRE1Ri/xY4pX93R78UDPmPicMKjE0QUVfob8kptjFA9PiQx5f9pvUfyGkmj1MA/m6WEpvVA03kEMlYtDDHB2srKmKTJh1FyzTQryNf8hVSjVhXbck= X-Bogosity: Ham, tests=bogofilter, spamicity=0.114269, 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. Signed-off-by: Suren Baghdasaryan --- mm/mm_init.c | 10 ++++++++++ 1 file changed, 10 insertions(+) base-commit: d74da846046aeec9333e802f5918bd3261fb5509 diff --git a/mm/mm_init.c b/mm/mm_init.c index 75c3bd42799b..ec9324653ad9 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2245,6 +2245,16 @@ 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 */ + if (mem_alloc_profiling_enabled()) { + union codetag_ref *ref = get_page_tag_ref(page); + + if (ref) { + set_codetag_empty(ref); + put_page_tag_ref(ref); + } + } __free_pages(page, pageblock_order); adjust_managed_page_count(page, pageblock_nr_pages);