Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5741841rwr; Mon, 1 May 2023 10:04:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5VikiBLbntnHhQ/0sjmz4OjtVfddd2WRUhDM9LeqYJJjzmdUHShmhTDcMX/McnDJBPnnxf X-Received: by 2002:a17:90b:895:b0:24e:14ad:24c7 with SMTP id bj21-20020a17090b089500b0024e14ad24c7mr1700857pjb.13.1682960649954; Mon, 01 May 2023 10:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682960649; cv=none; d=google.com; s=arc-20160816; b=S49fvsKsKHHFY6vujbY3ALYbWTcAeVpZ3FKv/oakHgF6b+MeBQmXH8RKYFf40e/4eY C+GCvwcd5XBZGz90jBF9GQP8s5AF0yFGCgyLDOhUT0yB1M7l3ZpDQRUkCVz9oLOLq6d7 eAY3qBl+KzwG1Cfu6PgpLx+j9E1nMPhJq2MZ/vNe9xcT+3dMRZtb2nUHrTAO2HzQY+jU tBV3P1Hiws5wIMCH2BhdMXBpYgyE9jtagThBE9CiQ8nUjr5xdanXIP0zmcWxYdSvws80 iVXaOcFZd6A1/qfqTCcywPMFEMHd8p9uzI2jDYlALnX53/m2Rmfy6og+RVp+EPKraGgb Qacg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=uHz3gIMQ14LMAlJH3BHlupoStZ8/+BrUL09pT+1nDVs=; b=Hky1OUmJY2Op6YD0JbF+XOI+Q/tqn/5txKd9JnlnUQHKczVXeuLiOgURlt2IIYxpq8 VWzAkxWexXXZzeqSFoAE1RnVU5siQpG5E6UzSc7dz6mpcRGLyi/kh2sGa8Zu9+ZebPA6 ApTr0YegMnocd3v60Kpv7lr3yNK9tj6GINi2cSHPYTz/xrjCSCleJEQRfBn5ryBeZ4a4 dNWT8E3F/R8qBxRUCfYnmdlPY0BkvLAZH2qZKiYXCGin5VciwKff7Gen3uHTrItLltLo 9jf5DkyFjts5VWAc4eMTfpRMQNCnW//moY32Q5kTt0egmUwz71wCmYt2TmDUeeyL5rjJ ZslA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=cL9ulyr1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj14-20020a17090b088e00b00247074f8281si463943pjb.90.2023.05.01.10.03.56; Mon, 01 May 2023 10:04:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=cL9ulyr1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232388AbjEARDd (ORCPT + 99 others); Mon, 1 May 2023 13:03:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233053AbjEARCU (ORCPT ); Mon, 1 May 2023 13:02:20 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29CC140FD for ; Mon, 1 May 2023 09:57:06 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-64115e69e1eso23348161b3a.0 for ; Mon, 01 May 2023 09:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682960195; x=1685552195; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=uHz3gIMQ14LMAlJH3BHlupoStZ8/+BrUL09pT+1nDVs=; b=cL9ulyr1TZmloHcY9ZAQt2916/Hy8kFnLfCTiFsQOyXG21mKZDk2kVsVGS3swW/o9A lmsPI4V+ni8bJ2cDmSOvMhTe7jiZncm+a+dX+h32N0c6xUNbGxEO59xGx2raskwk+yE+ EY40N2q/B5lxnqf+wqKkKUxKcIxmFMWDeQ/MPMZ5UoklVL3SBusyJB6cuGrGjrAev2jt I6daIpOCKx+oNZEO+zjvrtYAnmo4PPKmPdsrXndRo+l1Ieu4A+pt+fjUYtVugs+1Ncqh keNiqCygIJKFaCxV1denDbSpt/uk9T3I2i0PdEP0vYROV8UgAo/d+Ogm15HjT6dg+WeL DFBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682960195; x=1685552195; 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=uHz3gIMQ14LMAlJH3BHlupoStZ8/+BrUL09pT+1nDVs=; b=jHFGheMWhAWgs8XhQYJeEHNjrf2CbyYRMja8F4ZIKJEzrIw2A/HDsHDM66/pztsdGn kLN1mRtLgemzHB+pgwdoVz9oC7ZkZjZds3I8eTZpIiVLEECqarfwYCrz3qv8IZSWFWqQ 7LeNb2AeiQrI/q/6Vw5VpoAyWlAbdrI3gKtgfXAUNKhMWNVcFLLvP1IF2Vp+2CZ7KpJT /f3+zLdCcxryd2+uMdPybh9JH32LdUTRXA01IEDlLGXJIxNoBb2fEkoxbByZW1G6irQ2 mD4Et7DwH34C+GFhBcpgLIlVoQVUYqXeY3I8QyDybGvKa5E4wxcMZzgAjC6dgNZcLSpe 90TA== X-Gm-Message-State: AC+VfDw8lPs+Mpzcr2U0814MJLzS6UMbacqXimy+yBptb44W4iskZG4p kELT0xT0Q+eLok6kmAOOVRCen6VUglU= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:6d24:3efd:facc:7ac4]) (user=surenb job=sendgmr) by 2002:a17:90a:5105:b0:244:9620:c114 with SMTP id t5-20020a17090a510500b002449620c114mr3673305pjh.1.1682960194723; Mon, 01 May 2023 09:56:34 -0700 (PDT) Date: Mon, 1 May 2023 09:54:48 -0700 In-Reply-To: <20230501165450.15352-1-surenb@google.com> Mime-Version: 1.0 References: <20230501165450.15352-1-surenb@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230501165450.15352-39-surenb@google.com> Subject: [PATCH 38/40] codetag: debug: mark codetags for reserved pages as empty From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To avoid debug warnings while freeing reserved pages which were not allocated with usual allocators, mark their codetags as empty before freeing. Maybe we can annotate reserved pages correctly and avoid this? Signed-off-by: Suren Baghdasaryan --- include/linux/mm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 27ce77080c79..f5969cb85879 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -2920,6 +2921,13 @@ extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end); /* Free the reserved page into the buddy system, so it gets managed. */ static inline void free_reserved_page(struct page *page) { + union codetag_ref *ref; + + ref = get_page_tag_ref(page); + if (ref) { + set_codetag_empty(ref); + put_page_tag_ref(ref); + } ClearPageReserved(page); init_page_count(page); __free_page(page); -- 2.40.1.495.gc816e09b53d-goog