LKML Archive on
help / color / mirror / Atom feed
From: Mike Snitzer <>
To: Mikulas Patocka <>,
	Peter Zijlstra <>
Cc: Christoph Hellwig <>,,
	Daniel Wagner <>,,,
	Thomas Gleixner <>
Subject: Re: [PATCH 1/2] swait: export the symbols __prepare_to_swait and __finish_swait
Date: Fri, 18 May 2018 17:03:23 -0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, Nov 23 2017 at  5:27pm -0500,
Mikulas Patocka <> wrote:

> On Thu, 23 Nov 2017, Christoph Hellwig wrote:
> > Please run this past the swait authors.  It is supposed to be a simple
> > and self-contained API so I'd expect this patch to be seen critical.
> I already sent it to Peter Zijlstra and didn't get a response yet.
> > You might be better off to just use the normal complex waitqueues if
> > you want to micro-optimize like this.
> If we wanted to micro-optimize, we should use the simpler wait queue 
> variant.
> If these functions are not supposed to be used by others, then
> - why are they in in file swait.h?
> - why does the implementation export swake_up_locked which assumes that 
> someone else will lock the spinlock before calling it?


I'd like to get this patch upstream.  I'm happy to send it to Linus via
linux-dm.git but I wanted to check with others who might care more
deeply about swait interfaces to get their Ack (or otherwise):

Here is Mikulas' DM driver code that makes use of __prepare_to_swait()
and __finish_swait():

static int writecache_endio_thread(void *data)
        struct dm_writecache *wc = data;

        while (1) {
                struct list_head list;

                if (!list_empty(&wc->endio_list))
                        goto pop_from_list;
                __prepare_to_swait(&wc->endio_thread_wait, &wait);

                if (unlikely(kthread_should_stop())) {
                        finish_swait(&wc->endio_thread_wait, &wait);


                __finish_swait(&wc->endio_thread_wait, &wait);
                goto continue_locked;

                list = wc->endio_list;
      >prev = list.prev->next = &list;

      reply	other threads:[~2018-05-18 21:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2017-11-23  8:28 ` [dm-devel] [PATCH 1/2] swait: export the symbols __prepare_to_swait and __finish_swait Christoph Hellwig
2017-11-23 22:27   ` Mikulas Patocka
2018-05-18 21:03     ` Mike Snitzer [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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \

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