From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753910AbYKPFEW (ORCPT ); Sun, 16 Nov 2008 00:04:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750849AbYKPFEO (ORCPT ); Sun, 16 Nov 2008 00:04:14 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:51741 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750720AbYKPFEO (ORCPT ); Sun, 16 Nov 2008 00:04:14 -0500 Date: Sat, 15 Nov 2008 21:03:34 -0800 From: Andrew Morton To: Arjan van de Ven Cc: Lai Jiangshan , Paul Menage , kamezawa.hiroyu@jp.fujitsu.com, Balbir Singh , Jens Axboe , "David S. Miller" , Jan Kara , Jes Sorensen , Linux Kernel Mailing List Subject: Re: [PATCH 1/7] mm: introduce simple_malloc()/simple_free() Message-Id: <20081115210334.3870cdf6.akpm@linux-foundation.org> In-Reply-To: <20081115205229.765f7ee3@infradead.org> References: <491FA28B.2070003@cn.fujitsu.com> <20081115205229.765f7ee3@infradead.org> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 15 Nov 2008 20:52:29 -0800 Arjan van de Ven wrote: > On Sun, 16 Nov 2008 12:33:15 +0800 > Lai Jiangshan wrote: > > > > > some subsystem needs vmalloc() when required memory is large. > > but current kernel has not APIs for this requirement. > > this patch introduces simple_malloc() and simple_free(). > > Hi > > I kinda really don't like this approach. vmalloc() (and especially, > vfree()) is a really expensive operation, and vmalloc()'d memory is > also slower (due to tlb pressure). And it can fragment, which effectively means a dead box. > Realistically, people should try hard > to use small datastructure instead.... Yup, it makes it easier for people to do something which we strongly discourage. The risk got worse with all these 64-bit machines with vast amounts of virtual address space. It makes it easier for people to develop and "test" code which isn't reliable on smaller machines.