Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1453138lqd; Thu, 25 Apr 2024 16:49:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBvLBDKM9ALvgkG8HgShzfANS59WGWT3Vx5zMWMHL2ycIskvot7P6npfn/10BTxgJ9iXu8ArNrxRTugfjaqQ8vAP3lfiRRlk93gs8U1A== X-Google-Smtp-Source: AGHT+IHMYVyHxbwL9hd3nVAhEKATyxEWroV/G4o5hhqiwcAuLDvqybuXiH7/CJBnTcC1QvZfZeSE X-Received: by 2002:a05:6870:a40f:b0:23a:52c0:cc77 with SMTP id m15-20020a056870a40f00b0023a52c0cc77mr936639oal.11.1714088972115; Thu, 25 Apr 2024 16:49:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714088972; cv=pass; d=google.com; s=arc-20160816; b=tVUX9w0CwG/1X8bgyUIL1qHHS8YWbyFcerEAKLhNaCOhdGC/atLwX+92C23TGOra8v veQYvpNKDw2G/robJfUX9u8v3IWNTYB1bu0UmujH2ZmyEyUZ3rmxAhBcnZnjWqcXG4bV iH7mu5bTSBFwmgcTbNN5Bx5OR5tlfTS8uOf+RYTVpQN76lJEW+b3BhYxYH7Gw92RJ7Wb OnnP0k/h0y1bswQXeiKO+9mIo2OTPK192JXOQ+r7cS84kp8yMON3Tm5kU4ilHc/Tkr8s YEbrAWMg1A7wlWuClEYwQXb3ENLZ9BC8FV0rhwIh7xQA1DsdUutlFoYVKCZEENUdxrZC +FeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=qbiJi1CBK7vilE4zwZEF5H8sVx43LgiKbqOxdhCgoIk=; fh=WhIqekoeHugXyCapFw8dS194rOtWVvfLWIObvfYBfyE=; b=sZL9FDuo1o7DszXe1whgQdh5zfTk40XPWghS6bYEWaSRbHH1ULOdLQxQYVvhZB0sJE HuI7XtcZwGFgNuBKOvAsqDeABOX2sAuTtEQ3eG67dwY6uxL4K4mR8pOy+4McXJYZ0md5 jzuEHS02TuWkqsNBRtfiqDFNmsqc9U1b9DwJbisRCrvMHSzb29S/K2Pcxj1qKjWCrC63 FaPS7X7XDC24DIR7SsghmMGMXMdYHv/Y7mJna4dxgdW54F6EhN4hThTUnhRX7DSF5ju0 eD8dzRthCY7SrYD6CKHWiNdcfXE+WDkdAoGUgzF0U5GoxeLJTY66vRJV7scRjIGlt0uw A5Hw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=eKTJZctI; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-159370-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159370-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id kp22-20020a056a00465600b006ecf9659194si14468883pfb.393.2024.04.25.16.49.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 16:49:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159370-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=eKTJZctI; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-159370-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159370-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CB35EB21460 for ; Thu, 25 Apr 2024 23:49:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 575D0156992; Thu, 25 Apr 2024 23:49:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="eKTJZctI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6FE4E14E2EF; Thu, 25 Apr 2024 23:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714088959; cv=none; b=pd0segRU15R1sGugpITR15DlyJP8GH7cGHqK+aVtA2UON0iS9s9WQPFcRliI1Thy8W56qNXqIvhi34MRiH359kFkVpTPZDepPF+QeUabeLtpL0RbqkqvheTQVF9il9yOr0gjnZine4CpxXzSgX6r70stiMCKBRka5oK+XJF+VrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714088959; c=relaxed/simple; bh=xThSuDa7B7/IrHBAvCAlq+cuUm1QUymQXFLtZ01/yBY=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=WcbUF4XJ0jpyaWvwliutNzGGm72U5enGEp0KWvk3nDV6WMf6O7FWpX995iqooaMNAbBC9NRBMau5KETgwi7k7ShOqU8XMNYYqafy8GulmOx2K8Otu+s2GxJb0hfZ/zY0G57Onzu2t8zLI9BhyN8HsB3qS85EqwyttC02kTW+who= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=eKTJZctI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DB97C113CC; Thu, 25 Apr 2024 23:49:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1714088958; bh=xThSuDa7B7/IrHBAvCAlq+cuUm1QUymQXFLtZ01/yBY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eKTJZctIgAnNhEvYPY2857R1t3FtNk6ED3TJMxHDTM4ggwp1v4bCx0sn76PwQ1tM6 a57YFhEymsUHaJEpgUqPEhS82jzBH4j1KLB5q2RRj2NtNf42wkSRgJI4tDt+9jXfhR 6T1kjJKoagm96u759c62opUlD5ELcHmMgxoTiv04= Date: Thu, 25 Apr 2024 16:49:17 -0700 From: Andrew Morton To: Suren Baghdasaryan Cc: Kent Overstreet , 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: <20240425164917.8c9603387b4cce11121024a8@linux-foundation.org> In-Reply-To: References: <20240425205516.work.220-kees@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit 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?