Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp751375imm; Fri, 11 May 2018 05:58:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoayTRmIfP90k60Uc5OUz3R1ShlTC7uftG2X39OYMYGRzdpXMBJQ9JMBHCCGn2hj7LNAIwC X-Received: by 2002:a17:902:7149:: with SMTP id u9-v6mr5397959plm.356.1526043508193; Fri, 11 May 2018 05:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526043508; cv=none; d=google.com; s=arc-20160816; b=V17sEmvvTZkRXvtIlO5fYwA9iObgv1weTcVeRwm+B8asqwEHWuOag6qIdFXi9EKPww r+29BC0R/p62Td5wpwmx5YpTMtCSEe0XNXJuSWF8cK/L+uP47dw/h3K1eV2H1yXGShk0 CCUHVmvkFrAx2LuSv4bCwF3z2jJ+79ZA2BzJC1nG61hCc2csfUz9UgZTQw5cqJBkKxkH NElMqMWMI6cgg3DoTpwKn+RsRWylcW39Ix6xNYiTYBQl6rNDmheHbAhVivlBISK16Ygr zFgkvq9KK1gAuTKrNrZ6+wWt/FtS3WM1UdOy94yszY6nOE8A57suqpRaAZ2gIzrgdCv1 nBtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=/JuqRRJDtIL3OdwBULg7vbgqkZ3+6vgdWy5FtOimhEY=; b=DSx1dctC0B2OpCH2/zveY3bj4qh/UHifdr63GW6rl3FrvLIbEqGzGMZU6ojfixsNEs cAu59RlTZlPq5EzsbXLo6u2B6rV4y2+1hFB6sJqybuybNuy8xR7YHTZjhTqovERpmKBV d94XDIaN9Illn0qtP2uxFYTNw5jbbGDcEc35P7XC6gMM/xCGFnItXybEdUCjNixdj5W6 mJVzze+LhQNCdYBQm4OHtio6A/dhqL3VRDw/dcVGAtNOt5lHY6Bc8vXCKwMreEG0SGY0 H/eg0brJTSkMhtakLYyt8EwLYcY6Td+5f49WnXVR+s+oaX2ovbA45UkFLmXwjDRpAFp9 sbog== ARC-Authentication-Results: i=1; mx.google.com; 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 c20-v6si3161940pls.557.2018.05.11.05.58.14; Fri, 11 May 2018 05:58:28 -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; 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 S1753112AbeEKM6A (ORCPT + 99 others); Fri, 11 May 2018 08:58:00 -0400 Received: from lgeamrelo12.lge.com ([156.147.23.52]:59778 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753019AbeEKM57 (ORCPT ); Fri, 11 May 2018 08:57:59 -0400 Received: from unknown (HELO lgeamrelo04.lge.com) (156.147.1.127) by 156.147.23.52 with ESMTP; 11 May 2018 21:57:57 +0900 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: byungchul.park@lge.com Received: from unknown (HELO ?10.177.220.135?) (10.177.220.135) by 156.147.1.127 with ESMTP; 11 May 2018 21:57:56 +0900 X-Original-SENDERIP: 10.177.220.135 X-Original-MAILFROM: byungchul.park@lge.com Subject: Re: [PATCH] rcu: Report a quiescent state when it's exactly in the state From: Byungchul Park To: jiangshanlai@gmail.com, paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com Cc: linux-kernel@vger.kernel.org, kernel-team@lge.com References: <1526027434-21237-1-git-send-email-byungchul.park@lge.com> Message-ID: <3af4cec0-4019-e3ac-77f9-8631252fb6da@lge.com> Date: Fri, 11 May 2018 21:57:54 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1526027434-21237-1-git-send-email-byungchul.park@lge.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello folks, I think I wrote the title in a misleading way. Please change the title to something else such as, "rcu: Report a quiescent state when it's in the state" or, "rcu: Add points reporting quiescent states where proper" or so on. On 2018-05-11 오후 5:30, Byungchul Park wrote: > We expect a quiescent state of TASKS_RCU when cond_resched_tasks_rcu_qs() > is called, no matter whether it actually be scheduled or not. However, > it currently doesn't report the quiescent state when the task enters > into __schedule() as it's called with preempt = true. So make it report > the quiescent state unconditionally when cond_resched_tasks_rcu_qs() is > called. > > And in TINY_RCU, even though the quiescent state of rcu_bh also should > be reported when the tick interrupt comes from user, it doesn't. So make > it reported. > > Lastly in TREE_RCU, rcu_note_voluntary_context_switch() should be > reported when the tick interrupt comes from not only user but also idle, > as an extended quiescent state. > > Signed-off-by: Byungchul Park > --- > include/linux/rcupdate.h | 4 ++-- > kernel/rcu/tiny.c | 6 +++--- > kernel/rcu/tree.c | 4 ++-- > 3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index ee8cf5fc..7432261 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -195,8 +195,8 @@ static inline void exit_tasks_rcu_finish(void) { } > */ > #define cond_resched_tasks_rcu_qs() \ > do { \ > - if (!cond_resched()) \ > - rcu_note_voluntary_context_switch_lite(current); \ > + rcu_note_voluntary_context_switch_lite(current); \ > + cond_resched(); \ > } while (0) > > /* > diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c > index a64eee0..68d2332 100644 > --- a/kernel/rcu/tiny.c > +++ b/kernel/rcu/tiny.c > @@ -120,12 +120,12 @@ void rcu_bh_qs(void) > */ > void rcu_check_callbacks(int user) > { > - if (user) > + if (user) { > rcu_sched_qs(); > - else if (!in_softirq()) > rcu_bh_qs(); > - if (user) > rcu_note_voluntary_context_switch(current); > + } else if (!in_softirq()) > + rcu_bh_qs(); > } > > /* > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 36075dd..1abe29a 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2595,6 +2595,7 @@ void rcu_check_callbacks(int user) > > rcu_sched_qs(); > rcu_bh_qs(); > + rcu_note_voluntary_context_switch(current); > > } else if (!in_softirq()) { > > @@ -2610,8 +2611,7 @@ void rcu_check_callbacks(int user) > rcu_preempt_check_callbacks(); > if (rcu_pending()) > invoke_rcu_core(); > - if (user) > - rcu_note_voluntary_context_switch(current); > + > trace_rcu_utilization(TPS("End scheduler-tick")); > } > > -- Thanks, Byungchul