public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Roman Penyaev <roman.penyaev@profitbricks.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Howells <dhowells@redhat.com>
Subject: Re: [PATCH 1/1] [RFC] workqueue: fix ghost PENDING flag while doing MQ IO
Date: Mon, 25 Apr 2016 13:51:15 -0400	[thread overview]
Message-ID: <20160425175115.GC7822@mtj.duckdns.org> (raw)
In-Reply-To: <CAJrWOzBtqY2ngy3HA-53XX1o-=dUB0u3RPHX38O=S4C-ozdq4g@mail.gmail.com>

Hello, Roman.

On Mon, Apr 25, 2016 at 07:39:52PM +0200, Roman Penyaev wrote:
> Ok, that's clear now. Thanks. I was confused also by a spin lock, which
> is being released just after clear pending:
> 
>    set_work_pool_and_clear_pending(work, pool->id);
>    spin_unlock_irq(&pool->lock);
>    ...
>    worker->current_func(work);
> 
> But seems memory operations of execution can leak-in and appear before
> pended bit is cleared and spin lock is released.
> (according to Documentation/memory-barriers.txt, (6) RELEASE operations)

Yeap, release doesn't prevent following reads from creeping ahead of
it.

> Tejun, do you need an updated patch for that? With a proper smp_mb()?

Yes, can you please also add comment explaining what the mb is
interlocking?

Thanks a lot!

-- 
tejun

  reply	other threads:[~2016-04-25 17:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 15:22 [PATCH 1/1] [RFC] workqueue: fix ghost PENDING flag while doing MQ IO Roman Pen
2016-04-25 15:48 ` Tejun Heo
2016-04-25 16:00   ` Tejun Heo
2016-04-25 16:40     ` Roman Penyaev
2016-04-25 16:34   ` Roman Penyaev
2016-04-25 17:03     ` Tejun Heo
2016-04-25 17:39       ` Roman Penyaev
2016-04-25 17:51         ` Tejun Heo [this message]
2016-04-26  1:22   ` Peter Hurley
2016-04-26 15:15     ` Tejun Heo
2016-04-26 17:27       ` Peter Hurley
2016-04-26 17:45         ` Tejun Heo
2016-04-26 20:07           ` Peter Hurley
2016-04-27  5:50           ` Hannes Reinecke
2016-04-27 19:05             ` Tejun Heo

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=20160425175115.GC7822@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=dhowells@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roman.penyaev@profitbricks.com \
    /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