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 93F582BE026 for ; Mon, 2 Feb 2026 20:33:02 +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=1770064383; cv=none; b=q1V7f13YR9ss6jK2jrnZqOO8+l2dCRLK48Q1TfFq7YVFJg+mPZ/qgt+UK+qj3cry/OFACavGsStpCJOX+O/rGzSPgn4ho9PqPvsYou6yauLs8p/610p6QN1pdz1+3BD4JPQ9RlbJDSqOgZbMtOMF3m+wXXIQIS5XaX6cx7mp2rs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064383; c=relaxed/simple; bh=bLSXIEyqATMhnbXgJDjHNJpKuxrFMC8eHMTi1SFlvBE=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=NMACFikWGQ5gBe9xoAEKa6LHTlZfLoD5PrJ4ZN5djOztCTNcP9OO0OnOJbk8LFeQP9/yR9hgSklRAJ2HJV6g/P0HOmm//mGojxg98KD01dq6lHtgV7DuWB1q+mFd7N5e2xW7bJzqY7+EtDNfCx5NiV8vWPqZ1cY/DgvpQm4ndtU= 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=iuggGv1b; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=iZu33w+4; 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="iuggGv1b"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="iZu33w+4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770064327; 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=q5gJYhxcAhJt/c1o8miiRcgCbdII4JGSN+/YgCren9w=; b=iuggGv1bHPkOGlRel1lhwT5V9QiyNusn8oaHmSfqWaKVi/qFRAsjKSaR97t+65VCyj/e5h AngEBczWzT+SxvyAziTxMW30ANKwXesue42Oq+AHVSq/UiAX8miAnnwyW+6ZQ4MNaTuqUC /LYrGatOkLf0SZj9FtX5AVJcW4kMt2A= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-30-YabJ4t1AMUSYkOxGp3g_YA-1; Mon, 02 Feb 2026 15:32:06 -0500 X-MC-Unique: YabJ4t1AMUSYkOxGp3g_YA-1 X-Mimecast-MFC-AGG-ID: YabJ4t1AMUSYkOxGp3g_YA_1770064325 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-503810dba87so268406021cf.1 for ; Mon, 02 Feb 2026 12:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770064325; x=1770669125; 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=q5gJYhxcAhJt/c1o8miiRcgCbdII4JGSN+/YgCren9w=; b=iZu33w+4xgflLk4Tt7YMJSCINvf7U6M+5luNmZY5G3jONKv2UESHXZseOXLu7k3B3S p8jy3+wo6Kow08VYwQW/L84qt5O7kCswrj2PTHXX7q6lYTmiEnuUnwclVf4wrnRdcCug J1iq7RBUhLNSLfm0ppDh5/hHX/qsBq5PuaPxRrFvjMtW/2D54p+xDB2LvqDW7rDJhwGV i8ot8EX829GuOY1uwj/BmRffjnxyulEppTHv7qys6Jx6MN6K+OOz1XIxs8ZFpdYW4KKk s2z+794iEg02TL0jgfjc0tTSm0F9sEaWErIRErvQ4/6j3Ko6fa/8hE8CMWWn4EsXNSiq q3hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770064325; x=1770669125; 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=q5gJYhxcAhJt/c1o8miiRcgCbdII4JGSN+/YgCren9w=; b=W313piMiPdYVf+w4hiOPJRDfKXSgH86LNPjvcpdrlFhY9O5cxQsIB0bo412DmcVV8w v2yJlM0LAzBxRwGy0vWQCxc0VZrmAw2kgFDgMxVCXwLv8isRwz0W7Zs0s6zWtrJFmqtN dfN8t9nE1NZbOHJgz8IsBiQtnJ6XayptnaB5vaSQ85h9twv+4T3r12x08p3OLUcinxTv ijo6ogrnEZIvkpJ3comfNXtkWFgPO/pCag6sp7Iw3C7CQOtHDOqDCsjv79sVQl3MEWq7 LiT+6SaLboLT5ZKmQzY3BkbfBMCsY2c15zNp1kTL8ce6QECEnB6S4O579+nwuFaKipaF WTdA== X-Forwarded-Encrypted: i=1; AJvYcCXrR3OV/kxpTD5UV0Lby3pX5mgKw04jRvo6A2ZypRisF08921r4wHY/cWoE5ERL32QWnjWDuK8F6g8gjT4=@vger.kernel.org X-Gm-Message-State: AOJu0YyMIw1CiJUakYrc0j1ezhRt35rYyWMLUiHyxvDE/jUOOtZ6Qtgi Dn7+asfMmMf3ezvOKwM5M4FWd0llOG6RePa15l8hBL+k8QXRNcuHoob1+XPF4TtORFKSepGBdVS nIlNo2Wy/Yf1N1d9HjxVdexSCtDgvyM/3N42Mg9mLl2NEzVRlBIl/b4B3v7atG4nqSw== X-Gm-Gg: AZuq6aLe/LPZU24YtcuN83HqHpLfD4UhxXPP5Dh2998Npx2mRzPMm90xH+itBFFLpPO iCco22IXAQkWGzNOVPMhZLeeSKP5dH1wfPx5e5K8Ko1HJf3FdOtUD0ZRWqyemMiPaEcLpiMDjoh agYGqvWxvkTNL7QF6gxfTyeh8mie0SeR5Id/2AC0xgYjm2YNJNkG4E54rC7vDKG6dQCZAMWLHVr /q4CiQzVWd+fmkWrdWkiJbSLyzJofJw2cR0W5vO33QuWo2cy8bTMyf2eXi0FsCxZhrvQWrm34Sq jMnluU5PQfusEGUoIWCROgAARfdT6VJsqkM/RrBubdk7sIrqfKqJ1UiJ4U2SCTGFdLxL8Xpzkw3 KI41WdMw9rUJEzF2wq2cAPscEu5mP7B3gccmFCYXyFYKi1VNsxKbXChWH X-Received: by 2002:a05:622a:d0:b0:4f7:a0da:ab0c with SMTP id d75a77b69052e-505d21c8451mr169362561cf.28.1770064325431; Mon, 02 Feb 2026 12:32:05 -0800 (PST) X-Received: by 2002:a05:622a:d0:b0:4f7:a0da:ab0c with SMTP id d75a77b69052e-505d21c8451mr169362141cf.28.1770064324960; Mon, 02 Feb 2026 12:32:04 -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 d75a77b69052e-50337bbbf8csm114527921cf.28.2026.02.02.12.32.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Feb 2026 12:32:04 -0800 (PST) From: Waiman Long X-Google-Original-From: Waiman Long Message-ID: Date: Mon, 2 Feb 2026 15:32:03 -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 v3 2/3] cgroup/cpuset: Defer housekeeping_update() calls from CPU hotplug to workqueue To: Peter Zijlstra Cc: Chen Ridong , Tejun Heo , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Ingo Molnar , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , Shuah Khan , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260202201144.1669260-1-longman@redhat.com> <20260202201144.1669260-3-longman@redhat.com> <20260202201844.GJ1395266@noisy.programming.kicks-ass.net> Content-Language: en-US In-Reply-To: <20260202201844.GJ1395266@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/2/26 3:18 PM, Peter Zijlstra wrote: > On Mon, Feb 02, 2026 at 03:11:43PM -0500, Waiman Long wrote: > >> @@ -1310,14 +1321,34 @@ static bool prstate_housekeeping_conflict(int prstate, struct cpumask *new_cpus) >> */ >> static void update_isolation_cpumasks(void) >> { >> - int ret; >> + static DECLARE_WORK(isolcpus_work, isolcpus_workfn); >> >> if (!isolated_cpus_updating) >> return; >> >> - ret = housekeeping_update(isolated_cpus); >> - WARN_ON_ONCE(ret < 0); >> + /* >> + * This function can be reached either directly from regular cpuset >> + * control file write or via CPU hotplug. In the latter case, it is >> + * the per-cpu kthread that calls cpuset_handle_hotplug() on behalf >> + * of the task that initiates CPU shutdown or bringup. >> + * >> + * To have better flexibility and prevent the possibility of deadlock >> + * when calling from CPU hotplug, we defer the housekeeping_update() >> + * call to after the current cpuset critical section has finished. >> + * This is done via workqueue. >> + */ >> + if (current->flags & PF_KTHREAD) { > /* Serializes the static isolcpus_workfn. */ > lockdep_assert_held(&cpuset_mutex); Do we require synchronization between the the queue_work() call and the execution of the work function? I thought it is not needed, but I may be wrong. Thanks, Longman