From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 097C238B7DA for ; Tue, 10 Feb 2026 18:53:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770749604; cv=none; b=AyyPqhPqBP5EblBwvJ03bZUjvxYz8Ta6+krnknL3k+vbA1DoFvtcEe9CZGMhnz2CpPZCnli65oQO92RBv79kevkWwiCz26nNi0IOMRGQZunLlgB9rxI3d/E1Fvn1FJ681+j5M+V8QrU1llbMv76njNhdy2rhelDltq4CRQ06/q4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770749604; c=relaxed/simple; bh=ykjrQDv3pQtbl1gvs1znR3inIiH9de5tevEToQRU/qg=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=YDjpiQ/NU81Ib/NwSKH2NWqycYZRkJ2WTXC76agLI0eCczO6UabIsR8f9epfMf4q7DxW0B9kNyr3xtvzWIXVoaN1IT6RV10Nzma+aRRmW8CU/YP1KdVoGkGiySzxu2XH+UrszQPgjrpeJvyCpffs/Xr01or/HC+Bdm2PvW/EgXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PCLbCuvZ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=jFQMHz2G; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PCLbCuvZ"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="jFQMHz2G" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770749602; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s/eGIcJVf8/JKYHo3YPe7ZsYm/3Cem/DaAGFEvHE21M=; b=PCLbCuvZy3ZqkfydyLaFYUpAMQsiIlbzb+hr0FxH/Z448xtSe1a1yuyfpVRCERpnLGxUqu k0dXkyxLXCNIS5ntAtOL/9+wFC3ZmHyYhUnYobUZm5P/RXOvRQvurzc5O4nLkQwlpjc0qR bmAe+PZ+SaUzgjWLVpMfOTS0IVl2Y68= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-154--SD8JZ_xP3y8F5QVAsJapQ-1; Tue, 10 Feb 2026 13:53:20 -0500 X-MC-Unique: -SD8JZ_xP3y8F5QVAsJapQ-1 X-Mimecast-MFC-AGG-ID: -SD8JZ_xP3y8F5QVAsJapQ_1770749600 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-896f8dde688so33893776d6.0 for ; Tue, 10 Feb 2026 10:53:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770749600; x=1771354400; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:from:to :cc:subject:date:message-id:reply-to; bh=s/eGIcJVf8/JKYHo3YPe7ZsYm/3Cem/DaAGFEvHE21M=; b=jFQMHz2GUrsjBuK1ipUhybqZs6rCwpdqdhteoUOqJKQ8B2Eq0hXcmG6jab1RQ7iPKr bnwoKyvCyzsBWk3s/t30mCMvI97S04BVCn7eQGEIhbqckqxU/pOTXcCZLiJme8qKO4VX GC2YxHFvOJGoK6jWzg2Qn87wqkDosMT1B/XhnWpeD4e+BTAgNxxpIXeQffOIGGw2WdwA CPy06gGNFm23eNEyZmEodOa6M79uNupWQjGpKoc8bkYW2bzOr1e9HYstz7IA+oH4bU80 Wavvulgt7BUIp1uzSKLJSvNgUNXpvtaKEp9TYsaGb9qJj4NS+ZJyh6exDYwH+Qv87fZ8 Gzag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770749600; x=1771354400; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s/eGIcJVf8/JKYHo3YPe7ZsYm/3Cem/DaAGFEvHE21M=; b=MX9k6U8ERLxsmUQhbTi1WAHI2FAXK1/P20mOsNwLAowxMdnhBPi/tY/uvJmo7XjzTQ 8j+o05dLsEVGUve23fCNV/i6l9iauik7wkmZNIRB9oR4X4wr/OoJymulxAJEKGuAEZp6 BcBxnQBQj19u6WZihoUT0ApYJ0Nc/8hQkChCG+goWy4b4FHZnCQnlrB7u8JsC9E5S7yL qm9g7XCV20kUbb4/MXojnZYv0pKsR7vsT7IOJTnUykLHJ1AcZzY5p5lDVtUx2O5i2gT1 bYQvJyL8+DrlAQKxsjKHbtQVKCQNk3n03UELJXdcuVJ3cVNU3ZFb9PZqK/7/mcIb/3yT vo0g== X-Forwarded-Encrypted: i=1; AJvYcCUGkPIsCYFeCpG2n4T24dH0pE+/jKRsQx7+0DYPInTKOgzqt6Z4cG0iIms2zoIFBVwcVqMpNu7lq+kuDG0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywo3mccWr0fD4/BnVWsaH55ucjtGoRJyp28YhUeiziVByLGR78+ osRDRpcRD9EkwnV0V952SpVOL98Z/UwldC3Hc3HMoGuQMyUNJJN3+txRXTIj0EO/kGvwTkmMFD5 wRqIGxUWFyHDoDEHxUTBNM1fdx97FnAm4av89bGFzinJb3ktsy/+nInsN+iDEE/WmPA== X-Gm-Gg: AZuq6aIIuLidKSwaWObZN7XsjZ6lIoYihNeqUmZOxZ7pSRipuQmxYleq10b1WUYzfen jB3d7+0vJIEyRHIhW3eQbF+EymsRpJghxsjx7MIoJEdIf7VAKgnD1O7up28hCAB04zxiyiE8epW 6Z4bC32g/v5mRGskh2eZEjkOPCz+QQpXkHHehW767CssLCCzsydBVOZ0kaTRPLGVSEerh982ZeE GCxFr987uaf/7vXtO4zUZNKgC0s7VY7SVW4cI0jG08u85EBG0jo7S7G2ZYhWckA1Ld51v2hmqWK JZYqKy2lX5Hwg1cFYnRlNWHRGt++GgmbPHMhYjygpo42MWd0rw5hCQQ4QYjeku6A3T7SKc+wFjE agbnI6fVimZjclUT9ZF640c3lJm3FaBMZxJz1/5ew6P8xLridH9yliVzL6ImHpOmR9Cgy X-Received: by 2002:a05:620a:bc2:b0:8b2:e922:5297 with SMTP id af79cd13be357-8caf0489e71mr2229209185a.21.1770749600115; Tue, 10 Feb 2026 10:53:20 -0800 (PST) X-Received: by 2002:a05:620a:bc2:b0:8b2:e922:5297 with SMTP id af79cd13be357-8caf0489e71mr2229204685a.21.1770749599658; Tue, 10 Feb 2026 10:53:19 -0800 (PST) Received: from ?IPV6:2601:188:c102:b180:1f8b:71d0:77b1:1f6e? ([2601:188:c102:b180:1f8b:71d0:77b1:1f6e]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8caf7aefb75sm1088129685a.22.2026.02.10.10.53.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Feb 2026 10:53:19 -0800 (PST) From: Waiman Long X-Google-Original-From: Waiman Long Message-ID: <2f4abe26-19f9-4550-ac0e-16c41d18c7fb@redhat.com> Date: Tue, 10 Feb 2026 13:53:17 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH/for-next v4 2/4] cgroup/cpuset: Defer housekeeping_update() calls from CPU hotplug to workqueue To: Frederic Weisbecker , Waiman Long Cc: Chen Ridong , Tejun Heo , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Anna-Maria Behnsen , Thomas Gleixner , Shuah Khan , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260206203712.1989610-1-longman@redhat.com> <20260206203712.1989610-3-longman@redhat.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/10/26 10:46 AM, Frederic Weisbecker wrote: > Le Sat, Feb 07, 2026 at 09:00:45PM -0500, Waiman Long a écrit : >> On 2/6/26 5:28 PM, Frederic Weisbecker wrote: >>> Le Fri, Feb 06, 2026 at 03:37:10PM -0500, Waiman Long a écrit : >>>> The update_isolation_cpumasks() function can be called either directly >>>> from regular cpuset control file write with cpuset_full_lock() called >>>> or via the CPU hotplug path with cpus_write_lock and cpuset_mutex held. >>>> >>>> As we are going to enable dynamic update to the nozh_full housekeeping >>>> cpumask (HK_TYPE_KERNEL_NOISE) soon with the help of CPU hotplug, >>>> allowing the CPU hotplug path to call into housekeeping_update() directly >>>> from update_isolation_cpumasks() will likely cause deadlock. So we >>> Why do we need to call housekeeping_update() from hotplug? I would >>> expect it to be called only when cpuset control file are written since >>> housekeeping cpumask don't deal with online CPUs but with possible >>> CPUs. >> It needs to call housekeeping_update() only in the special case where there >> is only one active CPU in an isolated partition and that CPU goes offline. >> In this case, the partition becomes disabled that causes change in the >> isolated CPUs. I know this special case shouldn't happen in real world, but >> I do have test case to test that. > But why is that needed? This isn't changing the mask of domain isolated CPUs. > Only their onlineness. I mean timers, workqueue, kthreads all have their > hotplug callbacks able to deal with that already. The current behavior is to remove the CPUs from the cpuset.cpus.isolated when an isolated partition is invalidated. It doesn't currently differentiate if that is from hotplug or by writing to the cpuset control files. I am planning to handle handle hotplug differently so that it won't need to change cpuset.cpus.isolated. > >> Theoretically, we can add code to handle this special case to keep this >> offline isolated CPU in a special pool without changing isolated_cpus and >> hence  HK_TYPE_DOMAIN cpumask. In this way, we shouldn't need to call >> housekeeping_update() from CPU hotplug. I will probably do that as CPU >> hotplug will be used when we make HK_TYPE_KERNEL_NOISE cpumask dynamic in >> the near future. > That doesn't look necessary. Yes, I think we can use the existing infrastructure to handle it without the need to add a special pool. Cheers, Longman