Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp584986pxx; Thu, 29 Oct 2020 09:29:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/9CbUkGLn+uwk8G0a7B/nK1Rz18M1Z6Elm085XG36vahYB+0dUtks1sRJGXo+RA9rjEqv X-Received: by 2002:aa7:c1d9:: with SMTP id d25mr4734313edp.309.1603988946758; Thu, 29 Oct 2020 09:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603988946; cv=none; d=google.com; s=arc-20160816; b=aj3q6g3g4LR1N0BBNdum5G4I/MsVdyucoB5xlJnZiHzcrpiEudplJ+myfU782QcQst QN7BpNcD0mS7GE3xE9IrXyjzie2pjRGdxfGwFgmmc+pcqqWI3j/F1bbqs0Opaw2DL44W 8mxb2jrzeJYCmp9/hpZzSydsT3f0vM/XiaYkqopJEs5kzRJUnhjs2122+kN4R7gKw3Ez InB0Be8NfKfqRIC+pKoGNJEA97/wiUVzRMghptiNEJKfUmvPIswjlUriKWjLqIu0FYu5 JA7PySg++yzu7Fs/YFAEth0sIZSu/Iw5ZWIJ+2WMIdfREA7gzrRvWuIQ3ua3jwQhtvWQ Plkg== 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=+1yI/DP1v9ptFzhz8r3JjvlQ2EjkwmnjIxoyuJ81aJg=; b=BCyej5077tZA2JMRZeDAW/C8uhpHgyYObcE1jcQd+VGl20cfx/tfWJOefC0EEUr1V7 2IGkhl4xiXndNI3y2gDKa0lpZ3pMM0j2DL6E6De6aTHp0Whut1bEYX5diXaA/iXShnlE y+0di9oYpT2yQvYngZpqU6Gcu83pv5MPS50ERx1nhfH+0ofNxsq/lkMlYTu7Kq8B54k6 H+UdlqyQd5npqHtxf8cb76DLrkGw3pvPSdOhkq5sIOckWhNfs+FD1G8ou1pTMuyJokAC s+93AAKE2X63Ik+EfLoPL2Fh6vSO3OVGCjkO+Snd5e5CXH5iy4qyM7l2Dq5RBR6MTmmp hRGw== 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 r10si2402502ejc.191.2020.10.29.09.28.44; Thu, 29 Oct 2020 09:29:06 -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 S1726655AbgJ2Q1O (ORCPT + 99 others); Thu, 29 Oct 2020 12:27:14 -0400 Received: from foss.arm.com ([217.140.110.172]:40338 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbgJ2Q1O (ORCPT ); Thu, 29 Oct 2020 12:27:14 -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 64FA0139F; Thu, 29 Oct 2020 09:27:13 -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 48CAE3F66E; Thu, 29 Oct 2020 09:27:11 -0700 (PDT) References: <20201023101158.088940906@infradead.org> <20201023102347.067278757@infradead.org> 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: <20201023102347.067278757@infradead.org> Date: Thu, 29 Oct 2020 16:27:09 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/10/20 11:12, Peter Zijlstra wrote: > @@ -7006,15 +7024,20 @@ static bool balance_push(struct rq *rq) > * 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)) { > + if (is_per_cpu_kthread(push_task) || is_migration_disabled(push_task)) { is_migration_disabled(p) implies rq_has_pinned_tasks(task_rq(p)), right? So having a "simple" if (is_migration_disabled(push_task)) return; would help simpletons like me trying to read through this. > /* > * If this is the idle task on the outgoing CPU try to wake > * up the hotplug control thread which might wait for the > * last task to vanish. The rcuwait_active() check is > * accurate here because the waiter is pinned on this CPU > * and can't obviously be running in parallel. > + * > + * On RT kernels this also has to check whether there are > + * pinned and scheduled out tasks on the runqueue. They > + * need to leave the migrate disabled section first. > */ > - if (!rq->nr_running && rcuwait_active(&rq->hotplug_wait)) { > + if (!rq->nr_running && !rq_has_pinned_tasks(rq) && > + rcuwait_active(&rq->hotplug_wait)) { > raw_spin_unlock(&rq->lock); > rcuwait_wake_up(&rq->hotplug_wait); > raw_spin_lock(&rq->lock);