All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Zhao Qiang-B45475 <qiang.zhao@freescale.com>
Cc: "lauraa@codeaurora.org" <lauraa@codeaurora.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"olof@lixom.net" <olof@lixom.net>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"Xie Xiaobo-R63061" <X.Xie@freescale.com>
Subject: Re: [RFC v2] genalloc:add an gen_pool_first_fit_align algo to genalloc
Date: Thu, 30 Jul 2015 12:06:53 -0500	[thread overview]
Message-ID: <1438276013.2993.357.camel@freescale.com> (raw)
In-Reply-To: <SN1PR0301MB1550595DB65EF4319109C95A9B8B0@SN1PR0301MB1550.namprd03.prod.outlook.com>

On Wed, 2015-07-29 at 20:27 -0500, Zhao Qiang-B45475 wrote:
> 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? 

Pass pool as a parameter to the algorithm.

-Scott

      reply	other threads:[~2015-07-30 17:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27  9:57 [RFC v2] genalloc:add an gen_pool_first_fit_align algo to genalloc Zhao Qiang
2015-07-27 16:49 ` Vladimir Zapolskiy
2015-07-27 21:20 ` Scott Wood
2015-07-28  5:32   ` Zhao Qiang
2015-07-28  5:32     ` Zhao Qiang
2015-07-29 16:19     ` Scott Wood
2015-07-30  1:27       ` Zhao Qiang
2015-07-30  1:27         ` Zhao Qiang
2015-07-30 17:06         ` Scott Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438276013.2993.357.camel@freescale.com \
    --to=scottwood@freescale.com \
    --cc=X.Xie@freescale.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=lauraa@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=olof@lixom.net \
    --cc=qiang.zhao@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.