Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp434753pxk; Fri, 11 Sep 2020 10:47:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEeAJWRixFkNkVDVKdeSobozkFXGlxS59a9hpgghO8MR8zUHr02DP74wf9jyWAEPveKZMT X-Received: by 2002:a50:8306:: with SMTP id 6mr3273530edh.340.1599846428948; Fri, 11 Sep 2020 10:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599846428; cv=none; d=google.com; s=arc-20160816; b=Umm5hrcy31gulQ7hN14adOLTNJWE5T3O4TNGYSJJWE8UT7eV0NZPfHCNZpmCcgZmFc EW4cLAs3Sb4dbW4b+YRMyCDJFFV6BT9ZDSJNhzsl8eZP+dH7oCw1K9yims1ovxWm/QJ6 j8iVSf0AL2uFMaXuv7rI3QkjZVsO7mykRRaeumjl0rOhkV01DRo73rirId75/X2+uXlm wf76wSKFJpGvy6ckjKKamj/duvlNhftcq8IjT+VqCia+Xh3OTeJ0etyCh6QmcI8bQLMB WGIvw+2pDLafdz/VdyzSFraNwJv44sbKkIcj19IS6atjRzhbEahbcn3PrTAElPrv3YjB l3pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qTJ9qYDYwWWCnoAj1TvImcLaoBAdOnFO4RHFFxDwY7k=; b=V3SYS4nwNd6rbSGR7fmFDUD8pREjEWaJEZZuquvphimZ21rLBgfXfVeLrQcf2CV2os x/1/vTpoyZsSD/atoyd8OSgC1d4fEWSoUHHLj7qTwycy/xXeHrP5nNQQDR+K4IMd+p8+ hJJTi9iO3rh3rFL8UovayOj7YryhVbI+ZPwoOvcXZ2CoQpQ3Z/VjU402mv29w4xjHqL4 4lHqxd8sXUTlcbE4+ukqvbYhVG4Z4ElXNhKDUd7gVbWfXwmxhJwA9OQdQM88XMmrtwea /7MakyUCv8tURUYCxKRyy8T/cc+gRH65CGawCMVz/xko5AtXPmhdD2Uwmc+5pjRp1I42 GFAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="NZxja/Dw"; 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 q19si1879405edv.61.2020.09.11.10.46.45; Fri, 11 Sep 2020 10:47:08 -0700 (PDT) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b="NZxja/Dw"; 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 S1725906AbgIKRp5 (ORCPT + 99 others); Fri, 11 Sep 2020 13:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbgIKM3v (ORCPT ); Fri, 11 Sep 2020 08:29:51 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD31CC061573 for ; Fri, 11 Sep 2020 05:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=qTJ9qYDYwWWCnoAj1TvImcLaoBAdOnFO4RHFFxDwY7k=; b=NZxja/Dwp664juq26ZQ9uWU+Bj dSc34IAEX6X3SgrUbye1RyHf/vS/UszYISwWWIt8ERcV8M+LQfnqsZYolZzO+/03C5leX3CHcrM2e YMgoK3Cec0ya+QBd47IpjoYJhSTv+zKc3sPOFdHPBPNtECy1Ouvp5Hr2JRwoMeK4/jsVGkRfHnU41 kq94W3f0it9URmgy7abmzxo8Sp5Lnu59dpKjMs57xp0byozaJTP7fjZJAaqe8dTF24czYisGmJQ6l Wcg3Pd4LNdDNk0ZXPUNn/40GoTXoVwin8GKmOCN+34H5KAP58DLmdjfCaWVhI8ovl2V3CgIbblCzc shwdTiqA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGiB9-0001yr-V1; Fri, 11 Sep 2020 12:29:24 +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 B88DA3003D8; Fri, 11 Sep 2020 14:29:22 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9EBBB2B082748; Fri, 11 Sep 2020 14:29:22 +0200 (CEST) Date: Fri, 11 Sep 2020 14:29:22 +0200 From: peterz@infradead.org To: Valentin Schneider Cc: mingo@kernel.org, vincent.guittot@linaro.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bristot@redhat.com, swood@redhat.com, Vincent Donnefort Subject: Re: [PATCH 2/2] sched/hotplug: Ensure only per-cpu kthreads run during hotplug Message-ID: <20200911122922.GJ1362448@hirez.programming.kicks-ass.net> References: <20200911081745.214686199@infradead.org> <20200911082536.528661716@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 11, 2020 at 01:17:45PM +0100, Valentin Schneider wrote: > > @@ -6968,6 +7064,8 @@ int sched_cpu_deactivate(unsigned int cp > > */ > > synchronize_rcu(); > > > > + balance_push_set(cpu, true); > > + > > IIUC this is going to make every subsequent finish_lock_switch() > migrate the switched-to task if it isn't a pcpu kthread. So this is going > to lead to a dance of > > switch_to() -> switch_to() -> switch_to() -> switch_to() ... > > Wouldn't it be better to batch all those in a migrate_tasks() sibling that > skips pcpu kthreads? That's 'difficult', this is hotplug, performance is not a consideration. Basically we don't have an iterator for the runqueues, so finding these tasks is hard.