From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757337AbYD2L5z (ORCPT ); Tue, 29 Apr 2008 07:57:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753531AbYD2L5r (ORCPT ); Tue, 29 Apr 2008 07:57:47 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:46498 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753429AbYD2L5q (ORCPT ); Tue, 29 Apr 2008 07:57:46 -0400 Subject: futex code and barriers From: Peter Zijlstra To: Thomas Gleixner , Ingo Molnar , Paul E McKenney , Oleg Nesterov , Nick Piggin Cc: linux-kernel Content-Type: text/plain Date: Tue, 29 Apr 2008 13:57:16 +0200 Message-Id: <1209470236.13978.55.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.22.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.