From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 E402430ACFB for ; Wed, 18 Mar 2026 19:34:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773862476; cv=none; b=cnix+GE0rX0ser37el2389sKalWfQ9SrxdeS5EJitNzi0H1zWT9NYLx8ZDVPDEvQVKWGhUCTxTwyWhtkwOi5+Z+ejAFyQMiNtZY/cmo2ejR+pMT8tyTcFG/VWDpV5lwHhqRH+RHXWx7ZuwOwEPpOwToHDcia/T5qp+bo5XUY/fs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773862476; c=relaxed/simple; bh=MqWL2DkNzh6t3RCkF41zRK5+UfAflLs6WzL7dg49Zws=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CNE6SEJ4hJLT/xgfXvZVhNUDqFEWOzJSJDSz2NaX6PkP+jWaEPSR/ywqjPXHtr3HQjuX9pSTQ+KyTnE35GLEGG7Vju6qZjHkpdnZzQiK4ZfVLoqh/UjNND4+0DoOO7GYww4yXIBF8XbWQER0jyMws+nHPlwaY+9ukZazMoaa5Ok= 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=MRdNfqer; arc=none smtp.client-ip=91.218.175.183 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="MRdNfqer" Date: Wed, 18 Mar 2026 12:34:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1773862472; 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=Y49aj7IZjy3x/shxvuF3SJ1bFf/kbOhQ+X5g3vtgMYg=; b=MRdNfqerzaUUlyh1c7K60Zq8CwKbm6z/BS9uwdFGo+9qce721SHiqLDHMRG5J6cb625vuR KwTjoUeY7SPaKn1detVgnaS/YL0EFomz72Pi2sG9h4CRAbLCGi9Gj3THprZQp2RLKuc8sB OrZx1qH523VpgiKnLnYeR1NtHMwmdmU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Johannes Weiner Cc: Andrew Morton , David Hildenbrand , Yosry Ahmed , Zi Yan , "Liam R. Howlett" , Usama Arif , Kiryl Shutsemau , Dave Chinner , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/7] mm: list_lru: lock_list_lru_of_memcg() cannot return NULL if !skip_empty Message-ID: References: <20260312205321.638053-1-hannes@cmpxchg.org> <20260312205321.638053-2-hannes@cmpxchg.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: X-Migadu-Flow: FLOW_OUT On Wed, Mar 18, 2026 at 03:25:29PM -0400, Johannes Weiner wrote: > On Wed, Mar 18, 2026 at 10:56:55AM -0700, Shakeel Butt wrote: > > On Thu, Mar 12, 2026 at 04:51:49PM -0400, Johannes Weiner wrote: > > > skip_empty is only for the shrinker to abort and skip a list that's > > > empty or whose cgroup is being deleted. > > > > > > For list additions and deletions, the cgroup hierarchy is walked > > > upwards until a valid list_lru head is found, or it will fall back to > > > the node list. Acquiring the lock won't fail. Remove the NULL checks > > > in those callers. > > > > > > Signed-off-by: Johannes Weiner > > > --- > > > > What do you think about squashing the following into this patch? > > > > From bd56ea4505f792e00079b1a8dd98cb6f7a5e7215 Mon Sep 17 00:00:00 2001 > > From: Shakeel Butt > > Date: Wed, 18 Mar 2026 10:43:53 -0700 > > Subject: [PATCH] list_lru: cleanup > > > > Signed-off-by: Shakeel Butt > > Thanks for taking a look! > > There is some overlap and conflict between your delta and what later > patches in the series do. > > AFAICS, the main thing left over would be: to have > __lock_list_lru_of_memcg() for the reclaimer (which does not walk the > parents during a cgroup deletion race) and lock_list_lru_of_memcg() > which does. Thereby eliminating the @skip_empty bool. Yeah, I saw your discussion with David and thought on how can we further reduce the params. > The downside > would be to have another level in the lock function stack which is > duplicated for CONFIG_MEMCG and !CONFIG_MEMCG, and the !CONFIG_MEMCG > versions are identical. > > I'm not sure that's worth it? I am fine with whatever route you take. I know you have next version ready to send, I will review the remaining patches for the next version (though I have taken a look on the current series but will add my tags for the next one :P).