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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B8E4CCA479 for ; Wed, 13 Jul 2022 10:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235178AbiGMKC6 (ORCPT ); Wed, 13 Jul 2022 06:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231169AbiGMKCy (ORCPT ); Wed, 13 Jul 2022 06:02:54 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4D854F8949 for ; Wed, 13 Jul 2022 03:02:53 -0700 (PDT) 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 784861424; Wed, 13 Jul 2022 03:02:53 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 557343F792; Wed, 13 Jul 2022 03:02:51 -0700 (PDT) Message-ID: <5f0d6bef-9e9e-7083-9657-ae5e6dd10d2a@arm.com> Date: Wed, 13 Jul 2022 12:02:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v6 2/2] sched/rt: Trying to push current task when target disable migrating Content-Language: en-US To: Schspa Shi , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, zhaohui.shi@horizon.ai References: <20220712150506.632304-1-schspa@gmail.com> <20220712150506.632304-2-schspa@gmail.com> From: Dietmar Eggemann In-Reply-To: <20220712150506.632304-2-schspa@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/07/2022 17:05, Schspa Shi wrote: [...] > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c > index 7bd3e6ecbe45e..e2d7b085a93d9 100644 > --- a/kernel/sched/rt.c > +++ b/kernel/sched/rt.c > @@ -2136,6 +2136,12 @@ static int push_rt_task(struct rq *rq, bool pull) > */ > task = pick_next_pushable_task(rq); > if (task == next_task) { > + /* > + * If next task has now disabled migrating, see if we > + * can push the current task. > + */ > + if (unlikely(is_migration_disabled(task))) Doesn't this need a `put_task_struct(next_task)`? > + goto retry; > /* > * The task hasn't migrated, and is still the next > * eligible task, but we failed to find a run-queue Why not introduce in push_dl_task() as well?