Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754669Ab0D1GXL (ORCPT ); Wed, 28 Apr 2010 02:23:11 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:59684 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754585Ab0D1GXJ (ORCPT ); Wed, 28 Apr 2010 02:23:09 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=KhBltZ/VuN3mfh2+kvaar6LEg+7rV0V/ufz8OvWxjSdLBpk53hBpSs9JV2W/N5trhM IbpOqToe59ff4uRwlKhCX27EKQU0Te2JYhvZ7EI+GDPl4m+A6HSCxLwvw7fNZwrtTGzx JYprUTo+BBp++TfvcgNavr7lg3s0G0ivUFs70= MIME-Version: 1.0 In-Reply-To: <1272430986-20436-1-git-send-email-xiaosuo@gmail.com> References: <1272430986-20436-1-git-send-email-xiaosuo@gmail.com> From: Changli Gao Date: Wed, 28 Apr 2010 14:22:48 +0800 Message-ID: Subject: Re: [RFC] sched: implement the exclusive wait queue as a LIFO queue To: Ingo Molnar Cc: 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 , David Howells , Takashi Iwai , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Changli Gao Content-Type: multipart/mixed; boundary=000e0cd13aba28f69f0485460bf7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8338 Lines: 128 --000e0cd13aba28f69f0485460bf7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Apr 28, 2010 at 1:03 PM, Changli Gao wrote: > > =C2=A0static inline int waitqueue_active(wait_queue_head_t *q) > =C2=A0{ > - =C2=A0 =C2=A0 =C2=A0 return !list_empty(&q->task_list); > + =C2=A0 =C2=A0 =C2=A0 return !list_empty(&q->task_list) || !list_empty(&= q->task_list); > =C2=A0} > I am sorry. the later task_list should be task_list_ex. The updated patch is attached. And I will replace task_list list with hlist for saving space. --=20 Regards=EF=BC=8C Changli Gao(xiaosuo@gmail.com) --000e0cd13aba28f69f0485460bf7 Content-Type: text/plain; charset=US-ASCII; name="wq-ex-lifo.diff" Content-Disposition: attachment; filename="wq-ex-lifo.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g8jre0j50 ZGlmZiAtLWdpdCBhL2ZzL2V2ZW50cG9sbC5jIGIvZnMvZXZlbnRwb2xsLmMKaW5kZXggYmQwNTZh NS4uZTliM2ViZSAxMDA2NDQKLS0tIGEvZnMvZXZlbnRwb2xsLmMKKysrIGIvZnMvZXZlbnRwb2xs LmMKQEAgLTExNDAsOCArMTE0MCw3IEBAIHJldHJ5OgogCQkgKiBlcF9wb2xsX2NhbGxiYWNrKCkg d2hlbiBldmVudHMgd2lsbCBiZWNvbWUgYXZhaWxhYmxlLgogCQkgKi8KIAkJaW5pdF93YWl0cXVl dWVfZW50cnkoJndhaXQsIGN1cnJlbnQpOwotCQl3YWl0LmZsYWdzIHw9IFdRX0ZMQUdfRVhDTFVT SVZFOwotCQlfX2FkZF93YWl0X3F1ZXVlKCZlcC0+d3EsICZ3YWl0KTsKKwkJX19hZGRfd2FpdF9x dWV1ZV9leCgmZXAtPndxLCAmd2FpdCk7CiAKIAkJZm9yICg7OykgewogCQkJLyoKZGlmZiAtLWdp dCBhL2luY2x1ZGUvbGludXgvd2FpdC5oIGIvaW5jbHVkZS9saW51eC93YWl0LmgKaW5kZXggYTQ4 ZTE2Yi4uODM5ZGIzMyAxMDA2NDQKLS0tIGEvaW5jbHVkZS9saW51eC93YWl0LmgKKysrIGIvaW5j bHVkZS9saW51eC93YWl0LmgKQEAgLTMwLDggKzMwLDYgQEAgdHlwZWRlZiBp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XNwaW5fdW5sb2NrX2ly cXJlc3RvcmUoJnEtPmxvY2ssIGZsYWdzKTsKIH0K --000e0cd13aba28f69f0485460bf7-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/