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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061118193426.GC163@oleg>
Date:	Sat, 18 Nov 2006 22:34:26 +0300
From:	Oleg Nesterov <oleg@...sign.ru>
To:	"Paul E. McKenney" <paulmck@...ibm.com>
Cc:	Alan Stern <stern@...land.harvard.edu>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: [patch] cpufreq: mark cpufreq_tsc() as core_initcall_sync

On 11/18, Paul E. McKenney wrote:
>
> On Sat, Nov 18, 2006 at 11:15:27AM -0500, Alan Stern wrote:
> > > +			    smp_processor_id())->c[idx]++;
> > > +		smp_mb();
> > > +		preempt_enable();
> > > +		return idx;
> > > +	}
> > > +	if (mutex_trylock(&sp->mutex)) {
> > > +		preempt_enable();
> > 
> > Move the preempt_enable() before the "if", then get rid of the
> > preempt_enable() after the "if" block.
> 
> No can do.  The preempt_enable() must follow the increment and
> the memory barrier, otherwise the synchronize_sched() inside
> synchronize_srcu() can't do its job.

Given that srcu_read_lock() does smp_mb() after ->c[idx]++, what
is the purpose of synchronize_srcu() ? It seems to me it could be
replaced by smp_mb().

synchronize_srcu:

	sp->completed++;

	mb();

	// if the reader did any memory access _after_
	// srcu_read_lock()->mb() we must see the changes.
	while (srcu_readers_active_idx(sp, idx))
		sleep();

No?

Oleg.

-
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