Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754288AbbG3CAF (ORCPT ); Wed, 29 Jul 2015 22:00:05 -0400 Received: from mail-bl2on0130.outbound.protection.outlook.com ([65.55.169.130]:43078 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752025AbbG3CAD (ORCPT ); Wed, 29 Jul 2015 22:00:03 -0400 From: Zhao Qiang To: Scott Wood CC: "lauraa@codeaurora.org" , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "akpm@linux-foundation.org" , "olof@lixom.net" , "catalin.marinas@arm.com" , Xiaobo Xie Subject: RE: [RFC v2] genalloc:add an gen_pool_first_fit_align algo to genalloc Thread-Topic: [RFC v2] genalloc:add an gen_pool_first_fit_align algo to genalloc Thread-Index: AQHQyFNqKDU++m1mhE24tbaXfT93WZ3v04mAgABYS3CAAngrgIAAlmIQ Date: Thu, 30 Jul 2015 01:27:14 +0000 Message-ID: References: <1437991074-35377-1-git-send-email-qiang.zhao@freescale.com> <1438032043.2993.311.camel@freescale.com> <1438186761.2993.337.camel@freescale.com> In-Reply-To: <1438186761.2993.337.camel@freescale.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: freescale.com; dkim=none (message not signed) header.d=none; x-originating-ip: [192.158.241.86] x-microsoft-exchange-diagnostics: 1;BY1PR03MB1484;5:WYfNy6sqtpbrVxDp54Pzwdhf3qqX/oeSWCHjar/2qn6a8bRV/4AFUaz8y+isxheTQQW2BkxuiVSSk5lCnmXYCMxP9BBJWxXMCebyPd9Yp2ImghH2P/iEZU/SIDFuFWLlzsgYpLEwi6qFIacVq8+/yA==;24:zyR4q2aYIQGgmT9hAUqEEzFTwuWTu4FwwneVU9/pSIYPmAWR/9PKikLJLvLRxMNSPTzRb1tP2GDwCsUEErX0TwmeG89F/70JTaHLpfurlZM=;20:/SUjtuGKjaUiepTKdtHWzwUTz1mFvesqayPKnE4rXCkYXzBNvLfc3HqZ9p++23eYBqrHJZPB9acCiQHwCSDUuw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1484; by1pr03mb1484: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BY1PR03MB1484;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1484; x-forefront-prvs: 06530126A4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(24454002)(377424004)(13464003)(86362001)(33656002)(54356999)(76176999)(50986999)(87936001)(2656002)(2900100001)(76576001)(93886004)(77156002)(19580395003)(122556002)(5001960100002)(77096005)(4001450100002)(106116001)(40100003)(110136002)(74316001)(189998001)(92566002)(19580405001)(5003600100002)(5002640100001)(62966003)(99286002)(102836002)(66066001)(2950100001)(46102003)(107886002)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1484;H:SN1PR0301MB1550.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2015 01:27:14.8737 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1484 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t6U20MMf030342 Content-Length: 2586 Lines: 65 On Thu, 2015-07-30 at 5:21, Scott Wood wrote: > -----Original Message----- > From: Wood Scott-B07421 > Sent: Thursday, July 30, 2015 12:19 AM > To: Zhao Qiang-B45475 > Cc: lauraa@codeaurora.org; linux-kernel@vger.kernel.org; linuxppc- > dev@lists.ozlabs.org; akpm@linux-foundation.org; olof@lixom.net; > catalin.marinas@arm.com; Xie Xiaobo-R63061 > Subject: Re: [RFC v2] genalloc:add an gen_pool_first_fit_align algo to > genalloc > > On Tue, 2015-07-28 at 00:32 -0500, Zhao Qiang-B45475 wrote: > > On Tue, 2015-07-28 at 5:21, Scott Wood wrote: > > > -----Original Message----- > > > From: Wood Scott-B07421 > > > Sent: Tuesday, July 28, 2015 5:21 AM > > > To: Zhao Qiang-B45475 > > > Cc: lauraa@codeaurora.org; linux-kernel@vger.kernel.org; linuxppc- > > > dev@lists.ozlabs.org; akpm@linux-foundation.org; olof@lixom.net; > > > catalin.marinas@arm.com; Xie Xiaobo-R63061 > > > Subject: Re: [RFC v2] genalloc:add an gen_pool_first_fit_align algo > > > to genalloc > > > > > > On Mon, 2015-07-27 at 17:57 +0800, Zhao Qiang wrote: > > > > > > Where's the part that adds the ability to pass in data to each > > > allocation call, as per the previous discussion? > > > > You means to use gen_pool_alloc_data()? > > Yes. > > > Previously you said that the format of data is algorithm-specific, So > > I think it is better to handle data in algorithm function. > > It is a channel for communication from the API caller to the algorithm. > > > If you still prefer gen_pool_alloc_data(), I will modify it. > > But there still are details I want to confirm with you. > > 1. If use gen_pool_alloc_data(), should I pass data as a parameter? > > Yes. > > > 2. Should I count align_mask in gen_pool_alloc_data(), meanwhile, add > > a align_mask to data as a member? > > gen_pool_alloc_data() should just pass data to the algorithm. The > algorithm should calculate align_mask based on align. I don't think > exposing align_mask to API users would be very friendly. If calculate align_mask in algorithm, I need to get pool->min_alloc_order in algorithm, Like: order = data->pool->min_alloc_order; align_mask = ((data->align + (1UL << order) - 1) >> order) - 1; so I add pool to structure data as a member. Is there any other better idea? > > > 3. where to define the data, in genalloc.h or caller layer? > > Same place as where the algorithm function is declared. > > -Scott > -Zhao Qiang ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?