From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932502AbcA0NfL (ORCPT ); Wed, 27 Jan 2016 08:35:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:39643 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932145AbcA0NfI (ORCPT ); Wed, 27 Jan 2016 08:35:08 -0500 Subject: Re: [PATCH 16/16] mm/slab: introduce new slab management type, OBJFREELIST_SLAB To: Joonsoo Kim , Andrew Morton References: <1452749069-15334-1-git-send-email-iamjoonsoo.kim@lge.com> <1452749069-15334-17-git-send-email-iamjoonsoo.kim@lge.com> Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Jesper Dangaard Brouer , linux-mm@kvack.org, linux-kernel@vger.kernel.org From: Vlastimil Babka X-Enigmail-Draft-Status: N1110 Message-ID: <56A8C788.9000004@suse.cz> Date: Wed, 27 Jan 2016 14:35:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1452749069-15334-17-git-send-email-iamjoonsoo.kim@lge.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/14/2016 06:24 AM, Joonsoo Kim wrote: > In fact, I tested another idea implementing OBJFREELIST_SLAB with > extendable linked array through another freed object. It can remove > memory waste completely but it causes more computational overhead > in critical lock path and it seems that overhead outweigh benefit. > So, this patch doesn't include it. Can you elaborate? Do we actually need an extendable linked array? Why not just store the pointer to the next free object into the object, NULL for the last one? I.e. a singly-linked list. We should never need to actually traverse it? freeing object obj: *obj = page->freelist; page->freelist = obj; allocating object: obj = page->freelist; page->freelist = *obj; *obj = NULL; That means two writes, but if we omit managing page->active, it's not an increase. For counting free objects, we would need to traverse the list, but that's only needed for debugging? Also during bulk operations, page->freelist could be updated just once at the very end. Vlastimil