From: Scott Wood <scottwood@freescale.com>
To: Zhao Qiang-B45475 <qiang.zhao@freescale.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"Xie Xiaobo-R63061" <X.Xie@freescale.com>
Subject: Re: [PATCH 2/2] rheap: move rheap.c from arch/powerpc/lib/ to lib/
Date: Wed, 8 Jul 2015 22:50:40 -0500 [thread overview]
Message-ID: <1436413840.2658.113.camel@freescale.com> (raw)
In-Reply-To: <CY1PR0301MB1545D6DA1DDAEEF3B2FC82E79B900@CY1PR0301MB1545.namprd03.prod.outlook.com>
On Wed, 2015-07-08 at 22:18 -0500, Zhao Qiang-B45475 wrote:
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Thursday, July 09, 2015 2:59 AM
> > To: Zhao Qiang-B45475
> > Cc: linuxppc-dev@lists.ozlabs.org; Xie Xiaobo-R63061
> > Subject: Re: [PATCH 2/2] rheap: move rheap.c from arch/powerpc/lib/ to
> > lib/
> >
> > On Wed, 2015-07-08 at 02:25 -0500, Zhao Qiang-B45475 wrote:
> > > So I will add two func for my use, do you think it is ok?
> > > I need to align the address of allocated muram.
> > > And I will set algo = gen_pool_first_fit_align.
> > >
> > > +unsigned long gen_pool_alloc_align(struct gen_pool *pool, size_t size,
> > > + unsigned long align)
> >
> > Again, please explain why you need this for CPM/QE. I don't see
> > rh_alloc_align() currently being used by either.
> >
> > Also, please stop top-posting.
>
>
> unsigned long rh_alloc(struct _rh_info *info, int size, const char *owner)
> {
> return rh_alloc_align(info, size, info->alignment, owner);
> }
> EXPORT_SYMBOL_GPL(rh_alloc);
That doesn't involve a different alignment for each allocation. It uses the
same alignment for all of them, and the alignment that cpm_common.c provides
to rh_init() is 1 byte.
...but sigh, cpm_muram_alloc() is changing cpm_muram_info.alignment behind
the rheap code's back. Despite the existence of rh_alloc_align().
So yes, add aligned allocation functionality to genalloc, but don't duplicate
gen_pool_alloc() to do so. Instead, rename gen_pool_alloc() to
gen_pool_alloc_align() with an alignment parameter (also modifying the algo
function to take an alignment arg, which gen_pool_first_fit_order_align()
would ignore), and provide a gen_pool_alloc() wrapper that specifies 1 as the
required alignment. Also be sure to CC lkml on the patchset since you're
touching core code that doesn't have its own maintainer or list.
-Scott
next prev parent reply other threads:[~2015-07-09 3:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 9:11 [PATCH 1/2] qe_common: add qe common functions into qe_common.c Zhao Qiang
2015-05-27 9:12 ` [PATCH 2/2] rheap: move rheap.c from arch/powerpc/lib/ to lib/ Zhao Qiang
2015-05-27 17:36 ` Scott Wood
2015-06-04 5:56 ` Zhao Qiang
2015-06-04 6:13 ` Scott Wood
2015-06-04 9:27 ` Zhao Qiang
2015-06-04 22:40 ` Scott Wood
2015-07-08 2:54 ` Zhao Qiang
2015-07-08 2:55 ` Scott Wood
2015-07-08 3:26 ` Zhao Qiang
2015-07-08 3:27 ` Scott Wood
2015-07-08 7:25 ` Zhao Qiang
2015-07-08 18:58 ` Scott Wood
2015-07-09 3:18 ` Zhao Qiang
2015-07-09 3:50 ` Scott Wood [this message]
2015-07-09 6:05 ` Zhao Qiang
2015-07-09 6:09 ` Scott Wood
2015-07-09 6:14 ` Zhao Qiang
2015-07-09 6:47 ` Scott Wood
2015-05-27 22:51 ` [PATCH 1/2] qe_common: add qe common functions into qe_common.c Scott Wood
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=1436413840.2658.113.camel@freescale.com \
--to=scottwood@freescale.com \
--cc=X.Xie@freescale.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).