From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED2E4606A325 for ; Tue, 1 Dec 2026 18:15:52 +0000 (UTC) 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 Received: by kanga.kvack.org (Postfix) id 8FD756B064A; Tue, 1 Dec 2026 13:15:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8871C6B068D; Tue, 1 Dec 2026 13:15:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C5E56B068E; Tue, 1 Dec 2026 13:15:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 532036B064A for ; Tue, 1 Dec 2026 13:15:51 -0500 (EST) Received: from smtpin24.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D354580F47 for ; Tue, 1 Dec 2026 18:15:50 +0000 (UTC) X-FDA: 85496217660.24.41E1D61 Received: from mta0.migadu.com (out-10.mta0.migadu.com [91.218.175.10]) by imf24.hostedemail.com (Postfix) with ESMTP id 68455180003 for ; Tue, 1 Dec 2026 18:15:48 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=qrjMWfB3; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf24.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.10 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796148949; b=6YAj0mcId7cjNffSXl7uXKPv8/W6Yog27zZIEwD+AbiZys4QVr7dxGiqcsCuytRXOwW4J9 iM+QM22EtqLpAmrTPq+ffMjzfLBpBcOPObPHy2X13FFmsTWMvuSyIwOG+fuQbC0llEscRC 2eBpwduqw7p2KXJpJxyWqoE7fVxTs9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796148949; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lHtYNCTUS2J4CHnj2NRXVTSVvEK1fPg9CzqeQegpKs0=; b=C0HjvDDCCpMXCjdRufHfOVBMiiBBeFZ1GJBLuWGSgN5zGpMaz/shFHsInIIpJBKiDCsWVK pudoxyzpiGhb3jVkKkvLxwnCmYBI7gSuPDqkKhMLcqGPi1gfPSjmcWTsfVyNsRsgIETHVf iVWLjn3IGzB0Cc/Ye+I6jnkrP/RpCcg= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=qrjMWfB3; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf24.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.10 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev X-Envelope-To: linux-mm@kvack.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: linux-mm@kvack.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-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201095532.6e638bcaea0119ef81c69c54@linux-foundation.org> X-Stat-Signature: iwcqzhkaomjzae3huq9r3ukt7mh584s1 X-Rspamd-Queue-Id: 68455180003 X-Rspam-User: X-Rspamd-Server: rspam05 X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-HE-Tag: 1796148948-446718 X-HE-Meta: U2FsdGVkX1++tLlbE0n0sUJdtI8iwQuByk5UhWpP0d1D82JOIzKwsjb7r8IyGtaH3dokqrceRY7PTnhc9zgukALTjOpi05qne6NOJSfGilasrzc+R/Qwp5R6RFzCcoEpWO28xKqox8TEKIBKxf4ya1GtbjsZqr5furnLD0RKsOtITS4Mlp34je1yPa7/LNVpImrZ3iijo0UXqbIIAlTytIydIdRIQo/N38+YyHpMI3GNDw+NDKE3T4IPhxp9ib5fbk5Y3Rsdc44+1LE5IBALPJuQc0yGfC5JrnXT2t/CgCFB1mD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HdIeHESHh0PywUbTTmCGETBqsoFb1nvsmsG+f7OEv97uArqdHas4D0EPT9MiIiVxP+1Y77FtpVi7olhvu2uW6qKwXBEzv/hDdWKfx7dr59+fp8e3KeKJVjNqnC9M7eF5Ogt+w== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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