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: <4986B684.5000506@s5r6.in-berlin.de>
Date:	Mon, 02 Feb 2009 10:01:56 +0100
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	Arjan van de Ven <arjan@...radead.org>
CC:	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [RFC][PATCH] create workqueue threads only when needed

Arjan van de Ven wrote:
> On Mon, 02 Feb 2009 08:37:41 +1100
> Benjamin Herrenschmidt <benh@...nel.crashing.org> wrote:
>> That's were thread pools kick in ... tried using Dave Howells slow
>> work ?
> 
> async function calls are pretty much the same and actually in mainlinme.
> Dave Howells stuff in addition plays some extremely weird refcounting
> games that I cannot imagine anyone but him needing...

I haven't looked at this particular slow-work implementation.  Do you
refer to some internal refcounting or to some refcounting as a service
for the API user?

IME, scheduling work and executing work is often accompanied by
reference counting of this sort:

static int schedule_delayed_work_wrapper(struct foo *container,
					 unsigned long delay)
{
	int scheduled;

	foo_get(container);
	scheduled = schedule_delayed_work(&container->work, delay);
	if (!scheduled)
		foo_put(container);

	return scheduled;
}

static void foo_work(struct work_struct *work)
{
	struct foo *container =
			container_of(work, struct foo, work.work);

	do_the_work;

	foo_put(container);
}

But I think that whenever there are additional call sites of
foo_put(container), this refcounting of container_of(work, ...) cannot
be easily generalized.
-- 
Stefan Richter
-=====-==--= --=- ---=-
http://arcgraph.de/sr/
--
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