Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268397AbUIQMrh (ORCPT ); Fri, 17 Sep 2004 08:47:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268716AbUIQMrh (ORCPT ); Fri, 17 Sep 2004 08:47:37 -0400 Received: from sd291.sivit.org ([194.146.225.122]:60128 "EHLO sd291.sivit.org") by vger.kernel.org with ESMTP id S268397AbUIQMrf (ORCPT ); Fri, 17 Sep 2004 08:47:35 -0400 Date: Fri, 17 Sep 2004 14:48:15 +0200 From: Stelian Pop To: Duncan Sands Cc: Hugh Dickins , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [RFC, 2.6] a simple FIFO implementation Message-ID: <20040917124815.GE3089@crusoe.alcove-fr> Reply-To: Stelian Pop Mail-Followup-To: Stelian Pop , Duncan Sands , Hugh Dickins , Andrew Morton , linux-kernel@vger.kernel.org References: <20040917102413.GA3089@crusoe.alcove-fr> <20040917122400.GD3089@crusoe.alcove-fr> <200409171437.57766.baldrick@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200409171437.57766.baldrick@free.fr> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1117 Lines: 31 On Fri, Sep 17, 2004 at 02:37:57PM +0200, Duncan Sands wrote: > > + * Note that with only one concurrent reader and one concurrent > > + * writer, you don't need extra locking to use these functions. > ^^^^^ which functions? (ambiguous) Well, the same comment is for two adjacent functions, so I don't think it's so ambiguous. Or s/these/this/ if you prefer. > And what does "extra locking" mean? Some kind of locking, like the one the wrapper kfifo_get/kfifo_put propose. > > + len = min(len, fifo->size - fifo->in + fifo->out); > > After all, since you are reading both in and out here, some kind of > locking is needed. But the order in which in and out get modified guarantees that you will still have a coherent content (provided the assignments are atomic, which they are). Stelian. -- Stelian Pop - 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/