lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071005132114.GA28755@in.ibm.com>
Date:	Fri, 5 Oct 2007 18:51:14 +0530
From:	Gautham R Shenoy <ego@...ibm.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-rt-users <linux-rt-users@...r.kernel.org>,
	Ingo Molnar <mingo@...e.hu>, akpm@...ux-foundation.org,
	dipankar@...ibm.com, josht@...ux.vnet.ibm.com, tytso@...ibm.com,
	dvhltc@...ibm.com, Thomas Gleixner <tglx@...utronix.de>,
	a.p.zijlstra@...llo.nl, bunk@...nel.org, oleg@...sign.ru
Subject: Re: [PATCH RFC 6/9] RCU priority boosting for preemptible RCU

On Fri, Oct 05, 2007 at 08:24:21AM -0400, Steven Rostedt wrote:
> 
> 
> 
> On Fri, 5 Oct 2007, Gautham R Shenoy wrote:
> 
> > On Mon, Sep 10, 2007 at 11:39:01AM -0700, Paul E. McKenney wrote:
> >
> > [snip]
> >
> > > +
> > > +/*
> > > + * Return the list from which to boost target tasks.
> > > + * May only be invoked by the booster task, so guaranteed to
> > > + * already be initialized.  Use rcu_boost_dat element least recently
> > > + * the destination for task blocking in RCU read-side critical sections.
> > > + */
> > > +static inline struct rcu_boost_dat *rcu_rbd_boosting(int cpu)
> > > +{
> > > +	int idx = (rcu_boost_idx + 1) & (RCU_BOOST_ELEMENTS - 1);
> >
> > Why is this masking required? When we increment
> > the rcu_boost_idx in rcu_booster, we do perform a modulo operation
> > to ensure that it wraps around RCU_BOOST_ELEMENTS.
> 
> Because we are not masking rcu_boost_idx, we are masking
>  (rcu_boost_idx + 1) which may extend the bounderies of
> RCU_BOOST_ELEMENTS.

Thanks! 

But I'm still trying to understand why the (increment + masking)
is required at all.

The thread(producer) that requires boosting is added to the element
with index rcu_boost_idx.

The booster thread(consumer) increments the rcu_boost_idx to 
(rcu_boost_idx + 1) % RCU_BOOST_ELEMENTS, before it fetches the least
recently used rcu_boot_dat elements and boost the eligible tasks queued
in that element.

So, can't we just return per_cpu(rcu_boost_dat, cpu)[rcu_boost_idx] from
rcu_rbd_boosting(cpu) ? Isn't that already the least recently used
element?

> 
> -- Steve

Thanks and Regards
gautham.
-- 
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ