All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Daniel Wagner <wagi@monom.org>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Wagner <daniel.wagner@bmw-carit.de>
Subject: Re: [RFC v0] Use swait in completion
Date: Tue, 8 Mar 2016 18:52:06 +0100	[thread overview]
Message-ID: <20160308175206.GD21842@linutronix.de> (raw)
In-Reply-To: <1457452754-24029-1-git-send-email-wagi@monom.org>

* Daniel Wagner | 2016-03-08 16:59:13 [+0100]:

>Hi,
Hi,

>As Peter correctly pointed out in [1] a simple conversion from
>wait to swait in completion.c wont work. I played a bit around and
>came up with this rather ugly idea.

besides all the things I mentioned privatly, here is what I have
currently in -RT:

+void swake_up_all_locked(struct swait_queue_head *q)
+{
+       struct swait_queue *curr;
+       int wakes = 0;
+
+       while (!list_empty(&q->task_list)) {
+
+               curr = list_first_entry(&q->task_list, typeof(*curr),
+                                       task_list);
+               wake_up_process(curr->task);
+               list_del_init(&curr->task_list);
+               wakes++;
+       }
+       WARN_ON(wakes > 2);
+}
+EXPORT_SYMBOL(swake_up_all_locked);

the remaining part is what you have. The only user so far is complete()
and currently I see ony complete_all() with zero or one waiter.
If none of my boxes die over the night, I intend to release this
tomorrow in -RT and see if someone else triggers the limit.

However I don't think if your DEFER flag solution is all that bad. I
have also the block-mq in -RT using swait and they perform wakes with
irqs-off. Not in -RT but mainline. So me might need something to make it
work properly. But if we defer the wakeup they might come at us and
complain about the latency…

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Daniel Wagner <wagi@monom.org>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Wagner <daniel.wagner@bmw-carit.de>
Subject: Re: [RFC v0] Use swait in completion
Date: Tue, 8 Mar 2016 18:52:06 +0100	[thread overview]
Message-ID: <20160308175206.GD21842@linutronix.de> (raw)
In-Reply-To: <1457452754-24029-1-git-send-email-wagi@monom.org>

* Daniel Wagner | 2016-03-08 16:59:13 [+0100]:

>Hi,
Hi,

>As Peter correctly pointed out in [1] a simple conversion from
>wait to swait in completion.c wont work. I played a bit around and
>came up with this rather ugly idea.

besides all the things I mentioned privatly, here is what I have
currently in -RT:

+void swake_up_all_locked(struct swait_queue_head *q)
+{
+       struct swait_queue *curr;
+       int wakes = 0;
+
+       while (!list_empty(&q->task_list)) {
+
+               curr = list_first_entry(&q->task_list, typeof(*curr),
+                                       task_list);
+               wake_up_process(curr->task);
+               list_del_init(&curr->task_list);
+               wakes++;
+       }
+       WARN_ON(wakes > 2);
+}
+EXPORT_SYMBOL(swake_up_all_locked);

the remaining part is what you have. The only user so far is complete()
and currently I see ony complete_all() with zero or one waiter.
If none of my boxes die over the night, I intend to release this
tomorrow in -RT and see if someone else triggers the limit.

However I don't think if your DEFER flag solution is all that bad. I
have also the block-mq in -RT using swait and they perform wakes with
irqs-off. Not in -RT but mainline. So me might need something to make it
work properly. But if we defer the wakeup they might come at us and
complain about the latency…

Sebastian

  parent reply	other threads:[~2016-03-08 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 15:59 [RFC v0] Use swait in completion Daniel Wagner
2016-03-08 15:59 ` [RFC v0] sched/completion: convert completions to use simple wait queues Daniel Wagner
2016-03-08 17:52 ` Sebastian Andrzej Siewior [this message]
2016-03-08 17:52   ` [RFC v0] Use swait in completion Sebastian Andrzej Siewior
2016-03-08 18:07   ` Daniel Wagner
2016-03-08 18:07     ` Daniel Wagner
2016-03-08 18:26   ` Josh Cartwright
2016-03-09 12:24     ` Sebastian Andrzej Siewior
2016-03-28 18:57       ` Steven Rostedt
2016-03-31  6:14         ` Daniel Wagner

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=20160308175206.GD21842@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=wagi@monom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.