All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: paulmck@linux.vnet.ibm.com
Cc: dipankar@in.ibm.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel/rcutree.c: deem to be lazy if there are no callbacks.
Date: Tue, 20 Aug 2013 12:30:12 +0800	[thread overview]
Message-ID: <5212F0D4.3010602@asianux.com> (raw)
In-Reply-To: <20130820041054.GX29406@linux.vnet.ibm.com>

On 08/20/2013 12:10 PM, Paul E. McKenney wrote:
> On Tue, Aug 20, 2013 at 11:50:02AM +0800, Chen Gang wrote:
>> According to the comment above rcu_cpu_has_callbacks(): "If there are
>> no callbacks, all of them are deemed to be lazy".
>>
>> So when both 'hc' and 'al' are false, '*all_lazy' should be true, not
>> false.
> 
> If there are no callbacks, what must the value of "al" be at this
> point in the code?  Given this, what is the effect of your patch?
> 

Hmm... I find it by reading code, the 'C code' says that 'hc' and 'al'
has no relationships with each other, so for a reader they can assume
when 'hc' is false, 'al' can be either 'true' or 'false'.

> 							Thanx, Paul
> 
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>>  kernel/rcutree.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/kernel/rcutree.c b/kernel/rcutree.c
>> index 5b53a89..9ee9565 100644
>> --- a/kernel/rcutree.c
>> +++ b/kernel/rcutree.c
>> @@ -2725,7 +2725,7 @@ static int rcu_cpu_has_callbacks(int cpu, bool *all_lazy)
>>  			hc = true;
>>  	}
>>  	if (all_lazy)
>> -		*all_lazy = al;
>> +		*all_lazy = !hc ? true : al;
>>  	return hc;
>>  }
>>
>> -- 
>> 1.7.7.6
>>
> 
> 
> 


-- 
Chen Gang

      reply	other threads:[~2013-08-20  4:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20  3:50 [PATCH] kernel/rcutree.c: deem to be lazy if there are no callbacks Chen Gang
2013-08-20  3:51 ` Chen Gang
2013-08-20  4:18   ` Paul E. McKenney
2013-08-20  4:43     ` Chen Gang
2013-08-20  4:45       ` Chen Gang
2013-08-21  5:59         ` Chen Gang
2013-08-21 14:23           ` Paul E. McKenney
2013-08-22  3:01             ` Chen Gang
2013-08-25 19:18               ` Paul E. McKenney
2013-08-26  2:21                 ` Chen Gang F T
2013-09-03  5:41                   ` Chen Gang
2013-09-03 17:59                     ` Paul E. McKenney
2013-09-04  1:57                       ` Chen Gang
2013-09-03 19:36                   ` Paul E. McKenney
2013-09-04  2:41                     ` Chen Gang F T
2013-08-20  4:10 ` Paul E. McKenney
2013-08-20  4:30   ` Chen Gang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5212F0D4.3010602@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.