LKML Archive on
help / color / mirror / Atom feed
From: David Howells <>
To: Oleg Nesterov <>
Cc:, Andrew Morton <>,
	Dmitry Torokhov <>,
	Jiri Pirko <>,
	"Paul E. McKenney" <>,
	Peter Zijlstra <>,
Subject: Re: [RFC,PATCH] workqueues: turn queue_work() into the "barrier" for work->func()
Date: Tue, 11 Nov 2008 22:46:21 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Oleg Nesterov <> wrote:

> I think the caller of queue_work() has all rights to expect that
> the next invocation of work_func() must see "VAR == 1", but this
> is not true if the work is already pending.

As you said, queue_work() does test_and_set_bit() which implies smp_mb()
either side of the function, so you're half way there, and run_workqueue()
calls spin_unlock_irq() just before calling work_clear_pending()...  So might
it make sense to move the work_clear_pending() into locked section?  Or would
that require an smp_mb__before_clear_bit()?


  reply	other threads:[~2008-11-11 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 20:33 Oleg Nesterov
2008-11-11 22:46 ` David Howells [this message]
2008-11-12 11:58   ` Oleg Nesterov

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [RFC,PATCH] workqueues: turn queue_work() into the "barrier" for work->func()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).