mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Chris Mason <clm@fb.com>, Steven Rostedt <rostedt@goodmis.org>,
	fredrik.markstrom@windriver.com, linux-kernel@vger.kernel.org,
	Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 1/2] sched: lockless wake-queues
Date: Mon, 20 Apr 2015 16:42:35 +0200	[thread overview]
Message-ID: <20150420144235.GX27490@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <1429471060-21271-2-git-send-email-dave@stgolabs.net>

On Sun, Apr 19, 2015 at 12:17:39PM -0700, Davidlohr Bueso wrote:
> +void wake_q_add(struct wake_q_head *head, struct task_struct *task)
> +{
> +	struct wake_q_node *node = &task->wake_q;
> +
> +	/*
> +	 * Atomically grab the task, if ->wake_q is !nil already it means
> +	 * its already queued (either by us or someone else) and will get the
> +	 * wakeup due to that.
> +	 *
> +	 * This cmpxchg() implies a full barrier, which pairs with the write
> +	 * barrier implied by the wakeup in wake_up_list().
> +	 */
> +	if (cmpxchg(&node->next, NULL, WAKE_Q_TAIL))
> +		return;
> +
> +	get_task_struct(task);
> +
> +	/*
> +	 * The head is context local, there can be no concurrency.
> +	 */
> +	if (head->first == WAKE_Q_TAIL)
> +		head->first = node;
> +	else
> +		head->last->next = node;
> +
> +	head->last = node;
> +}

Do we want a sched_feat() that makes the above to an immediate wake-up
instead of the fancy thing? -- just for debuging/performance
measurements like things?

  reply	other threads:[~2015-04-20 14:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-19 19:17 [PATCH 0/2] " Davidlohr Bueso
2015-04-19 19:17 ` [PATCH 1/2] sched: " Davidlohr Bueso
2015-04-20 14:42   ` Peter Zijlstra [this message]
2015-04-19 19:17 ` [PATCH 2/2] futex: lockless wakeups Davidlohr Bueso
2015-04-20  6:18   ` Ingo Molnar
2015-04-20 13:55     ` Davidlohr Bueso
2015-04-20 14:57       ` Peter Zijlstra
2015-04-20 17:31         ` Davidlohr Bueso
2015-04-20 16:04   ` Linus Torvalds
2015-04-20 18:24 [PATCH 1/2] sched: lockless wake-queues George Spelvin
2015-04-20 20:08 ` Davidlohr Bueso
2015-04-21  1:39   ` George Spelvin

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=20150420144235.GX27490@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bigeasy@linutronix.de \
    --cc=clm@fb.com \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=fredrik.markstrom@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

Powered by JetHome