lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN1PR0301MB1550595DB65EF4319109C95A9B8B0@SN1PR0301MB1550.namprd03.prod.outlook.com>
Date:	Thu, 30 Jul 2015 01:27:14 +0000
From:	Zhao Qiang <qiang.zhao@...escale.com>
To:	Scott Wood <scottwood@...escale.com>
CC:	"lauraa@...eaurora.org" <lauraa@...eaurora.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"olof@...om.net" <olof@...om.net>,
	"catalin.marinas@....com" <catalin.marinas@....com>,
	Xiaobo Xie <X.Xie@...escale.com>
Subject: RE: [RFC v2] genalloc:add an gen_pool_first_fit_align algo to
 genalloc

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@...eaurora.org; linux-kernel@...r.kernel.org; linuxppc-
> dev@...ts.ozlabs.org; akpm@...ux-foundation.org; olof@...om.net;
> catalin.marinas@....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@...eaurora.org; linux-kernel@...r.kernel.org; linuxppc-
> > > dev@...ts.ozlabs.org; akpm@...ux-foundation.org; olof@...om.net;
> > > catalin.marinas@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ