Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268346AbUIHPkA (ORCPT ); Wed, 8 Sep 2004 11:40:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268298AbUIHPkA (ORCPT ); Wed, 8 Sep 2004 11:40:00 -0400 Received: from bay-bridge.veritas.com ([143.127.3.10]:63133 "EHLO MTVMIME02.enterprise.veritas.com") by vger.kernel.org with ESMTP id S268346AbUIHPj6 (ORCPT ); Wed, 8 Sep 2004 11:39:58 -0400 Date: Wed, 8 Sep 2004 16:39:43 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@localhost.localdomain To: "Paul E. McKenney" cc: cmm@us.ibm.com, , , Subject: Re: [RFC][PATCH] Put size in array to get rid of barriers in grow_ary() In-Reply-To: <20040907230936.GA13387@us.ibm.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 Content-Length: 1110 Lines: 32 On Tue, 7 Sep 2004, Paul E. McKenney wrote: > > The grow_ary() code has a number of explicit memory barriers, as does > ipc_lock(). This patch gets rid of the need for some of these by > placing the array size in the same block of memory containing the > array itself, so that the array and the size cannot possibly get out > of sync. Also uses rcu_assign_pointer() to get rid of the remaining > smp_wmb(). But Paul, if you keep removing all these examples of memory barriers, how can I be expected to learn how to use them properly? Seriously, good, yes, the fewer "mb"s the better. I could always educate myself from the older source. > Untested, therefore probably broken. Agreed ;) > Thoughts? Wouldn't it be a little nicer to start ipc_ids off pointing to a const ipc_id_ary of size 0, to avoid the various entries == NULL tests you had to add? Hugh - 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/