From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.9 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796148950; b=hEY1KdghZl9MqytwrrN3YhRs7KGkSMtr028JDU2hl8daAraiyveu+2IvQMMj8QPpjgD+ yB1O8C7nirkBa3By1vS53ArjKOFyGw33R9BZ2En5rkwyhbd3WLUztxXGuXLSLXJ5KerYo y6/hj9nroxvxUvsx0WbZ59WwjfylHQcabhqzSIn/agtb4guiY2LC5pRxnm95xfnaIxAkv LyupbRRsgiPfSYuOzGnmABVIOxHJG7h9sXN8XRsLfTAVGstm+6DdzZMMkDhYROoMI8+DV 2TMpZyOrmyx71UJOOHh56YoQloPOJzcJFXQLFHoGRx5OrDt5YGEHzAu64biGIQRGmwQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796148950; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=lHtYNCTUS2J4CHnj2NRXVTSVvEK1fPg9CzqeQegpKs0=; b=gdW6a5Rkwp2SKQR6NXNSqAV1vdPtL1cE5Ec0t4wjKFMiDptmrqh3EfIHfA1c/pORInCQ QJssSThr15Iygfj1B3zHBSUx/zUxyOW1gfwoR02xc5omG7wwGFppAHt+gr84aIXiiofBo LusmxKHbUvuZyi//x89oPb7XdE7TyxG+ws+DSK0rtgJ9c+MVaJ5oU9BVCYa26j1t/WQQg sxpurBRxkc8xoxeypdyMeHeO4emL+5VNjyPSYoYcUpTqsK2aZyO3jrUCU3Esfy1getRiB NFd3gmR08iGvHtj0ndpRBx5dnqwokGtLKX/6gaOnbPhWgzKOWAQuiXb+r0M2sgIWTUw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=qrjMWfB3; arc=none smtp.remote-ip=91.218.175.9 Received: from mta0.migadu.com (out-9.mta0.migadu.com [91.218.175.9]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA963606A322 for ; Tue, 1 Dec 2026 18:15:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BA963606A322 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, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=qrjMWfB3 X-Envelope-To: cgroups@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=UE04Q5y8Aq2YNjJhilWowghrEfQtafFUWv4rEYZNORI=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796148946; v=1; x=1796753746; b=qrjMWfB3gVhm1ZlPW9ktoHtjHW0ku0JLx9wkoQJSIfWmr4dtASGs1nC/XbPkN3s33ZjNKC4s hhhV5u+U8+kvx8OToHrPbjWNT7V0hDwwZ4GbOXP3fuI8cmIudsdjotPTGqwk5YuptP9a5WRTjEc OGkOo96U4GnnuM6vzJ3FDb0c= X-Envelope-To: cgroups@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 24ff2f2decf247a7; Tue, 01 Dec 2026 18:15:46 +0000 X-Mizu-Trace-ID: 24ff2f2decf247a7 X-Migadu-Flow: FLOW_OUT Date: Tue, 1 Dec 2026 10:15:45 -0800 From: Shakeel Butt To: Andrew Morton Cc: Tejun Heo , Johannes Weiner , Michal Koutny , Michal Hocko , Roman Gushchin , Christian Brauner , Oleg Nesterov , Sebastian Andrzej Siewior , Suren Baghdasaryan , "T . J . Mercier" , Usama Arif , Meta kernel team , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 00/11] cgroup: don't hold cgroup_mutex for cgroup.kill and cgroup.freeze Message-ID: References: <20261130173425.4117363-1-shakeel.butt@linux.dev> <20261201095532.6e638bcaea0119ef81c69c54@linux-foundation.org> X-Mailing-List: cgroups@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201095532.6e638bcaea0119ef81c69c54@linux-foundation.org> On Tue, Dec 01, 2026 at 09:55:32AM -0800, Andrew Morton wrote: > On Mon, 30 Nov 2026 09:34:14 -0800 Shakeel Butt wrote: > > > cgroup.kill and cgroup.freeze take cgroup_mutex and hold it while they > > walk every task of the subtree. cgroup.kill is how userspace OOM > > killers, service managers and container runtimes stop a workload, often > > when the system is already under pressure. Waiting for cgroup_mutex > > makes the kill as slow as the slowest cgroup operation on the machine. > > I gave this series a fairly thorough workout on my LLM-driven live > kernel test setup. > > I told it "if you hit a bug, fix it and keep going". It seems to have > found four issues, fixed them and then everything worked OK. Its fixes > sped a few things up nicely. I'll send those 4 patches in reply to the > patches which they patch. > Thanks a lot for the testing and the fixes. Three of the four fixes match changes I already have for v3, after the sashiko review of v1: - the NULL check in the nonleaf freezer selftest (7/11); - EBUSY for a switch to threaded while a kill of the cgroup, or of a cgroup below it, is running (10/11); - refusing cgroup.kill below a threaded cgroup (10/11). Mainline has this bug too, so v3 also adds it as a separate fix for stable. Skipping empty branches in the task pass of the freeze walk (11/11) is new to me, and the numbers look good. I'll fold it into the freeze patch with your Co-developed-by and Signed-off-by, if that's OK with you. v3 will also fix two more issues that sashiko found in v2. The fork path decides whether its SIGKILL is forced from the parent instead of the cgroup.kill writer, and the task pass of the freeze walk can visit a cgroup that was created below a subtree it skipped. The populated freeze rows are a bit slower. The freeze walk now takes css_set_lock for each task to check which cgroup it is in, and I'll look at whether that can be avoided. With v3, the four fix patches won't be needed on top. Thanks, Shakeel