From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758078Ab2IGVW1 (ORCPT ); Fri, 7 Sep 2012 17:22:27 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:48193 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757851Ab2IGVWR (ORCPT ); Fri, 7 Sep 2012 17:22:17 -0400 MIME-Version: 1.0 In-Reply-To: <1347009393-8751-1-git-send-email-benjamin.gaignard@stericsson.com> References: <1347009393-8751-1-git-send-email-benjamin.gaignard@stericsson.com> Date: Fri, 7 Sep 2012 23:22:16 +0200 Message-ID: Subject: Re: [PATCH] genalloc: make possible to use a custom allocation algorithm From: Linus Walleij To: Benjamin Gaignard Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, ying.huang@intel.com, Benjamin Gaignard Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 7, 2012 at 11:16 AM, Benjamin Gaignard wrote: > From: Benjamin Gaignard > > This patch allow to use another algorithm than the default first-fit one. > For example a custom algorithm could be used to manage alignment requirements. > > Add of best-fit algorithm function: > most of the time best-fit is slower then first-fit but memory fragmentation is lower. > Random buffer allocation/free tests don't show any arithmetic relation between > allocation time and fragmentation but best-fit algorithm is sometime able to perform the allocation when first-fit can't. > > This new algorithm help to solve fragmentation issues on ESRAM shared by multiple > hardware IP allocating and freeing dynamically memory region of various sizes. > > Signed-off-by: Benjamin Gaignard We really need this to manage our on-chip RAM (ESRAM) which is a scarce resource, so: Acked-by: Linus Walleij Yours, Linus Walleij