Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 24 Apr 2001 11:41:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 24 Apr 2001 11:41:24 -0400 Received: from neon-gw.transmeta.com ([209.10.217.66]:31248 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Tue, 24 Apr 2001 11:41:11 -0400 Date: Tue, 24 Apr 2001 08:40:58 -0700 (PDT) From: Linus Torvalds To: David Howells cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] rw_semaphores, optimisations try #3 In-Reply-To: <6182.988106720@warthog.cambridge.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Apr 2001, David Howells wrote: > > Yes but the "struct rwsem_waiter" batch would have to be entirely deleted from > the list before any of them are woken, otherwise the waking processes may > destroy their "rwsem_waiter" blocks before they are dequeued (this destruction > is not guarded by a spinlock). Look again. Yes, they may destroy the list, but nobody cares. Why? - nobody will look up the list because we do have the spinlock at this point, so a destroyed list doesn't actually _matter_ to anybody You were actually depending on this earlier, although maybe not on purpose. - list_remove_between() doesn't care about the integrity of the entries it destroys. It only uses, and only changes, the entries that are still on the list. Subtlety is fine. It might warrant a comment, though. Linus - 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/