From patchwork Tue Jan 24 23:02:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaac Manjarres X-Patchwork-Id: 13114858 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 116F1C61D97 for ; Tue, 24 Jan 2023 23:03:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D16C6B0074; Tue, 24 Jan 2023 18:03:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 481316B0075; Tue, 24 Jan 2023 18:03:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 348EF6B0078; Tue, 24 Jan 2023 18:03:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 25BB56B0074 for ; Tue, 24 Jan 2023 18:03:01 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id F3F871A083E for ; Tue, 24 Jan 2023 23:03:00 +0000 (UTC) X-FDA: 80391219720.09.6874199 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf26.hostedemail.com (Postfix) with ESMTP id 59A08140019 for ; Tue, 24 Jan 2023 23:02:58 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=lGUMU0Go; spf=pass (imf26.hostedemail.com: domain of 3oWPQYw4KCM42Cuuw6u73uBByC08805y.w86527EH-664Fuw4.8B0@flex--isaacmanjarres.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3oWPQYw4KCM42Cuuw6u73uBByC08805y.w86527EH-664Fuw4.8B0@flex--isaacmanjarres.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674601378; 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=jFCDOVwBx3QUvcMyKCToQPVtKOpYmeI/WzOaX/ijtqo=; b=o3t6bTE1wX9MkKyitkZYwqciAZQ7dvfAHwsUG7BJcryn1J47fCuyoqiRG7FnClPZjQJDkb JgLAZyOq7IEP+getRDlBlYs4CoG97sy20ViNNzZB5uL4KVSVSPZ2237VUENIjawFC1gxCI NNHkV+OT1NPcIFfATjhFxg52dprr2Zc= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=lGUMU0Go; spf=pass (imf26.hostedemail.com: domain of 3oWPQYw4KCM42Cuuw6u73uBByC08805y.w86527EH-664Fuw4.8B0@flex--isaacmanjarres.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3oWPQYw4KCM42Cuuw6u73uBByC08805y.w86527EH-664Fuw4.8B0@flex--isaacmanjarres.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674601378; a=rsa-sha256; cv=none; b=rm0ImujIjGdN5+Pi0ZJgVCFM3UMr+aaGmPtkn6A7dQRcfWnSaq8wjWhRg+FqEPHJb8WquH oSdTJYrqT8ZTT+N2HlUJqkIZ3VX1uRrwoFXETXE/pQenKOKskVRWxFeU5swIvfhiuLqvEz 45YAQQmATFMWbitvvZ/njkwnyTgakmM= Received: by mail-yb1-f201.google.com with SMTP id c2-20020a25a2c2000000b008016611ca77so13890247ybn.9 for ; Tue, 24 Jan 2023 15:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=jFCDOVwBx3QUvcMyKCToQPVtKOpYmeI/WzOaX/ijtqo=; b=lGUMU0GoyjMvxhR5c/END1G2FVaGF8h/lxKsEBZG9c0LJpJjGKejWRHgfC/drxKDSH 62fajyC2+vuvDk/7FQKN7N60LwQR1dtnGfw0mirFy1kccUYDvzbFEkq8WorpafsApGyW YNdikjtXJ0qvizHvdRE8nZwpmwgkyZKvHejop621KmwDUsS0FCq48chv5FiSx0xM801v +B37aWPXTixdEO0BnBF0OdMDojYAN0xYneU1Zik51sP498ARl78sXWW6D7upcRoxS444 ZNlYQh/izuCYRt7+jyaKxT3dQ7Bw+rpvfieeWL3tTUx1TPXnxolTdPGfTD098yBSi7NJ hZpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jFCDOVwBx3QUvcMyKCToQPVtKOpYmeI/WzOaX/ijtqo=; b=kAjpzCx7HGLkG3MSWN+vSUrT8c6tfLB1Ahfzycqc8CUheZ17Bk0C7SdGczFeeygNCW jXSPACfpEn13U41KZ0XXSMfotyz2C6TKuixDhqGzQGoqoH58s/cCr2BXYdsAytLDLD4l 7hX5hMEMmb5rjFG2lSmC0FCliEqPIVj4/qlXLCOomCWP4Zq18zPTXMqhJIVt6kBncauh spv24D9r2ni1MEbiB+v7PKQaIRzJZjFI0m4tYUvUBwvO4ytN6BwSJ1U1x0B6eBTIfHaQ 6axo6Xp7cRfBc1c0B9fWUaWGaLlovWSqpY/ejqTDbP7gu4GYz+UbdhrPB9/0TMtxdw/4 q1IQ== X-Gm-Message-State: AFqh2kpzmX/k2eyqwLAFPfIrAfCQDUN8Q8XfQhG7xfLSbzpkH97PgCri 5Oc5Nlkq5+iJm2tyzgvmx3qMuQnvlBK5XNGgp3JMbg== X-Google-Smtp-Source: AMrXdXudHpb6hExu0NEHtxFsSqiV2w86qKxRTpDMvyw3aa8/qFaD7i3+qsxBf+fcybfThAjbSBPvI40rjFUZGrzvMaW7+A== X-Received: from isaacmanjarres.irv.corp.google.com ([2620:15c:2d:3:b15:b561:51fb:73c3]) (user=isaacmanjarres job=sendgmr) by 2002:a0d:e285:0:b0:4d8:4718:1c51 with SMTP id l127-20020a0de285000000b004d847181c51mr3040255ywe.284.1674601377338; Tue, 24 Jan 2023 15:02:57 -0800 (PST) Date: Tue, 24 Jan 2023 15:02:54 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.39.1.405.gd4c25cc71f-goog Message-ID: <20230124230254.295589-1-isaacmanjarres@google.com> Subject: [PATCH v1] Revert "mm: kmemleak: alloc gray object for reserved region with direct map" From: "Isaac J. Manjarres" To: Catalin Marinas , Andrew Morton , Rob Herring , Frank Rowand Cc: linux-mm@kvack.org, Saravana Kannan , "Isaac J. Manjarres" , stable@vger.kernel.org, Calvin Zhang , kernel-team@android.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 59A08140019 X-Rspam-User: X-Stat-Signature: m5zc6rtaxzwr77eqhh1pnth6pzffzhz9 X-HE-Tag: 1674601378-160514 X-HE-Meta: U2FsdGVkX19wv7Js3FILyT+W8oSy+B/X4eCJ0hi4cq+XLNQb1Cay4/fEx3YLQyoZq/mwSQizT3weBKddfs8jIznb75uqkOB7lGbhZ5Hr3Q7nNBsVm8+w1AHGbn66AdQjE5CBNn8feqp0r/Z0VSWliInF+1ca9PjevTy2JVlX8sfB5jLQHC5js/JstFPh6LY9Qwp2L6HOz8r1yMh0ScSqCjoNnbTjWPlcK8aGPoqVMXeUu0k0ROgjRsOg7ZgZhcvACx+aqn2depDZvgvaGZvn46hBEHYjnyTmx1SZVro0MI0HdjaekDHdCeYZlBW63tECFdTvPyUhB/WnZGVyiXi80wsywwjEQfIXK/q3kfR355w23kQ1ExTU9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X2MLfkSH072ej7N2QMwk1lqZzH64ypoJRbE+6yuPKKSF7KtAuGd3WmHswXSzINOi/XktQrwKx3HhTGVQtTY0PuO7chDLfTaAEWMgCqn/HCQeNzjq74VCWmKLLEptjw+adxXvNNF3Cm4Zp5ngfPuVDveZ8Xrg0GEJMLOl+V49O50WJd0xMaQh5B5w3e1Ga+S7xC/IsR03qggzHqedvZGw+y0pLWqhrN8AQY4bZZHwIMRluF9l3rq4EZVe5jjfqt+n/YqJo+eDA75cy8MUWtZ6e8F6uS+gwZjGPf6OV21kjiSJ4TPzIyeJqMe6Plpmf4Fp2fnOYvoss+ljgwXxzxNiE0fH77A+F5/aTPjltWMugllTw4Zh9J3xKCC8hpDuhceKF6SPnPZAizxpg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This reverts commit 972fa3a7c17c9d60212e32ecc0205dc585b1e769. Kmemleak operates by periodically scanning memory regions for pointers to allocated memory blocks to determine if they are leaked or not. However, reserved memory regions can be used for DMA transactions between a device and a CPU, and thus, wouldn't contain pointers to allocated memory blocks, making them inappropriate for kmemleak to scan. Thus, revert this commit. Cc: stable@vger.kernel.org # 5.17+ Cc: Calvin Zhang Signed-off-by: Isaac J. Manjarres Acked-by: Catalin Marinas --- drivers/of/fdt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index f08b25195ae7..d1a68b6d03b3 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -26,7 +26,6 @@ #include #include #include -#include #include /* for COMMAND_LINE_SIZE */ #include @@ -525,12 +524,9 @@ static int __init __reserved_mem_reserve_reg(unsigned long node, size = dt_mem_next_cell(dt_root_size_cells, &prop); if (size && - early_init_dt_reserve_memory(base, size, nomap) == 0) { + early_init_dt_reserve_memory(base, size, nomap) == 0) pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %lu MiB\n", uname, &base, (unsigned long)(size / SZ_1M)); - if (!nomap) - kmemleak_alloc_phys(base, size, 0); - } else pr_err("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n", uname, &base, (unsigned long)(size / SZ_1M));