From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changli Gao Subject: Re: [RFC] sched: implement the exclusive wait queue as a LIFO queue Date: Wed, 28 Apr 2010 19:17:29 +0800 Message-ID: References: <1272430986-20436-1-git-send-email-xiaosuo@gmail.com> <20100428081545.GA19027@windriver.com> <8482.1272446987@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: 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: David Howells Return-path: Received: from mail-pz0-f204.google.com ([209.85.222.204]:46276 "EHLO mail-pz0-f204.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752889Ab0D1LRt convert rfc822-to-8bit (ORCPT ); Wed, 28 Apr 2010 07:17:49 -0400 In-Reply-To: <8482.1272446987@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Apr 28, 2010 at 5:29 PM, David Howells wr= ote: > Changli Gao wrote: > >> If there isn't enough work to be done, we'd better not disrupt them >> and =C2=A0leave them sleeping forever to keep the scheduler happier.= Do we >> have reason to keep fair to all the workers? Does it have benefit? > > You've made one important assumption: the processes on the wait queue= are > sleeping waiting to service things... but what if the wait queue gove= rns > access to a resource, and all the processes on that wait queue need a= ccess to > that resource to do things? =C2=A0Some of the processes waiting for i= t may never > get a go, and so necessary work may be left undone. > 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 |=3D WQ_FLAG_EXCLUSIVE; __add_wait_queue(&ep->wq, &wait); --=20 Regards=EF=BC=8C Changli Gao(xiaosuo@gmail.com) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html