Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp646313pxx; Thu, 29 Oct 2020 10:58:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxohpQnMZQR1Zu5P3akn5ltwUplvggHDtwebbyF/Jfxa914WD1Le9M7Rrav098b47Tiw8XD X-Received: by 2002:a05:6402:206:: with SMTP id t6mr5127241edv.291.1603994279981; Thu, 29 Oct 2020 10:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603994279; cv=none; d=google.com; s=arc-20160816; b=EP0UOG6Mf7Y2WXpp38DimA1GJXZXkHDaPafrqtnpSJ/RCQIBLHsGuYdHfk+tWTaMIJ fAYYtcRYRH7NPqWYqQrOapaxWqcLwXx8Wu/P+xhyaYn6+IKlMF36iHdjQckgcBGS8SAo MpD0Kg3W5b4VK2AY4o+vAthKHdiMItROnbAvip8u1YyaziuZiIpYkT5LMgxUJvKTK14G iSa2MzjS94OXc9F0AeNuvnqtHHGl+jiBArNKhLx91A4hJZVdRv76CkS/UntG9O+407P9 wkq3r0FGUZ1Yg4LBhnvMi+hHwCUaN2+1lrGJfm49TdOt9xFwcj1mOdrzERmgKAlVKeBE U5cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:user-agent:references; bh=xo0XneB2zoENydrIvhrehjnZO7RSQeMhzHG4O0UIPog=; b=KUW1l84YHMJr0OsJBhYGty8DkmMnQyhzUol6x77FN6IeF/5zyi0SlK1xK2FkpN38/Z WsdqN7kgij4ZmPz9ZBRMr8HXhumn0XtyKb7T1ARdWVn94NsXyyan8LU3n5ZmIPr3Ibqo az7OjWP2qIzJ7Cx3XWYPhh26cl3SCLQJJVvX31KJOqJuTa/T45EP18LwmRmbrj3xxkWJ 7sphwOqSSB5s4A/2SVWboViYe/rWw1mYq32qThlxhzFQdsi/S+yCslLR6iOaZSvW/kp9 7FBT9LxjsGSNyTHS5EKdUhGH2tf5kYDAECE/Kz+SOf5/GWf4qUl8o2EqonGTIoACAGyz BZkQ== 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 b6si2545391edv.126.2020.10.29.10.57.35; Thu, 29 Oct 2020 10:57:59 -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; 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 S1725971AbgJ2Rzo (ORCPT + 99 others); Thu, 29 Oct 2020 13:55:44 -0400 Received: from foss.arm.com ([217.140.110.172]:41836 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbgJ2Rzo (ORCPT ); Thu, 29 Oct 2020 13:55:44 -0400 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 77E96139F; Thu, 29 Oct 2020 10:55:43 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 591DD3F66E; Thu, 29 Oct 2020 10:55:41 -0700 (PDT) References: <20201023101158.088940906@infradead.org> <20201023102347.067278757@infradead.org> <20201029173409.GT2628@hirez.programming.kicks-ass.net> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Peter Zijlstra Cc: tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, bigeasy@linutronix.de, qais.yousef@arm.com, swood@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vincent.donnefort@arm.com, tj@kernel.org, ouwen210@hotmail.com Subject: Re: [PATCH v4 11/19] sched/core: Make migrate disable and CPU hotplug cooperative In-reply-to: <20201029173409.GT2628@hirez.programming.kicks-ass.net> Date: Thu, 29 Oct 2020 17:55:34 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/10/20 17:34, Peter Zijlstra wrote: > On Thu, Oct 29, 2020 at 04:27:09PM +0000, Valentin Schneider wrote: [...] > Can do I suppose, although I'm no sure what, if anything that helps, > because then we needs yet another comment explaining things. > > I ended up with the below. Is that an improvement? I'm leaning towards "yes", but YMMV. > > --- > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 3d7d5b7b9c99..c9c69511ece4 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -7226,11 +7226,19 @@ static void balance_push(struct rq *rq) > lockdep_assert_held(&rq->lock); > SCHED_WARN_ON(rq->cpu != smp_processor_id()); > > + /* > + * When migrate_disable(), we'll also have nr_pinned incremented due to > + * this being the tail end of schedule(). Therefore we do not need to wake > + * the hotplug_wait and go straight to jail^Wexit. > + */ > + if (is_migration_disabled(push_task)) > + return; > + > /* > * Both the cpu-hotplug and stop task are in this case and are > * required to complete the hotplug process. > */ > - if (is_per_cpu_kthread(push_task) || is_migration_disabled(push_task)) { > + if (is_per_cpu_kthread(push_task)) { > /* > * If this is the idle task on the outgoing CPU try to wake > * up the hotplug control thread which might wait for the