From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
Manfred Spraul <manfred@colorfullife.com>
Subject: Re: [PATCH V4 1/1] rcu: introduce kfree_rcu()
Date: Thu, 17 Mar 2011 10:50:34 -0700 [thread overview]
Message-ID: <20110317175034.GJ2304@linux.vnet.ibm.com> (raw)
In-Reply-To: <4D81D451.4020203@cn.fujitsu.com>
On Thu, Mar 17, 2011 at 05:28:49PM +0800, Lai Jiangshan wrote:
> On 03/16/2011 12:03 PM, Paul E. McKenney wrote:
> > On Tue, Mar 15, 2011 at 02:11:33PM +0100, Eric Dumazet wrote:
> >> Le mardi 15 mars 2011 à 17:46 +0800, Lai Jiangshan a écrit :
> >>
> >>
> >>> --- a/kernel/rcutiny.c
> >>> +++ b/kernel/rcutiny.c
> >>> @@ -167,7 +167,7 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp)
> >>> prefetch(next);
> >>> debug_rcu_head_unqueue(list);
> >>> local_bh_disable();
> >>> - list->func(list);
> >>> + __rcu_reclaim(list);
> >>> local_bh_enable();
> >>> list = next;
> >>> RCU_TRACE(cb_count++);
> >>
> >> Paul, I am just wondering why we disable BH before calling list->func()
> >>
> >> This should be done in callbacks that really need it ?
> >>
> >> At least the disable/enable pair is not necessary before calling kfree()
> >
> > Good point, we could bury the enable/disable pair in __rcu_reclaim().
> >
> > Lai, am I forgetting any reason why we disable BH?
> >
> > Thanx, Paul
> >
>
> For many years, rcu callbacks are called on BH since rcu is added to kernel,
> and someone assume they always called in BH. So we have to disable BH before
> calling list->func() to avoid bad result. It's a *historical* reason.
>
> I greed the disable/enable pair is not necessary before calling kfree(), but
> __rcu_reclaim() is also called in rcutree which rcu_process_callbacks()
> is in BH currently, I don't want to write 2 different version of
> __rcu_reclaim()s (one for rcutree, another for rcutiny).
>
> rcutree's rcu_process_callbacks() will be moved to process context, we may
> remove disable/enable BH pair for kfree() then.
OK, so if I sequence your patches after the rcutree priority boosting,
which threadifies rcutree's callback processing, I should be able to
omit BH for the kfree() case.
Thanx, Paul
prev parent reply other threads:[~2011-03-17 17:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-15 9:46 [PATCH V4 1/1] rcu: introduce kfree_rcu() Lai Jiangshan
2011-03-15 10:15 ` Arnd Bergmann
2011-03-15 11:27 ` Paul E. McKenney
2011-03-15 12:02 ` Arnd Bergmann
2011-03-15 12:19 ` Paul E. McKenney
2011-03-15 13:07 ` Arnd Bergmann
2011-03-16 2:58 ` Lai Jiangshan
2011-03-16 4:38 ` Paul E. McKenney
2011-03-16 4:02 ` Paul E. McKenney
2011-03-18 3:15 ` [PATCH V5 " Lai Jiangshan
2011-03-18 8:14 ` Arnd Bergmann
2011-03-16 2:23 ` [PATCH V4 " Lai Jiangshan
2011-03-15 11:30 ` Paul E. McKenney
2011-03-16 2:50 ` Lai Jiangshan
2011-03-16 4:29 ` Paul E. McKenney
2011-03-15 13:11 ` Eric Dumazet
2011-03-16 4:03 ` Paul E. McKenney
2011-03-17 9:28 ` Lai Jiangshan
2011-03-17 17:50 ` Paul E. McKenney [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=20110317175034.GJ2304@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=eric.dumazet@gmail.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=mingo@elte.hu \
/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.