From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] fs: use kmalloc() to allocate fdmem if possible Date: Mon, 03 May 2010 10:42:30 +0300 Message-ID: <4BDE7E66.8030509@redhat.com> 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; format=flowed Content-Transfer-Encoding: 7bit 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: Changli Gao Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 05/03/2010 10:05 AM, Changli Gao wrote: > 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): >> if (size<= PAGE_SIZE) >> return kmalloc(size, GFP_KERNEL); >> ... >> >> vfree(p): >> if (!is_vmalloc_addr(p) { >> kfree(p); >> return; >> } >> ... >> > I think we should not change vmalloc/vfree, and you can invent new > memory APIs, such as malloc()/free(). > Why? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.