Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3686553imm; Mon, 15 Oct 2018 02:21:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV63OOyQoRkusu96VEE8MjqyafCe+aGtGGI3G6pHR8eC/YuodNBDJcW7AER4SUmF1rdEeEPKM X-Received: by 2002:a17:902:ac89:: with SMTP id h9-v6mr15909520plr.174.1539595273118; Mon, 15 Oct 2018 02:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539595273; cv=none; d=google.com; s=arc-20160816; b=P3ttWsDnrZsD2rFvs3qx/K8yVKVbSmNc98ZscXMkEpNjW00+ebRlKo0J71iUyBMwVt JdUXCHkDx468oBz38JBfujhm1LRpKMmT3Lw6nHJ2eWGDsA6tSAsCFewopA/8TlxbKhHM TgX2NMTqe3CEyrejHmgWpIHUunZCDeXlcp2YkNZ697vucJknSMFJOVdDPf0QVG1ER7KK asCxuhkdFDQRV79fB/6QoMJMltaxKJU+KEZFZACznKm9p2LTyLPP/F5yJUVaX/TeT0zM 0Z/skrAzoSs8x3yeUao9crLYbNG6r1HHiO/wJoL0lTY3CiW+YsOsPL4hO3H2bQUtyuzp 5O9Q== 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=lHyV6tM6w23MBxqLQo8ahT5lSUhfoK38X/VXPayNnYg=; b=kdBFy+aeLcEnEiDpiET+NCAygh5NHBfHWXEhG+tWdcJ5J3Qf43wMxs59jgCxCrPuoY Hcg6QLOozonJXMv2CuLDLRHhcmDcGrXyZozLfMCpOtnqjoCqaR+VTas891m8yp7XCYmv 7z/tK1+fFcyD4+DPEfMXp8vjF5R2TIyZGVGcarNDM8Hj83864C2vs19bN5LQkWeWjMsn zm6SEdTqtuQvg+sbHLd79G8AUADn+cPXCqt4rpxLB0c8wPGYo/NuJgN0lidm68xNrDi2 WNECRcQpYy+fgaLFVP2CIncoaw07bKmyH+f8+zn2LCMVQuO+424vv5csqcnfR6I8aI4d N3Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=TcZyAkll; 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 e12-v6si9606602pls.389.2018.10.15.02.20.58; Mon, 15 Oct 2018 02:21:13 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=TcZyAkll; 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 S1726681AbeJORFC (ORCPT + 99 others); Mon, 15 Oct 2018 13:05:02 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46528 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbeJORFC (ORCPT ); Mon, 15 Oct 2018 13:05:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lHyV6tM6w23MBxqLQo8ahT5lSUhfoK38X/VXPayNnYg=; b=TcZyAkll1IXkFBjXKfV5xwmvB zxCkjvQFdRmXMymmZpscROgK4E5kkBj95aYR/6oFSVu/gXuUYJTKsvWJBd4+w4jg1sOrNrLg1/X1Q O9dtapI2Kg6nLh1nJjEsenX1GJ+5oge/un0KjbFaud7rZJZqnu3ID5SOpsro1LKc4n8ikujSYW0rA ffau4IgXkWdFeUg1KFOefR0fV4fpGAcPu9+i+wZrE9shgw4Mqf+x2xs5p+FcsFkOGsz5QgoZUjIGj sZuaAIS4YS8HgN3jEf3OtqVZ8L+jOqNvzK0TVnSg9bNcpvuWxIZ7ZfxdiuLjG85virbZQPeg/1+XD grLfDP2ww==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBz3C-0000yb-LT; Mon, 15 Oct 2018 09:20:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C637820158F7C; Mon, 15 Oct 2018 11:20:32 +0200 (CEST) Date: Mon, 15 Oct 2018 11:20:32 +0200 From: Peter Zijlstra To: Peng Hao Cc: mingo@redhat.com, rostedt@goodmis.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] sched/rt : return accurate release rq lock info Message-ID: <20181015092032.GO9867@hirez.programming.kicks-ass.net> 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.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. Can we please write a more coherent Changelog, the above is very hard to read. Maybe something along the lines of: Subject: sched/rt: Reduce push_rt_task() retries Improve push_rt_task() by propagating the double_lock_balance() usage from find_lock_lowest_rq(), thereby reducing the number of cases where we have to assume rq->lock was dropped. > 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; > } > } I'm confused.. should not: /* try again */ double_unlock_balance(rq, lowest_rq); lowest_rq = NULL; also return RETRY_TASK? That also is in the double_lock_balance() path and will this have had rq->lock() released.