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 A168A3FB060 for ; Mon, 2 Mar 2026 14:15: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=1772460923; cv=none; b=D4gYf6OtQVrS1S0oSY+xXoci8fL4w6EvDOmR1eaJg2Qy5YCHCgmlRBftQYE/flf45E1U0hb/fpcP/UeHIxiuVEOpLurChjqalxB7+0VFRe3iWZESLuTj2XK4rHQvZ9+iWRb/q/BZ8RNzuJQIVzGrxkOQy1ZiPsuExWzMNc7bcbo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772460923; c=relaxed/simple; bh=PO9LFxjHRiXSZV0ZTkBcY+OJzR2dcqixVUYO6d+SoyE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bIML0GZtk8+IohM7JjXwff/xuptEVvHtS+WkWtyk5neUi6gu6l++J4OjJHdaCynxkR9I67OdX8NY6jtZP7V5rG0FsaehDnQaGGCOC8y/FuFaTqoeK9N8HKHfpn8t8bmJI+TOckzUiEVHYMTYX3P+NsNV3NKGZZ5bBhieFYaTwfE= 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=CtR1/196; 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="CtR1/196" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772460921; 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=4PUUY1opl6eDiW1jZM0WQddZV4oH4gcaLepSTLvQvQY=; b=CtR1/196Ns+BIIUSYGlYQhblRZQHo1oCJrDZs7xShZiSzqJFohZY0vf+U4TSv41Wz3wsxR RveWgzYwD9LTFgqWa7+ABgpiuxqLWyQQ2R4LaNedrrBUoPzR1d7EDW5iDk9fAKb3BnzSZm amgNX85nYGQ0OOYudzALZT6BP083lnY= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-428-GXUYZp7WMB23NG-YsYS2RQ-1; Mon, 02 Mar 2026 09:15:18 -0500 X-MC-Unique: GXUYZp7WMB23NG-YsYS2RQ-1 X-Mimecast-MFC-AGG-ID: GXUYZp7WMB23NG-YsYS2RQ_1772460916 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A2EFF19560B9; Mon, 2 Mar 2026 14:15:15 +0000 (UTC) Received: from [10.22.65.79] (unknown [10.22.65.79]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2221A19560A7; Mon, 2 Mar 2026 14:15:12 +0000 (UTC) Message-ID: <69ec4b3c-818b-4784-9b90-1ac5e977ae58@redhat.com> Date: Mon, 2 Mar 2026 09:15:11 -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 v6 8/8] cgroup/cpuset: Call housekeeping_update() without holding cpus_read_lock To: Frederic Weisbecker 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 , Thomas Gleixner , Shuah Khan , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260221185418.29319-1-longman@redhat.com> <20260221185418.29319-9-longman@redhat.com> Content-Language: en-US From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 3/2/26 7:14 AM, Frederic Weisbecker wrote: > On Sat, Feb 21, 2026 at 01:54:18PM -0500, Waiman Long wrote: >> The current cpuset partition code is able to dynamically update >> the sched domains of a running system and the corresponding >> HK_TYPE_DOMAIN housekeeping cpumask to perform what is essentally the >> "isolcpus=domain,..." boot command line feature at run time. >> >> The housekeeping cpumask update requires flushing a number of different >> workqueues which may not be safe with cpus_read_lock() held as the >> workqueue flushing code may acquire cpus_read_lock() or acquiring locks >> which have locking dependency with cpus_read_lock() down the chain. Below >> is an example of such circular locking problem. >> >> ====================================================== >> WARNING: possible circular locking dependency detected >> 6.18.0-test+ #2 Tainted: G S >> ------------------------------------------------------ >> test_cpuset_prs/10971 is trying to acquire lock: >> ffff888112ba4958 ((wq_completion)sync_wq){+.+.}-{0:0}, at: touch_wq_lockdep_map+0x7a/0x180 >> >> but task is already holding lock: >> ffffffffae47f450 (cpuset_mutex){+.+.}-{4:4}, at: cpuset_partition_write+0x85/0x130 >> >> which lock already depends on the new lock. >> >> the existing dependency chain (in reverse order) is: >> -> #4 (cpuset_mutex){+.+.}-{4:4}: >> -> #3 (cpu_hotplug_lock){++++}-{0:0}: >> -> #2 (rtnl_mutex){+.+.}-{4:4}: >> -> #1 ((work_completion)(&arg.work)){+.+.}-{0:0}: >> -> #0 ((wq_completion)sync_wq){+.+.}-{0:0}: >> >> Chain exists of: >> (wq_completion)sync_wq --> cpu_hotplug_lock --> cpuset_mutex > Which workqueue is involved here that holds rtnl_mutex? > Is this an existing problem or added test code? Circular locking dependency here may not necessarily mean that rtnl_mutex is directly used in a work function.  However it can be used in a locking chain involving multiple parties that can result in a deadlock situation if they happen in the right order. So it is better safe that sorry even if the chance of this occurrence is minimal. Cheers, Longman