Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2156000pxb; Thu, 11 Feb 2021 05:57:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFc9JRi4xpxPQJT4LKen5chGz5qj+P7F997YOC0R89KrJsYhWVyjupyhJNKK4kC347+Da/ X-Received: by 2002:a17:906:7c43:: with SMTP id g3mr8544725ejp.210.1613051844592; Thu, 11 Feb 2021 05:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613051844; cv=none; d=google.com; s=arc-20160816; b=n7STCzC+EbyXvkmA9nBFyIkpCJtbFrEfHdDv6MM278zZUPuGG1U1oxKSs2wiTGQDYR rn6PpIkf0EzvQx6RWFDiFqicl4XCmm+sE8BhmjBuTTi8B/CKRL1fmhf/8uPvgy33fSwq Qnru7mEODs+h+5NVLqhaRJ+W7dY+Yi0mMRgqeKJ7YVeyoyq5TVBSrAG1XLhFkVjKSJ6e Z4XzbWhOXLkmdCKmltYf6hLtyvfTm8OvH8ssxXzM9CHDhLiVCpBqtmBiYx+4whIf1/Pe RQRZKYt7IgFAOESpCYw1fhAg5wRSI8PZjLMLdo5pGc23W3RjfjDI6s+KVNCJdx1JDAoy LsBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JGimXPuqcoE+a6jS2uYizeEDGioIlqVcs0oa7fVjFEs=; b=xAKODdTqDoaJgT1CiyjD8KRvjUJejGWe8B5lqHoNY3jrKlcyts2a3lBpG+qW6kEIct M4RpETS9KDrL7ZpiNXcb6WwCoD3fAMQu/O/8yALX6I/hiVL+5igPkZJGoV2Y/pwSDZv+ uDEBStGYbamZmE93e2EcHj6vV6VxYGfVQtx+sORk8vEmfW8objCgPPeczEGG47Gjxiy6 kxyV7mqP2EE7qZ7wDN5cs7vR4PKuXZK5tKt9H+MoKlGT8Vej7SEYkUhFewH6c+t9tK6p 9n8QjkTcGmpd7cZMCK3kWLF0eEq/XkLIPLWZpqW7xEy91KQWU+d0434yvR7SOjtsNgTP 4BbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eoOKuVQu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r14si3946787edw.243.2021.02.11.05.57.00; Thu, 11 Feb 2021 05:57:24 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eoOKuVQu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbhBKNz4 (ORCPT + 99 others); Thu, 11 Feb 2021 08:55:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47506 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbhBKNkf (ORCPT ); Thu, 11 Feb 2021 08:40:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613050746; 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: in-reply-to:in-reply-to:references:references; bh=JGimXPuqcoE+a6jS2uYizeEDGioIlqVcs0oa7fVjFEs=; b=eoOKuVQuUlbULVHDfyhDPJGOLDvCYnOKY+bibZBgGRcTJRW9HgZUZv4FVW8JoJAFOqKs1T Ymw/lREW35uPn5ivZxr2v5ky1drRaxx+AEAVxD+Jdmz7hk+rV2zbRn2zxPGaMROophzM5D ZAwwHtZydPWvM0HEtb7cScGiZNE0Hbs= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-544-kAITXSciOGqJvMBy30lnbQ-1; Thu, 11 Feb 2021 08:39:04 -0500 X-MC-Unique: kAITXSciOGqJvMBy30lnbQ-1 Received: by mail-lj1-f199.google.com with SMTP id q8so3621739ljj.13 for ; Thu, 11 Feb 2021 05:39:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JGimXPuqcoE+a6jS2uYizeEDGioIlqVcs0oa7fVjFEs=; b=M61h1tyv1Gh7DxuwaSiB8ukA3h9EfN4lU/KYBPdBS4rCo7fNxcbCeHqxjg8fTUnXGf cLgpWY7/gMHhnzFkcZ48XSKogVT+aS7caNPvpseOOSwbLmhWv2XukUet4eXXns/mtYr6 DHBNraDUmO+phqVZR8OvM9YVzYGfvOoHksa06OzNFI/QwDk/39GMN9EZ0OUJSs96n3to RfhuRQP6CBrXNw9EiYyntSuc6Ovpc6ogFuQB84R+WzO2/WsF4hwprK125Esd83vWW3y+ 6QSF0VEqoRJuD68xMIwFLSu1aiVW84uUMIKNcvQyt2V0HVcGO6I56NVzAg820r5+Zdyr jKzQ== X-Gm-Message-State: AOAM532DShvCS8EnUER8yw0eh9sKDCzK2zjpvwMoqvOVkfU/CrKsJCa8 dqVdS2vFQobRvl9TH/Lpnq/Jh07AKeo4nfthOeSWMHWb1tYJRsQYMpnPrVjH6U/CIRvJsqrg/6V C3BHSbCbB+ON2WKYt0rDU8hBQ6gJcVf3K6f7PYnxJ X-Received: by 2002:a05:6512:613:: with SMTP id b19mr4621145lfe.220.1613050742884; Thu, 11 Feb 2021 05:39:02 -0800 (PST) X-Received: by 2002:a05:6512:613:: with SMTP id b19mr4621135lfe.220.1613050742707; Thu, 11 Feb 2021 05:39:02 -0800 (PST) MIME-Version: 1.0 References: <20210204010157.1823669-1-aklimov@redhat.com> <20210205112219.kxdjpvjykrv6fi3x@e107158-lin> In-Reply-To: <20210205112219.kxdjpvjykrv6fi3x@e107158-lin> From: Alexey Klimov Date: Thu, 11 Feb 2021 13:38:51 +0000 Message-ID: Subject: Re: [PATCH] cpu/hotplug: wait for cpuset_hotplug_work to finish on cpu onlining To: Qais Yousef Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, yury.norov@gmail.com, Daniel Jordan , tglx@linutronix.de, Joshua Baker , audralmitchel@gmail.com, arnd@arndb.de, gregkh@linuxfoundation.org, rafael@kernel.org, tj@kernel.org, lizefan@huawei.com, hannes@cmpxchg.org, Alexey Klimov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 5, 2021 at 11:22 AM Qais Yousef wrote: > > 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. Yup, the same idea here once Peter mentioned bringup_nonboot_cpus() and bringup_hibernate_cpu(). Best regards, Alexey