From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changli Gao Subject: Re: [PATCH] fs: use kmalloc() to allocate fdmem if possible Date: Mon, 3 May 2010 15:05:59 +0800 Message-ID: References: <1272818776-7729-1-git-send-email-xiaosuo@gmail.com> <4BDDB6E9.4060703@redhat.com> <201005030915.FCD09385.FFHVOMJtSLOFQO@I-love.SAKURA.ne.jp> <4BDE67DA.4080004@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Tetsuo Handa , jslaby@suse.cz, akpm@linux-foundation.org, paulmck@linux.vnet.ibm.com, adobriyan@gmail.com, mingo@elte.hu, peterz@infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Avi Kivity Return-path: Received: from mail-pv0-f174.google.com ([74.125.83.174]:63510 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753223Ab0ECHGU convert rfc822-to-8bit (ORCPT ); Mon, 3 May 2010 03:06:20 -0400 In-Reply-To: <4BDE67DA.4080004@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, May 3, 2010 at 2:06 PM, Avi Kivity wrote: > > My point is, vmalloc() and vfree should do this, not their callers: > > vmalloc(size): > =C2=A0 =C2=A0if (size <=3D PAGE_SIZE) > =C2=A0 =C2=A0 =C2=A0 =C2=A0return kmalloc(size, GFP_KERNEL); > =C2=A0 =C2=A0... > > vfree(p): > =C2=A0 =C2=A0if (!is_vmalloc_addr(p) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0kfree(p); > =C2=A0 =C2=A0 =C2=A0 =C2=A0return; > =C2=A0 =C2=A0} > =C2=A0 =C2=A0... I think we should not change vmalloc/vfree, and you can invent new memory APIs, such as malloc()/free(). --=20 Regards=EF=BC=8C Changli Gao(xiaosuo@gmail.com) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html