Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1870776pxb; Fri, 5 Feb 2021 03:39:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1kHNAYjSmRJHwIcAnKXx0rnGpoLxTyDI8ANXWbDW8ecVpI1Ah4glkXRDYWshQ9wtDH0R6 X-Received: by 2002:a05:6402:3114:: with SMTP id dc20mr3127712edb.197.1612525198075; Fri, 05 Feb 2021 03:39:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612525198; cv=none; d=google.com; s=arc-20160816; b=difjg+dbXSAgsUAREzLagYKc+SzfkkSNKlu9AfGdSBJgOqU9gDviz3zxpKlYkJPYDX P+iSmn9jpq55S1rPB9X6fgB94lB9CKALtwwzgg44KoooLK3OjYCv2eqkCtQeob1FTdzR Zxj5g5vURsUz814gmTriuME4bL1VY2D03IYrtTVzkF1yEfkm1mz8gONpE00wid+OmsLW YY7suM+jKKCmddsYpomm3BJxBzl9FwByYOm5lNkikMqoyS4IlHxKLZz+pW0c4ciHajoa 0al6VxPsKlrthlvm1ZgSCB3Rt1TCtMlWLf2m1PVK4yrRm6YJ3uOQAfbBJIm4+5eXs1cv o7ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=xWYfy6Edwyz85Nk36WDI9E2NNxZgQ+E2tvqqVRrAqng=; b=zbpnA9X3w5KmUuECgXdGww9WaRB1ifSJySyjx7Vpd1oWbeHJsj+8dgFxHGiBLSEp8l VyqRecWhhiu8aoxqlzbhE+9JoyK/7E1C3H55wyPHk0Oy54G+dELjv0P6XU/nI96PAgtn y18ttXjw2POWLS9HyTfcx+jgGeGuJ8TEwZJIouvjTPabhwJY56VPlGo1EAS4rPs7z30S xUu/ciP4QnPeTvQFn7ICXItV9HgpQ6Iw91551Sr2DiheVW/51YRF0OKSRFrq4b0bAGJw 7M52Wsmui7dTN9eLzm6nEWLcnYbzXq4xce26+Kh11XFMRrZargmNhJ8rYYjKhjwl2Beq 6Qpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz20si5003467ejc.459.2021.02.05.03.39.32; Fri, 05 Feb 2021 03:39:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231436AbhBELhl (ORCPT + 99 others); Fri, 5 Feb 2021 06:37:41 -0500 Received: from foss.arm.com ([217.140.110.172]:56440 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231513AbhBELXK (ORCPT ); Fri, 5 Feb 2021 06:23:10 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 21AE4D6E; Fri, 5 Feb 2021 03:22:24 -0800 (PST) Received: from e107158-lin (e107158-lin.cambridge.arm.com [10.1.194.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 21ADC3F718; Fri, 5 Feb 2021 03:22:22 -0800 (PST) Date: Fri, 5 Feb 2021 11:22:19 +0000 From: Qais Yousef To: Peter Zijlstra , Alexey Klimov Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, yury.norov@gmail.com, daniel.m.jordan@oracle.com, tglx@linutronix.de, jobaker@redhat.com, audralmitchel@gmail.com, arnd@arndb.de, gregkh@linuxfoundation.org, rafael@kernel.org, tj@kernel.org, lizefan@huawei.com, hannes@cmpxchg.org, klimov.linux@gmail.com Subject: Re: [PATCH] cpu/hotplug: wait for cpuset_hotplug_work to finish on cpu onlining Message-ID: <20210205112219.kxdjpvjykrv6fi3x@e107158-lin> References: <20210204010157.1823669-1-aklimov@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/04/21 10:46, Peter Zijlstra wrote: > On Thu, Feb 04, 2021 at 01:01:57AM +0000, Alexey Klimov wrote: > > @@ -1281,6 +1282,11 @@ static int cpu_up(unsigned int cpu, enum cpuhp_state target) > > err = _cpu_up(cpu, 0, target); > > out: > > cpu_maps_update_done(); > > + > > + /* To avoid out of line uevent */ > > + if (!err) > > + cpuset_wait_for_hotplug(); > > + > > return err; > > } > > > > > @@ -2071,14 +2075,18 @@ static void cpuhp_online_cpu_device(unsigned int cpu) > > struct device *dev = get_cpu_device(cpu); > > > > dev->offline = false; > > - /* Tell user space about the state change */ > > - kobject_uevent(&dev->kobj, KOBJ_ONLINE); > > } > > > > One concequence of this is that you'll now get a bunch of notifications > across things like suspend/hybernate. And the resume latency will incur 5-30ms * nr_cpu_ids. Since you just care about device_online(), isn't cpu_device_up() a better place for the wait? This function is special helper for device_online(), leaving suspend/resume and kexec paths free from having to do this unnecessary wait. Thanks -- Qais Yousef