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: <20080612163535.GA12135@tv-sign.ru>
Date:	Thu, 12 Jun 2008 20:35:35 +0400
From:	Oleg Nesterov <oleg@...sign.ru>
To:	Max Krasnyansky <maxk@...lcomm.com>
Cc:	Peter Zijlstra <peterz@...radead.org>, mingo@...e.hu,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Rientjes <rientjes@...gle.com>,
	Paul Jackson <pj@....com>, menage@...gle.com,
	linux-kernel@...r.kernel.org, Mark Hounschell <dmarkh@....rr.com>
Subject: Re: workqueue cpu affinity

On 06/11, Max Krasnyansky wrote:
>
> Oleg Nesterov wrote:
> > 
> > Yes, it is easy to implement flush_work(struct work_struct *work) which
> > only waits for that work, so it can't hang unless it was enqueued on the
> > isolated cpu.
> > 
> > But in most cases it is enough to just do
> > 
> > 	if (cancel_work_sync(work))
> > 		work->func(work);
> Cool. That would work.
> btw Somehow I thought that you already implemented flush_work(). I do not see
> it 2.6.25 but I could've sworn that I saw a patch flying by. Must have been
> something else. Do you mind adding that ?

Well... I don't think Andrew will take this patch right now... OK, I'll send
the preparation patch with comments. Do you see an immediate user for this
helper?

> > Or we can add flush_workqueue_cpus(struct workqueue_struct *wq, cpumask_t *cpu_map).
> That'd be special casing. I mean something will have to know what cpus cannot
> be flushed.

OK, we can make it flush_workqueue_except_isolated_cpus(struct workqueue_struct *wq).

> I liked your proposal above much better.

it was Peter who suggested this ;)

> > But I don't think we should change the behaviour of flush_workqueue().
> > 
> >> This will require a bit of surgery across the entire tree. There is a lot of
> >> code that calls flush_scheduled_work()
> > 
> > Almost all of them should be changed to use cancel_work_sync().
> 
> That'd be a lot of changes.
>
> git grep flush_scheduled_work | wc
>     154     376    8674
> 
> Hmm, I guess maybe not that bad. I might actually do that :-).

Cool! I _bet_ you will find a lot of bugs ;)

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