linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Overstreet <kent.overstreet@gmail.com>
To: Michael Lyle <mlyle@lyle.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-bcache@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [for-416 PATCH 1/2] bcache: Fix, improve efficiency of closure_sync()
Date: Fri, 5 Jan 2018 14:06:42 -0500	[thread overview]
Message-ID: <20180105190642.GA25569@moria.home.lan> (raw)
In-Reply-To: <dd2e9b62-684e-93fa-a827-7a12802993ce@lyle.org>

On Fri, Jan 05, 2018 at 09:15:41AM -0800, Michael Lyle wrote:
> Jens & Kent,
> 
> On 01/05/2018 08:05 AM, Jens Axboe wrote:
> > On 12/30/17 4:09 PM, Michael Lyle wrote:
> >> +void __closure_sync(struct closure *cl)
> >> +{
> >> +	struct closure_syncer s = { .task = current };
> >>  
> >> +	cl->s = &s;
> >> +	continue_at(cl, closure_sync_fn, NULL);
> >> +
> >> +	while (1) {
> >> +		__set_current_state(TASK_UNINTERRUPTIBLE);
> >> +		smp_mb(); /* Ensure task state set before load of done flag */
> > 
> > That's why we have set_current_state().
> > 
> 
> I wrote the comment in question-- it seemed like to me set_current_state
> and a store w/ barrier, but I was nervous since I didn't write the code
> that there might be another dependency/reason.
> 
> Kent-- is there any reason to not just set_current_state(...)?

No, set_current_state() is the right way to do it

      reply	other threads:[~2018-01-05 19:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-30 23:09 [for-416 PATCH 1/2] bcache: Fix, improve efficiency of closure_sync() Michael Lyle
2017-12-30 23:09 ` [for-416 PATCH 2/2] bcache: mark closure_sync() __sched Michael Lyle
2018-01-05 16:05 ` [for-416 PATCH 1/2] bcache: Fix, improve efficiency of closure_sync() Jens Axboe
2018-01-05 17:15   ` Michael Lyle
2018-01-05 19:06     ` Kent Overstreet [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=20180105190642.GA25569@moria.home.lan \
    --to=kent.overstreet@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mlyle@lyle.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;
as well as URLs for NNTP newsgroup(s).