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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0565CC433DB for ; Fri, 5 Mar 2021 01:31:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6490B64E6B for ; Fri, 5 Mar 2021 01:31:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6490B64E6B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D09296B0005; Thu, 4 Mar 2021 20:31:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C91686B0007; Thu, 4 Mar 2021 20:31:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0C676B0008; Thu, 4 Mar 2021 20:31:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id 909016B0005 for ; Thu, 4 Mar 2021 20:31:40 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 58B7A3645 for ; Fri, 5 Mar 2021 01:31:40 +0000 (UTC) X-FDA: 77884093560.01.BF8C5BF Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf16.hostedemail.com (Postfix) with ESMTP id 95E2680192D8 for ; Fri, 5 Mar 2021 01:31:39 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9966D6500D; Fri, 5 Mar 2021 01:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1614907894; bh=TVVHEOGdTssyL6W7mFsjyWsrBlLds9RsYXTrSkzq1MQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lFKVIahp6sdscK6IX/YgKYxBNui1HmTR6eJLBDBGaUV9QxAvi0H+gUeQ0SQSSqlWa u4R7Y3LdaXzTNkdArTyMO9+RJOXkypXQCA/S4Kp+kWT19YDSEe/7elMyaIOQA0TbfM d+EbARdgXmccivmLoVT8aV8GVikR+4mWaV1l5AjY= Date: Thu, 4 Mar 2021 17:31:32 -0800 From: Andrew Morton To: Alexander Potapenko Cc: Dmitriy Vyukov , Andrey Konovalov , Jann Horn , LKML , Linux Memory Management List , kasan-dev , Marco Elver Subject: Re: [PATCH mm] kfence, slab: fix cache_alloc_debugcheck_after() for bulk allocations Message-Id: <20210304173132.6696eb2a357edf835a5033ee@linux-foundation.org> In-Reply-To: References: <20210304205256.2162309-1-elver@google.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 95E2680192D8 X-Stat-Signature: 6hbck6mydhf73ckbynws6fq3gapyg9na Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614907899-933430 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, 4 Mar 2021 22:05:48 +0100 Alexander Potapenko wrote: > On Thu, Mar 4, 2021 at 9:53 PM Marco Elver wrote: > > > > cache_alloc_debugcheck_after() performs checks on an object, including > > adjusting the returned pointer. None of this should apply to KFENCE > > objects. While for non-bulk allocations, the checks are skipped when we > > allocate via KFENCE, for bulk allocations cache_alloc_debugcheck_after() > > is called via cache_alloc_debugcheck_after_bulk(). > > @Andrew, is this code used by anyone? > As far as I understand, it cannot be enabled by any config option, so > nobody really tests it. > If it is still needed, shall we promote #if DEBUGs in slab.c to a > separate config option, or maybe this code can be safely removed? It's all used: #ifdef CONFIG_DEBUG_SLAB #define DEBUG 1 #define STATS 1 #define FORCED_DEBUG 1 #else #define DEBUG 0 #define STATS 0 #define FORCED_DEBUG 0 #endif