From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [PATCH] reduce fragmentation due to kmem_cache_alloc_node From: Badari Pulavarty In-Reply-To: <41684BF3.5070108@colorfullife.com> References: <41684BF3.5070108@colorfullife.com> Content-Type: text/plain Message-Id: <1097863727.2861.43.camel@dyn318077bld.beaverton.ibm.com> Mime-Version: 1.0 Date: 15 Oct 2004 11:08:48 -0700 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Manfred Spraul Cc: Andrew Morton , linux-mm@kvack.org, Linux Kernel Mailing List List-ID: Manfred & Andrew, I am happy with the patch.This seems to have fixed slab fragmentation problem with scsi_debug tests. But I still have issue with my scsi-debug tests. I don't think they are related to this patch. When I do, while : do simulate 1000 scsi-debug disks freeup 1000 scsi-debug disks done I see size-64 "inuse" objects increasing. Eventually, it fills up entire low-mem. I guess while freeing up scsi-debug disks, is not cleaning up all the allocations :( But one question I have is - Is it possible to hold size-64 slab, because it has a management allocation (slabp - 40 byte allocations) from alloc_slabmgmt() ? I remember seeing this earlier. Is it worth moving all managment allocations to its own slab ? should I try it ? Thanks, Badari On Sat, 2004-10-09 at 13:37, Manfred Spraul wrote: > Hi Andrew, > > attached is a patch that fixes the fragmentation that Badri noticed with > kmem_cache_alloc_node. Could you add it to the mm tree? The patch is > against 2.6.9-rc3-mm3. > > Description: > kmem_cache_alloc_node tries to allocate memory from a given node. The > current implementation contains two bugs: > - the node aware code was used even for !CONFIG_NUMA systems. Fix: > inline function that redefines kmem_cache_alloc_node as kmem_cache_alloc > for !CONFIG_NUMA. > - the code always allocated a new slab for each new allocation. This > caused severe fragmentation. Fix: walk the slabp lists and search for a > matching page instead of allocating a new page. > - the patch also adds a new statistics field for node-local allocs. They > should be rare - the codepath is quite slow, especially compared to the > normal kmem_cache_alloc. > > Badri: Could you test it? > Andrew, could you add the patch to the next -mm kernel? I'm running it > right now, no obvious problems. > > Signed-Off-By: Manfred Spraul -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: aart@kvack.org