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: <1182530125.5493.77.camel@localhost.localdomain>
Date:	Fri, 22 Jun 2007 12:35:25 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Oleg Nesterov <oleg@...sign.ru>
Cc:	Daniel Walker <dwalker@...sta.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Christoph Hellwig <hch@...radead.org>,
	john stultz <johnstul@...ibm.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Dipankar Sarma <dipankar@...ibm.com>,
	"David S. Miller" <davem@...emloft.net>, kuznet@....inr.ac.ru
Subject: Re: [RFC PATCH 6/6] Convert tasklets to work queues

On Fri, 2007-06-22 at 19:52 +0400, Oleg Nesterov wrote:
> On 06/22, Steven Rostedt wrote:
> >
> > > truct tasklet_struct, work);
> > > > +
> > > > +	if (unlikely(atomic_read(&t->count))) {
> > > > +		pr_debug("tasklet disabled %s %p\n", t->n, t);
> > > > +		set_bit(TASKLET_STATE_PENDING, &t->state);
> > > > +		smp_mb();
> > > > +		/* make sure we were not just enabled */
> > > > +		if (likely(atomic_read(&t->count)))
> > > > +			goto out;
> > > > +		clear_bit(TASKLET_STATE_PENDING, &t->state);

Yeah, I knew of the race but didn't think that running a tasklet
function twice would cause much harm here.  But not running it when it
needs to run, can have quite a negative impact.

> 
> So, t->func() will be executed twice because tasklet_enable() does
> tasklet_schedule().
> 
> 
> So I think we need a fix for work_tasklet_exec,
> 
> -		clear_bit(TASKLET_STATE_PENDING);
> +		if (!test_and_clear_bit(TASKLET_STATE_PENDING))
> 			goto out;
> 

OK, I like this. I'll add it in the next round.


> 
> 
> Steven, a very stupid suggestion, could you move the code for tasklet_enable()
> up, closer to tasklet_disable() ?

Not a stupid suggestion. I'll accommodate it.

Thanks,

-- Steve


-
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