Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1465139lqd; Thu, 25 Apr 2024 17:19:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkCPM0ymYDbQkVxQsmtpfm7Oa3uMzXW6xTuSTv9Z5GVsKBxIs3M0UggyBQ12vxwESb7xdjgUZIlVvO87iEc7T/MkCf7HS/wuTixBhgsA== X-Google-Smtp-Source: AGHT+IHA2Xupa+ieLwRLWFcCblOw7m0Y5VwVpPIm1JCtWA5XKLrbpiGflwLHQyMQ35jBQGbJpUtM X-Received: by 2002:ac8:7d82:0:b0:436:6593:e680 with SMTP id c2-20020ac87d82000000b004366593e680mr1485162qtd.38.1714090772748; Thu, 25 Apr 2024 17:19:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714090772; cv=pass; d=google.com; s=arc-20160816; b=Rz0N74TzsT7cMFd/ifnpdUS85mjEF9W6kqYaAFB1HHHxQKLmlUNVvmb3HqMyOfkxfM 6etIhoS5ZjIoVKVrGzOpgcDHG524WiXpxCslBEJH5nTli+msxPj0Hsz0NQzrR3uSR3ay TcyBvIEmw7wvXnh2C9mIQQfYH0fS9fPXu/cQK1Z0JXyuaxMbqejn1tz7dS4wgE2NIVjR v7gKrp90cVJfe8SRMJImk8Z1pcrnjxgqa3gwz9Q/nyCm5BKCoSPWfCZ0cCcCPaL5OIvZ WQc5dAy/I+b5kEMmrgqGUqjC1EP60AJGaw1QezR4ZzekSRVIAIV+HqTCIMb1vm2mrjUF 5XEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=iiDAAU9IAxaCzWX8x+M+Xfi0SfQX0lRBqlfJeEKcIHM=; fh=Tyb3g0ob14xCeOC2PHPlLpeAQNDERA7gWVZ73qO8V6w=; b=QoSC5HScRl/ptPoqgbyQwXdoQNC/I7So1LtRlSdGchfa3eBK/JFLRDd7qKZ5wX8hRW S9b4Yjzu35jyqN9Qvox32OwEdQqrFDd0EjtAw1vRnbRx+7iI+byeVGP01LN++RRuBPTa 8UXWB1lECwpZt6f0e5Z4wGw7uDAVLNiQ+vyjzJub9/HsOYI5Mz0nIt8BhGb52v8zY28r 51izE2cL8s1F02KVTQzKE6Yo4D5nRvABU2i9zgVqpBsBLtRM4fUhh9s8tP0VCy+3S5JO NG8xrcJrVTAw4lfWpzgPpnTZ3QT5Xtd8yYQlX35JtHgiac4/Tgjpfcx8OvBCyVKSKI34 c7yQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=eGmBUanR; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-159381-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159381-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ci16-20020a05622a261000b00437bbae16absi19077684qtb.405.2024.04.25.17.19.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 17:19:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159381-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=eGmBUanR; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-159381-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159381-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 792041C20E98 for ; Fri, 26 Apr 2024 00:19:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 258361860; Fri, 26 Apr 2024 00:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="eGmBUanR" Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1D7E184D for ; Fri, 26 Apr 2024 00:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714090766; cv=none; b=KSBRc4n1o3vipet+nk+BoP8Qf9A+bNK3v5MOoMUyGnhNnUWLMV+9EaT4T0BcHqN4fXItSCdVTX8BXirUWUAM82RQuNtWi/e9FaqCYobxBKkl8Ta6p63BcMFyWcc8qkoj8JOVTtJpmA/k/1TM8K7h6SY/ALf1Sbtr0/8gG/3emMo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714090766; c=relaxed/simple; bh=lpFw9Tuezlw7TiZh8cPbb/MJFtFxTaytrUCYtOu7NNk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lJuZHhdj2StmPguPZJpUj7/QoV5o8rfZ67HPA5mof4imn0jRXUWOL7SFM1G4FbLo8r6WHZU35HyIqan31uSakUgSVGDyDwenH8lhUMBNChYduT6wjPzwlx0Ed4meVzVCbS+Tl7CcP/PdOHOJfqdDXUswzubH9Mu5GDLxzvH4Mtk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=eGmBUanR; arc=none smtp.client-ip=95.215.58.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Thu, 25 Apr 2024 20:19:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714090761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iiDAAU9IAxaCzWX8x+M+Xfi0SfQX0lRBqlfJeEKcIHM=; b=eGmBUanRBVu9815GoHdTQzhhKjtSIv7vsZocN0F2fjdwhao6XUsWARO7DUVb6l/vLmgho0 dTFzMuJmCtFMNOvy9aX5WReuYxeInKldHxRcCDCCw7UfeQZkBXa8Ka37yk3Ua9ve01Hdup 7QXmk4RSshVM8ZfnPC9hkf4YvSuqH7I= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Andrew Morton Cc: Suren Baghdasaryan , Kees Cook , Catalin Marinas , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] mm/slub: Avoid recursive loop with kmemleak Message-ID: References: <20240425205516.work.220-kees@kernel.org> <20240425164917.8c9603387b4cce11121024a8@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240425164917.8c9603387b4cce11121024a8@linux-foundation.org> X-Migadu-Flow: FLOW_OUT On Thu, Apr 25, 2024 at 04:49:17PM -0700, Andrew Morton wrote: > On Thu, 25 Apr 2024 14:30:55 -0700 Suren Baghdasaryan wrote: > > > > > --- a/mm/kmemleak.c > > > > +++ b/mm/kmemleak.c > > > > @@ -463,7 +463,7 @@ static struct kmemleak_object *mem_pool_alloc(gfp_t gfp) > > > > > > > > /* try the slab allocator first */ > > > > if (object_cache) { > > > > - object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp)); > > > > + object = kmem_cache_alloc_noprof(object_cache, gfp_kmemleak_mask(gfp)); > > > > > > What do these get accounted to, or does this now pop a warning with > > > CONFIG_MEM_ALLOC_PROFILING_DEBUG? > > > > Thanks for the fix, Kees! > > I'll look into this recursion more closely to see if there is a better > > way to break it. As a stopgap measure seems ok to me. I also think > > it's unlikely that one would use both tracking mechanisms on the same > > system. > > I'd really like to start building mm-stable without having to route > around memprofiling. How about I include Kees's patch in that for now? Agreed