Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp603373imm; Fri, 5 Oct 2018 08:48:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV62BLHvOdRfPMaW0IR5A17PaVWClBpRxZAhA/ctOrCwpxURzgtbNj5zmAOSiIIemz/ny9Q1E X-Received: by 2002:a63:e443:: with SMTP id i3-v6mr10861184pgk.381.1538754503334; Fri, 05 Oct 2018 08:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538754503; cv=none; d=google.com; s=arc-20160816; b=D5QBsD1wsL7NQllmost0G1iHlQbbpmFFdm8xbKjQ4VFcuV4WsnWNjYmojfxpcsWDd7 OqzCAej29DAGS1Wbh3MlJSqdP7kHJ4p3B6IhEPare1hFNDsSRAn8bIywjIhwaUYXfNx3 DX+nMAx1jWiBTb9WQ1lmdM2O4oOOWuhX6pJNzl1axfFWL1G1BvT4l6fxTZO+rXXGaEDg mYpvwmrI2RbfiKoPfv5tlxtBVi0AiODXvxtHPQ4k9AdNAJ9qIj5MOL4fQu9JOJWDRMXm rjVb+ZlcUH8vFC29H0fuRbgUxkCJK43uK8aDtGBpBtAypTUPM7GPMqDkKvNh2Oq0K5G7 s8Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dQcdGjN1cBkzzd5w2pT/hHsSuiSSYr6PnKIR7vaL2W4=; b=qb48yX8+VMtAXd0rRyGo76hyg8HSgWtVhBXMGsMSb6Iv54iiGejCFmqf5cWo3V7O11 fIIiD1nt+sLA2MDLPx+wcj9/HKWQk7YQYugs9B8O9LQ7jGLqqiDMIMt6nCutbYNLsKl3 RbxJF5kfpyV5rUXrMzj0L8mCz5sFfF0Xo0mGNjUp90hMNB1DhsCyMudv9I6Kw/mD4FfV V43q/W0BJU21Nt2gkK0p1gJD/dUfnc2Jh6PDcr2uXHZClSUmVLzY1kK1KkMWHLRi7MPp JwNwKSJK9tBDogfW1hoK9PrnyJZKN6W5x1d8eEAbt9vaklld/H1OKQfNhKrsFalR31xn 5J3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fA8dghEP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l185-v6si8509774pgl.270.2018.10.05.08.48.08; Fri, 05 Oct 2018 08:48:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fA8dghEP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728619AbeJEWqB (ORCPT + 99 others); Fri, 5 Oct 2018 18:46:01 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:39376 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727572AbeJEWqB (ORCPT ); Fri, 5 Oct 2018 18:46:01 -0400 Received: by mail-ed1-f66.google.com with SMTP id h4-v6so12038778edi.6 for ; Fri, 05 Oct 2018 08:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dQcdGjN1cBkzzd5w2pT/hHsSuiSSYr6PnKIR7vaL2W4=; b=fA8dghEPwAYEfz5/Ex5x5UOuH0CPafKgMdI9HoDi/n3CMrvX3cULMKQKh7cR+Lyh24 GoNUBR3LdMrMj/iYzZj4kNVIH+i/6IWwOPSwIbxJlp2DSd207m5qT1v7AkM2jsRDFKpz USGzBVQ3Tz3sbKSq/0lmpitGIM/ea/1AjPpLo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dQcdGjN1cBkzzd5w2pT/hHsSuiSSYr6PnKIR7vaL2W4=; b=MNnl0p2Hhjzbrf6RRnULeVLBxsYLeEh+QnYrr1nQquzwUeAtsAuv4ezehCq0HhZXd1 n6ApxCD2+aV54M+xUj1Hfksl9MdQvTXFExUomSB0kojasQUPv5mnnTxA8EHNG96OZAS8 MiIOYTlSyOB9v5mdjWGF0XAYb7zYMc+TMvuIkOTfdzR6d26gC9q+CEJYuFhc2qCPa/tn Lh+fSeGe6bU0OG2i0zbpZC+65JVjl6VC+8907gCjRC8GSTn48ZxKw/hhkZwF37N+4a4t ee1E/SdSQzrNxVgGvN4YuB1CrOaww+/LwRiKfzRh/wCW+yFa7QSJmOjgjJwBOH7UJoRk ao/Q== X-Gm-Message-State: ABuFfojGCkfkhdtZ2KCw6ibJTO5yiFtPHULbeAQmBoSYkMjmkI/lecS2 rG0a8Wy104dUjSqLg5zuEihykg== X-Received: by 2002:aa7:c247:: with SMTP id y7-v6mr1474514edo.205.1538754403912; Fri, 05 Oct 2018 08:46:43 -0700 (PDT) Received: from andrea (15.152.230.94.awnet.cz. [94.230.152.15]) by smtp.gmail.com with ESMTPSA id h3-v6sm2686923ede.42.2018.10.05.08.46.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 08:46:43 -0700 (PDT) Date: Fri, 5 Oct 2018 17:46:32 +0200 From: Andrea Parri To: Peng Hao Cc: mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, juri.lelli@redhat.com Subject: Re: [PATCH v3] sched/rt : return accurate release rq lock info Message-ID: <20181005154632.GA18077@andrea> References: <1538778131-44406-1-git-send-email-peng.hao2@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1538778131-44406-1-git-send-email-peng.hao2@zte.com.cn> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peng, On Sat, Oct 06, 2018 at 06:22:11AM +0800, Peng Hao wrote: > find_lock_lowest_rq may or not releease rq lock when return > lowest_rq=NULL, but it is fuzzy. > If not releasing rq lock, it is unnecessary to re-call > pick_next_pushable_task. IIRC, deadline.c uses a similar pattern (c.f., find_lock_later_rq() and pick_next_pushable_dl_task()): should it be considered for this change? Andrea > When CONFIG_PREEMPT=n, not releasing rq lock and return > lowest_rq=null frequently happens in a simple test case: > Four different rt priority tasks run on limited two cpus. > Thanks for Steven Rostedt's advice. > > Signed-off-by: Peng Hao > --- > kernel/sched/rt.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c > index 2e2955a..be0fc43 100644 > --- a/kernel/sched/rt.c > +++ b/kernel/sched/rt.c > @@ -1754,7 +1754,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq) > !task_on_rq_queued(task))) { > > double_unlock_balance(rq, lowest_rq); > - lowest_rq = NULL; > + lowest_rq = RETRY_TASK; > break; > } > } > @@ -1830,7 +1830,9 @@ static int push_rt_task(struct rq *rq) > > /* find_lock_lowest_rq locks the rq if found */ > lowest_rq = find_lock_lowest_rq(next_task, rq); > - if (!lowest_rq) { > + if (!lowest_rq) > + goto out; > + if (lowest_rq == RETRY_TASK) { > struct task_struct *task; > /* > * find_lock_lowest_rq releases rq->lock > -- > 1.8.3.1 >