Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1122687pxb; Thu, 4 Feb 2021 05:47:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2QSFR+A/18GFJ4PqQhE6v7AckuifcSjY2dmRk5dYv/9e8N0yQN8QGfhKgun4PPUJrtdCa X-Received: by 2002:a17:906:805:: with SMTP id e5mr7909701ejd.104.1612446448385; Thu, 04 Feb 2021 05:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612446448; cv=none; d=google.com; s=arc-20160816; b=tniomWqN5CF7mjg9QutNklN8cARnWA4HsP428LV05clWKL5c6dHc+uJfWM8/UowAKJ P51JJhvWgky0jXRJMqQLdC6OClM1i1Od1ilaJXxdYSKVOqWB93/9snJBWldBIKSOb0n4 WfA1BDfkujbhvY2QTXf0W06MG8MYd6EWxDtjI7FkpL7w2fGgdZyejj6j3witZyMkUS62 h/6XHJF+kNYC3V2iT/hNjrQMoX3WmCZfOeYgo/Ol/i2tx3SH2SCcwVLN+YFDbc1LmhOz 8Cvw6z1wYPX2uAM5nYJZ7NrQwye5KMWnNOg4rlEHcNYtjUI6Q2pkHIVSnSCOe5dTnJkw z1rA== 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:dkim-signature; bh=esfcV78RrU8nXrE72X9LckMx7X5reL/P0pwhKEpoq3w=; b=PmwgHgJfDefsVNiiTcQU5DscC8lDurnDuDcw7ZCTM3anQki/mGNQ4uQi/C3FUX/kr4 HF+JpKx4vurS1GQ3a9sfCzisxew97ndnIoOrIykhiUM/+u4+2RYgwQbb7df2OvOpz0y6 yFLTlc0sSWBboWWoVxBjz2dvcYOJFzOwyCMlUDPFQgwbaqU6hmJ8NJcAWbuQXHUkZNgQ 3TgVQV9/I5scDUJR8W1SXhX/phSAQ2dl7+/ahEvXReuoX7Wbe3VSsEKxsC3ql1zJcJyp jH6ezYecbLw/ENwKy45i7t8cORVBMaRaRi+U4yJPPQJMpPBZZacR9pM1kf+r/1iXIWvv p3Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=EEFa99xE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si3872926edi.73.2021.02.04.05.47.01; Thu, 04 Feb 2021 05:47:28 -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=@infradead.org header.s=casper.20170209 header.b=EEFa99xE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236393AbhBDNoh (ORCPT + 99 others); Thu, 4 Feb 2021 08:44:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236325AbhBDNnW (ORCPT ); Thu, 4 Feb 2021 08:43:22 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF3C8C061786; Thu, 4 Feb 2021 05:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=esfcV78RrU8nXrE72X9LckMx7X5reL/P0pwhKEpoq3w=; b=EEFa99xE3ECGRhB28SI4ZjY4Yi 2zi2lbL6t/w3MDJsqbSTTXxUCdkmZqMCffLyoGa4IXzIkJUDPq7rHzsGvE1/JYKmPObvd6XPxTjHK f+DJOdmlIuE9n6P33PTnV3QEg5Z3a+ZlgO1dCIsog9ISzdkaPbj7f0DfcTU4AooM6CflEI1pOZQAn J76NZlxMOEMnWAvW1L0hycrU6rlq+RaSYTZOBqJYv3/WVZ8mpCOpDuAO2yA58ifD+umhnRBTmNAc3 leFwjnf15NZFu8n4wCvXpHg28KOKHhyARfSXOvPz6P1do77EDtYVz4dwaVqihgV7O6m3QUjbvepck KlC815Ug==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l7etV-000vze-JP; Thu, 04 Feb 2021 13:42:02 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5BBD83003D8; Thu, 4 Feb 2021 14:42:00 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1E4752C0034C0; Thu, 4 Feb 2021 14:42:00 +0100 (CET) Date: Thu, 4 Feb 2021 14:42:00 +0100 From: Peter Zijlstra To: Alexey Klimov Cc: 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, qais.yousef@arm.com, hannes@cmpxchg.org, Alexey Klimov Subject: Re: [PATCH] cpu/hotplug: wait for cpuset_hotplug_work to finish on cpu onlining Message-ID: References: <20210204010157.1823669-1-aklimov@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 04, 2021 at 12:50:34PM +0000, Alexey Klimov wrote: > On Thu, Feb 4, 2021 at 9:46 AM 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. > > The patch doesn't change the number of kobject_uevent()s. The > userspace will get the same number of uevents as before the patch (at > least if I can rely on my eyes). bringup_hibernate_cpu() didn't used to generate an event, it does now. Same for bringup_nonboot_cpus(). Also, looking again, you don't seem to be reinstating the OFFLINE event you took out.