From mboxrd@z Thu Jan 1 00:00:00 1970 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 099A2C433EF for ; Thu, 23 Jun 2022 12:06:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2106E8E0148; Thu, 23 Jun 2022 08:06:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18F8C8E0144; Thu, 23 Jun 2022 08:06:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 030DC8E0148; Thu, 23 Jun 2022 08:06:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E24548E0144 for ; Thu, 23 Jun 2022 08:06:00 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B48BF34AD9 for ; Thu, 23 Jun 2022 12:06:00 +0000 (UTC) X-FDA: 79609372080.09.5A435BD Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by imf30.hostedemail.com (Postfix) with ESMTP id 035B1800B2 for ; Thu, 23 Jun 2022 12:05:59 +0000 (UTC) Received: by mail-yb1-f179.google.com with SMTP id n144so31363356ybf.12 for ; Thu, 23 Jun 2022 05:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ACxXBxS9wLm3s0o360W5tadVCtNgAfMCjbW4/7oTcA4=; b=SQAHvCcWiZPW2d3TCyD1ucF5/vuJJlyPVHSS/EBGdmL8eX5SUfz3/Ks10JcOSDF4FX 6NM2LxV3aGPxbmKFW6CymAyrqLU04WuWmUf2W35juuB5SYN+qyur+64ek1GkZNdOxCws tTjaOk+a96XPGBxGCBD5TPY35OoLL5ZfevMzMdl7MTdY4Lju9vHRIWrmkL9wOONsxjX1 O/asGkoOSqI99F3ZdcWFu2tF4TQnWuBOhwiu1f+nogWCWs7sx7Xb7ixvQeYV05cPLDTG vGEWDE0n6iE6LBdtk56t/E4aRGQdXA2peo3o93/9OM1CH/Qznz+D7SbjboU23TZ3IHe3 YhOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ACxXBxS9wLm3s0o360W5tadVCtNgAfMCjbW4/7oTcA4=; b=X6FyeWi6E1rrw4bVYQ3wVsUNQcOwd+A3aYE9FW0Dpv3wcejtOWgUDpurZN0MeGwvLx JCaZdgBSp9OEMAgziugLLX3kNjGwr2W71w8tg5lYEJ3Ey350Hq1pixNNSMcFHFsVBpu1 Ac6XC6N4sFp3LgtM1vIS+0Ym+fLZsb1PW/WLOfAaFPQl6jymVrL6jt0ZF9mInA0LkKjX GbLhCekHos7FoAF4/hyyPO1ZkqhlPud5HJTOy67sAuC2Fcf5XqSGNGuoInDRLsD5Rm8E 0DqCKiY1PY7ApNOJUOokH7jH+UFvwmCZkwOEmvqPI2Jb4fYvG6vd78RUvEmdNgcnyLJ6 WH/A== X-Gm-Message-State: AJIora8KCmzEbXaUviZK8MCXKIwxIaxiG1gAt1L69cdD8lQB0LGgRU6h //i8GDVxZbQEdwlVj3sqEUbMAql+N/sSevcfxMJhkda+Pws= X-Google-Smtp-Source: AGRyM1so/RVtDJwHhTKgYn+XHelVpXIxpsLsc4tp78gqxCR/ieVCu7jnZAYDuCZ45vtLrLwadNS0nmv5gI6/XxqOHnU= X-Received: by 2002:a81:1591:0:b0:317:bb1f:fb83 with SMTP id 139-20020a811591000000b00317bb1ffb83mr10329151ywv.362.1655985635802; Thu, 23 Jun 2022 05:00:35 -0700 (PDT) MIME-Version: 1.0 References: <20220623111937.6491-1-yee.lee@mediatek.com> <20220623111937.6491-2-yee.lee@mediatek.com> In-Reply-To: <20220623111937.6491-2-yee.lee@mediatek.com> From: Marco Elver Date: Thu, 23 Jun 2022 13:59:59 +0200 Message-ID: Subject: Re: [PATCH 1/1] mm: kfence: skip kmemleak alloc in kfence_pool To: yee.lee@mediatek.com Cc: linux-kernel@vger.kernel.org, Alexander Potapenko , Dmitry Vyukov , Andrew Morton , Matthias Brugger , "open list:KFENCE" , "open list:MEMORY MANAGEMENT" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655985960; a=rsa-sha256; cv=none; b=xo10VGuqAPGGLZwPKVLIoYGt9qoJr0g/nySrg3PbVL/hDZOKfyYcTnqVLaBaKc4BbEG2eM y6CbhuifKOh+11wFvbTOQSo3mQnSUA+eCf562odSQ73CnQC2lGraQIlHBBrn2ktjZ9sXlJ 43CkleaACj5LQK/+WmXXcOB+Pf4nqBY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=SQAHvCcW; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of elver@google.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=elver@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655985960; 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=ACxXBxS9wLm3s0o360W5tadVCtNgAfMCjbW4/7oTcA4=; b=kl4Q6vG8GCPiGDtcknP0rPrSxpLbGgc6ev0Mlz33rr23YxtefBwkb+Yx9sS25moY1PIqIX N3lu+YaQ2gchud1KCdrjkbNO0t2la12Dn0s+56oDzQvodVCBa6bn1HijFZ6Q+F2d1D6J2o qwYbzLl39+ZkyIF4fngjQKaYveRXPFQ= X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 035B1800B2 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=SQAHvCcW; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of elver@google.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=elver@google.com X-Stat-Signature: cjc5qxm8phn5py4okxx3n13kdnrw8ejt X-Rspam-User: X-HE-Tag: 1655985959-34904 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: On Thu, 23 Jun 2022 at 13:20, yee.lee via kasan-dev wrote: > > From: Yee Lee > > Use MEMBLOCK_ALLOC_NOLEAKTRACE to skip kmemleak registration when > the kfence pool is allocated from memblock. And the kmemleak_free > later can be removed too. Is this purely meant to be a cleanup and non-functional change? > Signed-off-by: Yee Lee > > --- > mm/kfence/core.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > > diff --git a/mm/kfence/core.c b/mm/kfence/core.c > index 4e7cd4c8e687..0d33d83f5244 100644 > --- a/mm/kfence/core.c > +++ b/mm/kfence/core.c > @@ -600,14 +600,6 @@ static unsigned long kfence_init_pool(void) > addr += 2 * PAGE_SIZE; > } > > - /* > - * The pool is live and will never be deallocated from this point on. > - * Remove the pool object from the kmemleak object tree, as it would > - * otherwise overlap with allocations returned by kfence_alloc(), which > - * are registered with kmemleak through the slab post-alloc hook. > - */ > - kmemleak_free(__kfence_pool); This appears to only be a non-functional change if the pool is allocated early. If the pool is allocated late using page-alloc, then there'll not be a kmemleak_free() on that memory and we'll have the same problem.