From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 61CDF1FC0E9 for ; Wed, 5 Feb 2025 18:31:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738780297; cv=none; b=DrDlRdJJ6b1trjR9RLIwqMp4kAz9nD5nm277lRuX9/8IVZI1/tM8uOwu0veECAxiMNISqsPzps3NapZLrr0fYCUcsR2vDomx3YcmkljG80SK4T7MclgfA0bLk9GzIoXBTsKvUSDV7iopCS1uHZqQci87zIykylqZkTfopb8GaRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738780297; c=relaxed/simple; bh=7/5ms4838rUKEwFG5CPvHDuW/r1yn4Xr3avElGtvSAI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kW02QbfHTwAXX7xrKQpNhyN/yWJ40K0YvtocD1nJzKkJeYI/SM9zE8zJAEfDWu5IhCrqpm+NOTOIjhdL4hwm6Miq69V5qzgrXx503yUy+4pFLXXbX5HAugtLnoND6Z8QeLJmujDyQWnfU8Dx76X+FMOFK2G+lHNMeu/BFydRKRA= 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=FrG3Tz5j; arc=none smtp.client-ip=95.215.58.186 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="FrG3Tz5j" Date: Wed, 5 Feb 2025 18:31:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1738780283; 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=cRpIxuobdJIlfnoT0aXnXGySqVxhsDeVlxOEkWcMenE=; b=FrG3Tz5jxfPplMSdfJDAqliNDT/rwj5qayn6aNty0yLNFl10eggjkOv4QxjOkWLTxP8ndU ZNUjrodYYvr5GEGNSvIkR4PIbZLg9CEAo+hQtPfS1FQeXv6IH1ExVqBh/7qdnxwa/TU9wc Qv2acHWk9FkVXpSw8fjOl/6HRm2Imn8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Johannes Weiner Cc: Hamza Mahfooz , linux-mm@kvack.org, Shakeel Butt , Andrew Morton , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Tejun Heo , Michal =?iso-8859-1?Q?Koutn=FD?= , Michal Hocko , Muchun Song , Allen Pais , Yosry Ahmed Subject: Re: A path forward to cleaning up dying cgroups? Message-ID: References: <20250205180842.GC1183495@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: <20250205180842.GC1183495@cmpxchg.org> X-Migadu-Flow: FLOW_OUT On Wed, Feb 05, 2025 at 01:08:42PM -0500, Johannes Weiner wrote: > On Wed, Feb 05, 2025 at 12:50:19PM -0500, Hamza Mahfooz wrote: > > Cc: Shakeel Butt > > > > On 2/5/25 12:48, Hamza Mahfooz wrote: > > > I was just curious as to what the status of the issue described in [1] > > > is. It appears that the last time someone took a stab at it was in [2]. > > If memory serves, the sticking point was whether pages should indeed > be reparented on cgroup death, or whether they could be moved > arbitrarily to other cgroups that are still using them. > > It's a bit unfortunate, because the reparenting patches were tested > and reviewed, and the arbitrary recharging was just an idea that > ttbomk nobody seriously followed up on afterwards. > > We also recently removed the charge moving code from cgroup1, along > with the subtle page access/locking/accounting rules it imposed on the > rest of the MM. I'm doubtful there is much appetite in either camp for > bringing this back. > > So I would still love to see Muchun's patches merged. They fix a > seemingly universally experienced operational issue in memcg, and we > shouldn't hold it up unless somebody actually posts alternative code. > > Thoughts? I don't have a strong opinion here. Reparenting is clearly not perfect, but I agree that we don't have any better solutions, only vague ideas. I believe Muchun's code would require some refresh, but generally is fine to merge. This all comes up to the handling of memory shared between cgroups. Sharing can be spatial (2 or more simultaneously existing cgroups) or temporal (a cgroup is being deleted and recreated, the workload tries to reuse old pages). The reparenting turns temporal sharing into the spacial. It helps with dying cgroups, but comes at the cost of permanently wrong accounting and issues with the memory protection. Thanks!