From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27564C433DB for ; Thu, 11 Feb 2021 14:24:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE68A64EA1 for ; Thu, 11 Feb 2021 14:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231866AbhBKOYe (ORCPT ); Thu, 11 Feb 2021 09:24:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32895 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232200AbhBKOLV (ORCPT ); Thu, 11 Feb 2021 09:11:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613052594; 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=1db50KVoxPV8DsdAaKXwwrLzCGY6SPMsnN2pRLnSac0=; b=RMdJEepTCqa1COsmf9XWUqTLQ/TrvG5lmR7c8g0l3p7Jr+yVhuOCkQc66r9EgVSH/AiUSP e65xr+gfTmOWJlvu491xC8kqXTP4NOmwpfnLMyac6rpDSJpLRkMd4Fo1mx5056WoOEE0HV +ULFstSMqkN6svYcTYfSwumaYEpSHpA= 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-225-fhxboqYmNdKeMAu8BtesMg-1; Thu, 11 Feb 2021 09:09:52 -0500 X-MC-Unique: fhxboqYmNdKeMAu8BtesMg-1 Received: by mail-lj1-f199.google.com with SMTP id s13so281577ljm.3 for ; Thu, 11 Feb 2021 06:09:52 -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=1db50KVoxPV8DsdAaKXwwrLzCGY6SPMsnN2pRLnSac0=; b=Sl9yKNRTZl+CKk4nGR1OO0gkOSrJVmebiNSSHl3a7nBS+Tx05G+4bgpAqBK7/CnnA3 0bzUQxoJLEGiGVidFka9aaHBUH8lcaulFCXCU4ydcn+d2fdQtxJVgphJbhSlG5forPWp qoEFxqQ9/+0gJHBdXOH4Q80DnGE+Pe3JBKZRsJNruTQlorsAamvY8pYeNuDzU2TZwP53 LFxLoGbx+z5mA7UfHUulXa5Gn8M4Nzu6OfHYjos0dgIXicNxtzxDlrxG/ZaQ8WrQ056v iKHSfUBXPm08pEcsHZSf8j+7KAyQu72E5E4uypgYpXITCYdxUOgaw5Y71v/3qnvY69WY 55Rg== X-Gm-Message-State: AOAM532ZfxqiHjRaMZsvYhi2AVfsSYOEBxqE8ft+rtydxOJDx7EIv19X 5ZZWpqAMEjpq77h8re+l/XhEbF+2konmpG/QIXQChhcgk82+NZtQ67t0hqJgkKmUqMZgmV4diWP lbNpwrPxed5C+3R+4bCPHvVFBOl9IBoOdVWmaSRgF X-Received: by 2002:a2e:9a88:: with SMTP id p8mr5078752lji.227.1613052590910; Thu, 11 Feb 2021 06:09:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjxxXK6iYKZ2EdAbSoUbHxDhHAH5y+j7zo5+cHMQNHTys4vr0Q/FHQHZf3JG4E2JSsuZKYcK55UPqgFawIlrk= X-Received: by 2002:a2e:9a88:: with SMTP id p8mr5078724lji.227.1613052590631; Thu, 11 Feb 2021 06:09:50 -0800 (PST) MIME-Version: 1.0 References: <20210204010157.1823669-1-aklimov@redhat.com> <87eehvz6sx.fsf@oracle.com> In-Reply-To: <87eehvz6sx.fsf@oracle.com> From: Alexey Klimov Date: Thu, 11 Feb 2021 14:09:39 +0000 Message-ID: Subject: Re: [PATCH] cpu/hotplug: wait for cpuset_hotplug_work to finish on cpu onlining To: Daniel Jordan , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, yury.norov@gmail.com, 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 , 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 12:41 AM Daniel Jordan wrote: > > Peter Zijlstra writes: [...] > >> > 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(). > > Both of those call cpu_up(), which only gets a cpuset_wait_for_hotplug() > in this patch. No new events generated from that, right, it's just a > wrapper for a flush_work()? > > > Also, looking again, you don't seem to be reinstating the OFFLINE event > > you took out. > > It seems to be reinstated in cpuhp_smt_disable()? Peter, what Daniel said. cpuset_wait_for_hotplug() doesn't generate an event. The offline event was moved below in the same function: + + /* Tell user space about the state changes */ + for_each_cpu(cpu, mask) { + dev = get_cpu_device(cpu); + kobject_uevent(&dev->kobj, KOBJ_OFFLINE); + } + + free_cpumask_var(mask); Daniel, thanks for your comments. I'll update the patch and resend. Best regards, Alexey From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Klimov Subject: Re: [PATCH] cpu/hotplug: wait for cpuset_hotplug_work to finish on cpu onlining Date: Thu, 11 Feb 2021 14:09:39 +0000 Message-ID: References: <20210204010157.1823669-1-aklimov@redhat.com> <87eehvz6sx.fsf@oracle.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613052594; 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=1db50KVoxPV8DsdAaKXwwrLzCGY6SPMsnN2pRLnSac0=; b=RMdJEepTCqa1COsmf9XWUqTLQ/TrvG5lmR7c8g0l3p7Jr+yVhuOCkQc66r9EgVSH/AiUSP e65xr+gfTmOWJlvu491xC8kqXTP4NOmwpfnLMyac6rpDSJpLRkMd4Fo1mx5056WoOEE0HV +ULFstSMqkN6svYcTYfSwumaYEpSHpA= In-Reply-To: <87eehvz6sx.fsf-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Daniel Jordan , Peter Zijlstra Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, yury.norov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org, Joshua Baker , audralmitchel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, rafael-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org, Qais Yousef , hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, Alexey Klimov On Fri, Feb 5, 2021 at 12:41 AM Daniel Jordan wrote: > > Peter Zijlstra writes: [...] > >> > 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(). > > Both of those call cpu_up(), which only gets a cpuset_wait_for_hotplug() > in this patch. No new events generated from that, right, it's just a > wrapper for a flush_work()? > > > Also, looking again, you don't seem to be reinstating the OFFLINE event > > you took out. > > It seems to be reinstated in cpuhp_smt_disable()? Peter, what Daniel said. cpuset_wait_for_hotplug() doesn't generate an event. The offline event was moved below in the same function: + + /* Tell user space about the state changes */ + for_each_cpu(cpu, mask) { + dev = get_cpu_device(cpu); + kobject_uevent(&dev->kobj, KOBJ_OFFLINE); + } + + free_cpumask_var(mask); Daniel, thanks for your comments. I'll update the patch and resend. Best regards, Alexey