public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: David Howells <dhowells@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, Linus Torvalds <torvalds@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH, RFC rc1-mm1] implement flush_work()
Date: Mon, 18 Dec 2006 16:51:19 -0800	[thread overview]
Message-ID: <20061218165119.8cd8e7e4.akpm@osdl.org> (raw)
In-Reply-To: <20061218201714.GA501@tv-sign.ru>

On Mon, 18 Dec 2006 23:17:14 +0300
Oleg Nesterov <oleg@tv-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.

      reply	other threads:[~2006-12-19  0:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-18 20:17 [PATCH, RFC rc1-mm1] implement flush_work() Oleg Nesterov
2006-12-19  0:51 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061218165119.8cd8e7e4.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox