Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp664533rwe; Fri, 26 Aug 2022 11:53:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR4qkcUxzSTFzMBouoLQ4gaq+cdovPecRBmnwLxhc1f9a+zEboTboOlOqGIdLAw5YtnxFORB X-Received: by 2002:a17:907:7b95:b0:72f:9c64:4061 with SMTP id ne21-20020a1709077b9500b0072f9c644061mr6238506ejc.351.1661539981056; Fri, 26 Aug 2022 11:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661539981; cv=none; d=google.com; s=arc-20160816; b=E77r6TeVZ+/8sJ9cTHSPPThF4IMlt/EZRhMUoET6LddzNUqSFzM3qAqA3TI3qIZ3v7 MSxpAXpf5cvbT7/B2KBPPwMC0VC7G+l9q9719Ilxf+WvWKC3tF73X/pUCZeuUA9zJdvV YsDdWXlGg8LyJqBN5LLgJNCEDswhkCoMB3XlzTIc7UgtLHffLMv6xhsaEOky2r3IY9wf L13luQTDe8SpsdOctcI7SEbvjly+j9f/4yt3IzjEsrQAlRDZKuWhCXuCCObxOJD169h1 BdttW061mC5RMs/GyS1vecR1vywQODC/q4JPpv9IJJ2xMD1UNkRluvIbRElfx9KxGKwn Wpvg== 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=VA0RAnS0J7Q43OPw9/T3Teyafvr2GjFrcSqb8fHkBd4=; b=CWmaEu6+0sj/EHRgpnhpIPoPYu9d3DVrHBLexVQxyaISnlJC/CuOXQ3WXyfLIksGX4 7h0SAHBLaay6HsWD7RggQyNnEX3H4AmvrpMh1XbENZa1JT8VTn7tt+oLGDQuT9PpC7Jm VNgbVjIYMAR85dXlhPl9dCzM4w8S3ku3s2b422o/JOGbH9V1zx6lCC/ZThM3AJ5zZiFg wnhpTT43F2qC/j+qz1uOzi9edwkVOca4fbI8bZ8fGjF/UNDJQ2aZ+YQWrtLMbwBh8ADF 54U495yU7ek1I2g3lN9cS3QCFnLMhJgZPUUyMog9TFQ1BkvvHIPrP51Vcbxo642WSvSl jqzw== 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 u3-20020a170906068300b00730a3906ecfsi1580997ejb.110.2022.08.26.11.52.35; Fri, 26 Aug 2022 11:53:01 -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 S1345194AbiHZSuS (ORCPT + 99 others); Fri, 26 Aug 2022 14:50:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345181AbiHZSto (ORCPT ); Fri, 26 Aug 2022 14:49:44 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 34D07ED005 for ; Fri, 26 Aug 2022 11:46:25 -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 29FB1168F; Fri, 26 Aug 2022 11:46:30 -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 68D353F93E; Fri, 26 Aug 2022 11:46:22 -0700 (PDT) Message-ID: Date: Fri, 26 Aug 2022 20:46:12 +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 v7 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: <20220713134823.95141-1-schspa@gmail.com> <20220713134823.95141-2-schspa@gmail.com> From: Dietmar Eggemann In-Reply-To: <20220713134823.95141-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 13/07/2022 15:48, Schspa Shi wrote: > When the task to push disable migration, retry to push the current > running task on this CPU away, instead doing nothing for this migrate > disabled task. > > Signed-off-by: Schspa Shi Unfortunately, I can't recreate this issue on my Arm64 6 CPUs system on mainline or PREEMPT_RT (linux-5.19.y-rt and v5.10.59-rt52) (the one you mentioned in v6.) With an rt-app rt workload of 12-18 periodic rt-tasks (4/16ms) all with different priorities I never ran into a `is_migration_disabled(task)` situation. I only ever get `task_rq(task) != rq` or `task_running(rq, task)` under the `if (double_lock_balance(rq, lowest_rq))` condition in find_lock_lowest_rq(). [...] > // XXX validate p is still the highest prio task > if (task_rq(p) == rq) { > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index cb3b886a081c..21af20445e7f 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c > @@ -2335,6 +2335,15 @@ static int push_dl_task(struct rq *rq) > */ > task = pick_next_pushable_dl_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))) { > + put_task_struct(next_task); > + goto retry; > + } > + Looks like for DL this makes no sense since we're not pushing rq->curr in `retry:` like for RT in case `is_migration_disabled(next_task)`. [...] Reviewed-by: Dietmar Eggemann