Re: [RFC v2] genalloc:add an gen_pool_first_fit_align algo to genalloc

From: Scott Wood
Date: Wed Jul 29 2015 - 12:19:36 EST


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@xxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linuxppc-
> > dev@xxxxxxxxxxxxxxxx; akpm@xxxxxxxxxxxxxxxxxxxx; olof@xxxxxxxxx;
> > catalin.marinas@xxxxxxx; 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.

> 3. where to define the data, in genalloc.h or caller layer?

Same place as where the algorithm function is declared.

-Scott


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/