From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FE61472067 for ; Fri, 9 Oct 2026 07:07:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791529666; cv=none; b=t/V0xoACtQwPWp6aEXyXSTNbtgwItxANQlL6OV2k4k/mtUeiSxw4SXSvqlJLVqy4XHAxCxxELMnBHlsLKqOGMV9P5+hcv+OlsKrc9hvFUgzOv/Qkyc71mxz3zg3Rdr0JO3E0ZtdsNa1U/o2Ov2wsuELVqzzJ4y+STb6BgtFUn34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791529666; c=relaxed/simple; bh=AOBfyMObxsPKe5555MA7X0XhuhbKoT8tcSGCgf4g340=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jj4bNZkS6kplieStn1vq53ZmDSBgXqcFD/uKoEj7BMGPPvOrZUSLKHqS4pGbwwCyS6pjdgdx7C5ZaKXxR1rQdpGJFoOvrS8tCEjed/zO3dLc5lA9POdj2rHKmJKqdGbx4j5+GVXPFAhI/vrxnVD/QshMU2N+WhytZYeMxTy4qhI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B0FazBUM; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B0FazBUM" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4998b5a63e2so58986535e9.1 for ; Fri, 09 Oct 2026 00:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791529663; x=1792134463; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=sKKm9SmEIl/bnNoeHMWb5gysBaP9kkRYpBJirexaJDo=; b=B0FazBUMi25Nrrx2P3zFQv2Ew0+HrurV02ZxT0ILniaokSjQwT9spny6pLPlp1arCQ 1nAdmH3V1brYpLPo7/AztGbTYqYoJJgWo98R3F97yxJ4sq8ZBEGYHgri/atjcF2d6pkI jbLcBH9o3tVEXeAtKs1O/scczwwJxtXZS/4/mls0BYyO8yOsEFwj5Kijs9eJehnAmisA iA+GKPcr1x1HpVpwtgwfz5NeI+GgRU+dMy9ucDUovhkXoMK+uXY4w6cFkRYrzzAzLSUg ca2YmFMruULHowX/r57yL5GemGkCyKceU0f55382ZLGYbx2V3I9+xMDTRJCZAJjnrGlp Q0QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791529663; x=1792134463; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=sKKm9SmEIl/bnNoeHMWb5gysBaP9kkRYpBJirexaJDo=; b=StWFulMa+Tm8Pyr7Uz6XsOZ9jCru2sla+hMo1/IoX4IIZKYNElOAcDw8mrUhz5VxkE T9QoQxvnVAuX2OWdqzE8Uy9o7pUycrrOqpNJ0OOX4TRus2ZGWdjIdRIfuE2LGVy7QCmn MzjIGaxHhKKjBQRz6Rz28NESDW9whMi4JnH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nQK5Y84ilAY6hKLV djIEvECHjXQ== X-Received: by 2002:a05:600c:8708:b0:4a1:7b05:3a6d with SMTP id 5b1f17b1804b1-4a18e49881amr14849175e9.8.1791529663117; Fri, 09 Oct 2026 00:07:43 -0700 (PDT) Received: from unknown748F3CBA5068 (dynamic-2a02-3100-a128-aa01-297a-7094-853e-a20c.310.pool.telefonica.de. [2a02:3100:a128:aa01:297a:7094:853e:a20c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a18bf2caf4sm41656205e9.10.2026.10.09.00.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2026 00:07:42 -0700 (PDT) Date: Fri, 9 Oct 2026 09:07:41 +0200 From: Karl Mehltretter To: Harry Yoo Cc: Vlastimil Babka , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Muchun Song , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Alexei Starovoitov , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Subject: Re: [PATCH 1/2] mm/slub: preserve no-lock freeing after memcg charge failure Message-ID: References: <20261001044056.75079-1-kmehltretter@gmail.com> <20261001044056.75079-2-kmehltretter@gmail.com> Precedence: bulk X-Mailing-List: cgroups@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: On Wed, Oct 07, 2026 at 07:40:17PM +0100, Harry Yoo wrote: > > > > Use kfree_nolock() when the allocation flags disallow spinning. This > > keeps the SLUB object rollback on the no-lock free path. The failed > > allocation continues to return NULL. > > When this happens, the object is not charged by memcg. > > The kernel should not invoke memcg_slab_free_hook() (called by > kfree_nolock()) for a slab object that is not charged by memcg. > Agreed. I'll avoid the memcg free hook on charge abort. One question: kfree_nolock() currently skips init_on_free, while the existing charge-abort path honors it. Was that intentional? I couldn't find it discussed in the introduction threads. If kfree_nolock() should honor init_on_free, I'll include that fix as the first patch in the revised series. The charge-abort fix will then reuse the shared initialization helper. Karl