From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757358Ab0DGSGM (ORCPT ); Wed, 7 Apr 2010 14:06:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41647 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751692Ab0DGSGK (ORCPT ); Wed, 7 Apr 2010 14:06:10 -0400 Date: Wed, 07 Apr 2010 20:06:06 +0200 Message-ID: From: Takashi Iwai To: Daniel Mack Cc: Alan Stern , Greg KH , linux-kernel@vger.kernel.org, Pedro Ribeiro , akpm@linux-foundation.org, Greg KH , alsa-devel@alsa-project.org, linux-usb@vger.kernel.org Subject: Re: USB transfer_buffer allocations on 64bit systems In-Reply-To: <20100407175935.GN30801@buzzloop.caiaq.de> References: <20100407153154.GC13425@kroah.com> <20100407161603.GL30801@buzzloop.caiaq.de> <20100407175935.GN30801@buzzloop.caiaq.de> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Wed, 7 Apr 2010 19:59:35 +0200, Daniel Mack wrote: > > On Wed, Apr 07, 2010 at 07:55:20PM +0200, Takashi Iwai wrote: > > At Wed, 7 Apr 2010 18:16:03 +0200, > > Daniel Mack wrote: > > > > > > On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote: > > > > On Wed, 7 Apr 2010, Greg KH wrote: > > > > > > > > > Alan, any objection to just using usb_buffer_alloc() for every driver? > > > > > Or is that too much overhead? > > > > > > > > I don't know what the overhead is. But usb_buffer_alloc() requires the > > > > caller to keep track of the buffer's DMA address, so it's not a simple > > > > plug-in replacement. In addition, the consistent memory that > > > > usb_buffer_alloc() provides is a scarce resource on some platforms. > > > > > > > > Writing new functions is the way to go. > > > > > > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which > > > will just call kmalloc() with GFP_DMA32 for now. > > > > Can't we provide only zalloc() variant? Zero'ing doesn't cost much, > > and the buffer allocation shouldn't be called too often. > > > > > And while at it, > > > usb_alloc_buffer() will be renamed to usb_alloc_consistent(). > > > > Most of recent functions are named with "coherent". > > I agree to both points, will do so unless anyone has a harsh opinion > about that. > > Another thing: I guess we don't need a corresponding free() function > that just calls kfree(), right? Or should we introduce it now to be > flexible for future extensions? Well, I would implement the corresponding free. It could be simply a macro calling kfree(), but it's saner to provide it for API uniformity, IMO. thanks, Takashi From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: USB transfer_buffer allocations on 64bit systems Date: Wed, 07 Apr 2010 20:06:06 +0200 Message-ID: References: <20100407153154.GC13425@kroah.com> <20100407161603.GL30801@buzzloop.caiaq.de> <20100407175935.GN30801@buzzloop.caiaq.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 8077C103804 for ; Wed, 7 Apr 2010 20:06:09 +0200 (CEST) In-Reply-To: <20100407175935.GN30801@buzzloop.caiaq.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Daniel Mack Cc: alsa-devel@alsa-project.org, linux-usb@vger.kernel.org, Greg KH , Greg KH , linux-kernel@vger.kernel.org, Alan Stern , Pedro Ribeiro , akpm@linux-foundation.org List-Id: alsa-devel@alsa-project.org At Wed, 7 Apr 2010 19:59:35 +0200, Daniel Mack wrote: > > On Wed, Apr 07, 2010 at 07:55:20PM +0200, Takashi Iwai wrote: > > At Wed, 7 Apr 2010 18:16:03 +0200, > > Daniel Mack wrote: > > > > > > On Wed, Apr 07, 2010 at 11:55:19AM -0400, Alan Stern wrote: > > > > On Wed, 7 Apr 2010, Greg KH wrote: > > > > > > > > > Alan, any objection to just using usb_buffer_alloc() for every driver? > > > > > Or is that too much overhead? > > > > > > > > I don't know what the overhead is. But usb_buffer_alloc() requires the > > > > caller to keep track of the buffer's DMA address, so it's not a simple > > > > plug-in replacement. In addition, the consistent memory that > > > > usb_buffer_alloc() provides is a scarce resource on some platforms. > > > > > > > > Writing new functions is the way to go. > > > > > > Ok, I'll write some dummies for usb_malloc() and usb_zalloc() which > > > will just call kmalloc() with GFP_DMA32 for now. > > > > Can't we provide only zalloc() variant? Zero'ing doesn't cost much, > > and the buffer allocation shouldn't be called too often. > > > > > And while at it, > > > usb_alloc_buffer() will be renamed to usb_alloc_consistent(). > > > > Most of recent functions are named with "coherent". > > I agree to both points, will do so unless anyone has a harsh opinion > about that. > > Another thing: I guess we don't need a corresponding free() function > that just calls kfree(), right? Or should we introduce it now to be > flexible for future extensions? Well, I would implement the corresponding free. It could be simply a macro calling kfree(), but it's saner to provide it for API uniformity, IMO. thanks, Takashi