From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [RFC] sched: implement the exclusive wait queue as a LIFO queue Date: Wed, 28 Apr 2010 14:21:02 +0100 Message-ID: <12671.1272460862@redhat.com> References: <1272430986-20436-1-git-send-email-xiaosuo@gmail.com> <20100428081545.GA19027@windriver.com> <8482.1272446987@redhat.com> Cc: dhowells@redhat.com, Yong Zhang , Xiaotian Feng , Ingo Molnar , Alexander Viro , Andrew Morton , "Eric W. Biederman" , Davide Libenzi , Roland Dreier , Stefan Richter , Peter Zijlstra , "David S. Miller" , Eric Dumazet , Christoph Lameter , Andreas Herrmann , Thomas Gleixner , Takashi Iwai , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Changli Gao Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Changli Gao wrote: > You are right. I made the wrong assumption. But we indeed need some > primitive to add wait_queue at the head of the wait_queue_head, and I > know epoll needs it, at least. > > fs/eventpoll.c: 1443. > wait.flags |= WQ_FLAG_EXCLUSIVE; > __add_wait_queue(&ep->wq, &wait); You can add at either end of the wait queue with __add_wait_queue() and __add_wait_queue_tail(). David