Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp542522imw; Wed, 13 Jul 2022 03:32:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tzg68lB6qV8fHuZzP2K33jUcGilTaUjiG6zdmn/f6w/50w/Tt7/VgIxMWxrDQs6jvK55vs X-Received: by 2002:a17:906:9bef:b0:72b:40d1:4276 with SMTP id de47-20020a1709069bef00b0072b40d14276mr2630979ejc.360.1657708342666; Wed, 13 Jul 2022 03:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657708342; cv=none; d=google.com; s=arc-20160816; b=x+Q9DdcTBaNFD5Pq88kXyEEd2d5OcG+siIfR1idtpa2C7LztiuIDcrzIH1WDFeyYQv l4KqaemRP2t9eDwupfgBxqO42/TZZ8sdmF4kX4WaCjOtEBGbVx2yWz0W8YGmUG061csS ofJcc1eOwWQRrJ703Rk7ZiLssXQK7a0YG0gRpjrZe5p9w7RA0DdSijLfz+ZfOqArDtI7 /bs6obcphQe3o96dEgb/zhkDDoIPRpjXShmstadQK0dRENMEPXEsBnvK5hNW3TNAG1bD gulbehROgef/a3y3yxaONzF9cr4bvZ35G7HaeRzw3TyFNmJ/oaMTpGqlaDFCqra8xau0 omVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Fjc+RzQUdXYA+hWCE7Mucj2W/p6+N5QjUs4LjhYwpPI=; b=opIjlrGOT6CoX59TWwubU2WlaZG1dN2evVozUfx/LyEh4qefm/75sYD7LoywBD2Tgy MPt+i3zvQcp7bWOCnsfxk7sklCV1v62/vPmLDgO0HajCHqRTD75p4IJyGJSKAVaQEtF9 6SHaM81E/JbbfGWFHIG14KtyLq6161bi9NFvpjsYsw0175wmLtSlX86Pn7/6Xp8VmRgq bXt88Hzw+lh0Bo7OpAOPN9kDfxQioOb3I61Pd0o3yfYQOJIEYJR6XLO7aG4JGFNszzVX lbjAi3tUcAQtOWDXD1GvjMKU62JvG617I94dfPJ9miM+cX8VGj1Wy5ta9wyXYMyh4J1S Bilg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020a056402441600b0043a735e3e22si21934184eda.600.2022.07.13.03.31.57; Wed, 13 Jul 2022 03:32:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235151AbiGMKC5 (ORCPT + 99 others); Wed, 13 Jul 2022 06:02:57 -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 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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?