All of lore.kernel.org
 help / color / mirror / Atom feed
* futex code and barriers
@ 2008-04-29 11:57 Peter Zijlstra
  2008-04-29 12:43 ` Jiri Kosina
  2008-04-29 13:13 ` Oleg Nesterov
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Zijlstra @ 2008-04-29 11:57 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Paul E McKenney, Oleg Nesterov,
	Nick Piggin
  Cc: linux-kernel

Hi All,

While looking through the futex code I stumbled upon the following bit:

kernel/futex.c:

	/* add_wait_queue is the barrier after __set_current_state. */
	__set_current_state(TASK_INTERRUPTIBLE);
	add_wait_queue(&q.waiters, &wait);


However,

void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
{
	unsigned long flags;

	wait->flags &= ~WQ_FLAG_EXCLUSIVE;
	spin_lock_irqsave(&q->lock, flags);
	__add_wait_queue(q, wait);
	spin_unlock_irqrestore(&q->lock, flags);
}

static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
{
	list_add(&new->task_list, &head->task_list);
}

static inline void list_add(struct list_head *new, struct list_head *head)
{
	__list_add(new, head, head->next);
}

static inline void __list_add(struct list_head *new,
			      struct list_head *prev,
			      struct list_head *next)
{
	next->prev = new;
	new->next = next;
	new->prev = prev;
	prev->next = new;
}

Non of which implies a full barrier.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-29 13:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-29 11:57 futex code and barriers Peter Zijlstra
2008-04-29 12:43 ` Jiri Kosina
2008-04-29 12:49   ` Peter Zijlstra
2008-04-29 13:13 ` Oleg Nesterov

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.