From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754339AbcK1GvA (ORCPT ); Mon, 28 Nov 2016 01:51:00 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:57359 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754075AbcK1Guw (ORCPT ); Mon, 28 Nov 2016 01:50:52 -0500 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Mon, 28 Nov 2016 15:46:39 +0900 From: Byungchul Park To: "Paul E. McKenney" Cc: josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] rcu: Force resched_cpu when jiffies >= rcu_state.jiffies_resched Message-ID: <20161128064639.GH2279@X58A-UD3R> References: <1478673135-25509-1-git-send-email-byungchul.park@lge.com> <1478673135-25509-2-git-send-email-byungchul.park@lge.com> <20161122081220.GG2279@X58A-UD3R> <20161125083426.GC31360@linux.vnet.ibm.com> <20161126120046.GA27434@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161126120046.GA27434@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 26, 2016 at 04:00:46AM -0800, Paul E. McKenney wrote: > On Fri, Nov 25, 2016 at 12:34:26AM -0800, Paul E. McKenney wrote: > > On Tue, Nov 22, 2016 at 05:12:20PM +0900, Byungchul Park wrote: > > > On Wed, Nov 09, 2016 at 03:32:15PM +0900, Byungchul Park wrote: > > > > Currently rcu code forces CPU into scheduler when jiffies >= > > > > rcu_state.gp_start + jiffies_till_sched_qs, via resched_cpu(). > > > > > > > > It would be better to force CPU into scheduler when jiffies >= > > > > rcu_state.jiffies_resched, too. > > > > > > Hello, > > > > > > I think these two patches are necessary to call resched_cpu() even in > > > case of jiffies >= rcu_state.jiffies_resched, too. Am I wrong? > > > > > > It would be appriciated if you let me know if I was wrong. > > > > My current thought is that both the "if" statement and the call to > > resched_cpu() should be removed, but I am still testing and working > > through the timing. > > > > Either way, I do very much appreciate your having called my attention > > to this code! > > And the patch shown below seems to do the trick. Thoughts? Hello, I see.. I didn't check the log 'rcu: Stop treating in-kernel CPU-bound workloads as errors'. If you are convinced to remove them, no objection. Thank you, Byungchul > > Thanx, Paul > > ------------------------------------------------------------------------ > > commit d2db185bfee894c573faebed93461e9938bdbb61 > Author: Paul E. McKenney > Date: Fri Nov 25 00:07:23 2016 -0800 > > rcu: Remove short-term CPU kicking > > Commit 4914950aaa12d ("rcu: Stop treating in-kernel CPU-bound workloads > as errors") added a (relatively) short-timeout call to resched_cpu(). > This was inspired by as issue that was fixed by b7e7ade34e61 ("sched/core: > Fix remote wakeups"). But given that this issue was fixed, it is time > for the current commit to remove this call to resched_cpu(). > > Reported-by: Byungchul Park > Signed-off-by: Paul E. McKenney > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 5f4f80d07852..91a68e4e6671 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -1345,12 +1345,6 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp, > rdp->rsp->jiffies_resched += 5; /* Re-enable beating. */ > } > > - /* And if it has been a really long time, kick the CPU as well. */ > - if (ULONG_CMP_GE(jiffies, > - rdp->rsp->gp_start + 2 * jiffies_till_sched_qs) || > - ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs)) > - resched_cpu(rdp->cpu); /* Force CPU into scheduler. */ > - > return 0; > } >