[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20061218165119.8cd8e7e4.akpm@osdl.org>
Date: Mon, 18 Dec 2006 16:51:19 -0800
From: Andrew Morton <akpm@...l.org>
To: Oleg Nesterov <oleg@...sign.ru>
Cc: David Howells <dhowells@...hat.com>,
Christoph Hellwig <hch@...radead.org>,
Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...l.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH, RFC rc1-mm1] implement flush_work()
On Mon, 18 Dec 2006 23:17:14 +0300
Oleg Nesterov <oleg@...sign.ru> wrote:
> Add ->current_work to the "struct cpu_workqueue_struct", it points to
> currently running "struct queue_work". When flush_work(work) detects
> ->current_work == work, it inserts a barrier at the _head_ of ->worklist
> (and thus right _after_ that work) and waits for completition. This means
> that the next work fired on that CPU will be this barrier, or another
> barrier queued by concurrent flush_work(), so the caller of flush_work()
> will be woken before any "regular" work has a chance to run.
>
> Since __queue_work() does both set_wq_data() and list_add_tail() atomically
> under cwq->lock, flush_work() can remove the pending work from queue when
> it sees "get_wq_data(work) == cwq".
Seems sane.
> NOTE: flush_work() doesn't like no-auto-release works. Unless they go away
> we can fix this later or add the "don't do this" comment.
Yes, let's make the _NAR stuff go away pleeeeze. It's fairly
straightforward, and is on my todo list somewhere.
-
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