All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dipankar Sarma <dipankar@in.ibm.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>,
	Srivatsa Vaddagiri <vatsa@in.ibm.com>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu_do_batch: make ->qlen decrement irq safe
Date: Mon, 11 Sep 2006 03:47:04 +0530	[thread overview]
Message-ID: <20060910221704.GH4690@in.ibm.com> (raw)
In-Reply-To: <20060910213242.GB437@oleg>

On Mon, Sep 11, 2006 at 01:32:43AM +0400, Oleg Nesterov wrote:
> rcu_do_batch() decrements rdp->qlen with irqs enabled. This is not good,
> it can also be modified by call_rcu() from interrupt.
> 
> Decrement ->qlen once with irqs disabled, after a main loop.
> 
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
> 
> --- rc6-mm1/kernel/rcupdate.c~	2006-08-22 16:22:49.000000000 +0400
> +++ rc6-mm1/kernel/rcupdate.c	2006-09-11 01:24:17.000000000 +0400
> @@ -241,12 +241,16 @@ static void rcu_do_batch(struct rcu_data
>  		next = rdp->donelist = list->next;
>  		list->func(list);
>  		list = next;
> -		rdp->qlen--;
>  		if (++count >= rdp->blimit)
>  			break;
>  	}
> +
> +	local_irq_disable();
> +	rdp->qlen -= count;
> +	local_irq_enable();
>  	if (rdp->blimit == INT_MAX && rdp->qlen <= qlowmark)
>  		rdp->blimit = blimit;
> +
>  	if (!rdp->donelist)
>  		rdp->donetail = &rdp->donelist;
>  	else

Looks good to me. 

Thanks
Dipankar

      reply	other threads:[~2006-09-10 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-10 15:08 rcu_do_batch: rcu_data->qlen is not irq safe Oleg Nesterov
2006-09-10 20:58 ` Dipankar Sarma
2006-09-10 21:27   ` Oleg Nesterov
2006-09-10 21:32   ` [PATCH] rcu_do_batch: make ->qlen decrement " Oleg Nesterov
2006-09-10 22:17     ` Dipankar Sarma [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=20060910221704.GH4690@in.ibm.com \
    --to=dipankar@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=paulmck@us.ibm.com \
    --cc=vatsa@in.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.