public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Michael Lyle <mlyle@lyle.org>,
	linux-bcache@vger.kernel.org, linux-block@vger.kernel.org
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Subject: Re: [for-416 PATCH 1/2] bcache: Fix, improve efficiency of closure_sync()
Date: Fri, 5 Jan 2018 09:05:14 -0700	[thread overview]
Message-ID: <cfee0947-24bd-c45a-5219-81ae6a208069@kernel.dk> (raw)
In-Reply-To: <20171230230934.910-1-mlyle@lyle.org>

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().

-- 
Jens Axboe

  parent reply	other threads:[~2018-01-05 16:05 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 ` Jens Axboe [this message]
2018-01-05 17:15   ` [for-416 PATCH 1/2] bcache: Fix, improve efficiency of closure_sync() Michael Lyle
2018-01-05 19:06     ` Kent Overstreet

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=cfee0947-24bd-c45a-5219-81ae6a208069@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=kent.overstreet@gmail.com \
    --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