Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp931121imw; Fri, 8 Jul 2022 14:40:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uTy4kqf1JFW/Q9OgK5XzcLJmZTz7+SyStaPDLCq2F2KqI8eOpZG6S9tb13WHdIHBk6e2Pn X-Received: by 2002:a17:90a:d195:b0:1ef:b15e:8cb5 with SMTP id fu21-20020a17090ad19500b001efb15e8cb5mr2118513pjb.228.1657316439456; Fri, 08 Jul 2022 14:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657316439; cv=none; d=google.com; s=arc-20160816; b=o8D7mIk9TiqU7wqenqF7Dx0OF8e83h/10dXjMTF6Bd9H1/QrycoDrff5kKVbSF/mP+ NcOMcW+b1ik8ukUoF6hH1Q15in0+4waaqfPWmxt9l0fFuIqUd+P00engvMtBn6DvyMYj MHZ8ObpMP4bLLDqwXNMPDwpkYFTyjEVzPhoIsBj+ifQvze333xISTO3KpYsXYPxqcTNl XmcAMhnsZt5UZDQ3ECQn3ViPiW4zHrMp43zO7IfmZga7i+7vqW1CiOIAk/Jj6CTQsm2T Aq5D4GpF88kjyJoqbvVFmvu6EcpJ/UM9JVFCu3ODtGe+52amME29/OE19HJHlCPW/TCv PJWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=zic1DDXQTpJZ8JWpBRmO7mz97QXgMd7lW7eEJstBPn4=; b=U68Y1J21WMpgqnlT8TpKSCTXD6sKCEXtrBBfNmDLieR8c5S1GtWj77bIZZ4f9dvbqd gHEm1e8qXPYSQT6nk6wDrbifewXFl+lwTGYJLtw16mx0KiqPlCy/KxGEKr0dw74MpL4+ MJvhECLb3CSf3hXDfFiyFYP2L5zz9NvG2OY1odZhRpTBsKcc3meHf6m3v66BEln5xrJ2 if5G0jx/EcNNndPxgSbP5bbI55JUZVGBYQn6XcgbGxjynDAaGze4HcEBJBlGo/B4Ukiu 0CiV0ksFCGeAEWc08f+3B/52eKDyuDBLTDi83fhATg9jX+PhWFL+8tzPeKBgJQNy9tQq Vm9Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a655504000000b00412a9c163b3si3548386pgr.51.2022.07.08.14.40.27; Fri, 08 Jul 2022 14:40:39 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239956AbiGHV0V (ORCPT + 99 others); Fri, 8 Jul 2022 17:26:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238520AbiGHV0V (ORCPT ); Fri, 8 Jul 2022 17:26:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EF9C23BF9 for ; Fri, 8 Jul 2022 14:26:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BC6CCB82915 for ; Fri, 8 Jul 2022 21:26:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40EBEC341C0; Fri, 8 Jul 2022 21:26:16 +0000 (UTC) Date: Fri, 8 Jul 2022 17:26:14 -0400 From: Steven Rostedt To: Schspa Shi Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, zhaohui.shi@horizon.ai Subject: Re: [PATCH v4 1/2] sched/rt: fix bad task migration for rt tasks Message-ID: <20220708172614.14191089@gandalf.local.home> In-Reply-To: <20220708211755.73637-1-schspa@gmail.com> References: <20220708211755.73637-1-schspa@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, 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 Sat, 9 Jul 2022 05:17:54 +0800 Schspa Shi wrote: > +++ b/kernel/sched/rt.c > @@ -1998,11 +1998,14 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq) > * the mean time, task could have > * migrated already or had its affinity changed. > * Also make sure that it wasn't scheduled on its rq. > + * It is possible the task has running for a while, I don't understand the "running for a while" part. That doesn't make sense. The only way this can happen is that it was scheduled, set "migrate_disabled" and then got preempted where it's no longer on the run queue. -- Steve > + * And we check task migration disable flag here. > */ > if (unlikely(task_rq(task) != rq || > !cpumask_test_cpu(lowest_rq->cpu, &task->cpus_mask) || > task_running(rq, task) || > !rt_task(task) || > + is_migration_disabled(task) || > !task_on_rq_queued(task))) { > > double_unlock_balance(rq, lowest_rq);