From: Andrew Morton <akpm@linux-foundation.org>
To: chi wu <wuchi.zero@gmail.com>
Cc: alexs@kernel.org, sjhuang@iluvatar.ai, sfr@canb.auug.org.au,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib/genalloc: Set chunk size to real size which gen_pool managed.
Date: Tue, 14 Jun 2022 10:53:34 -0700 [thread overview]
Message-ID: <20220614105334.ec0227452f8639c7515f97aa@linux-foundation.org> (raw)
In-Reply-To: <CA+tQmHDFMJq1DH7Kmzp13vxvZoiKzRokt_TeF0w5Eboi6VaaJQ@mail.gmail.com>
On Tue, 14 Jun 2022 13:20:08 +0800 chi wu <wuchi.zero@gmail.com> wrote:
> > If we're going to do this then gen_pool_add_owner() no longer needs its
> > `size' argument.
> >
> >
> Sorry, What point did I misunderstand?
I mean we can now do this:
--- a/lib/genalloc.c~lib-genalloc-set-chunk-size-to-real-size-which-gen_pool-managed-fix
+++ a/lib/genalloc.c
@@ -181,13 +181,14 @@ EXPORT_SYMBOL(gen_pool_create);
*
* Returns 0 on success or a -ve errno on failure.
*/
-int gen_pool_add_owner(struct gen_pool *pool, unsigned long virt, phys_addr_t phys,
- size_t size, int nid, void *owner)
+int gen_pool_add_owner(struct gen_pool *pool, unsigned long virt,
+ phys_addr_t phys, int nid, void *owner)
{
struct gen_pool_chunk *chunk;
unsigned long nbits = size >> pool->min_alloc_order;
unsigned long nbytes = sizeof(struct gen_pool_chunk) +
BITS_TO_LONGS(nbits) * sizeof(long);
+ size_t size;
chunk = vzalloc_node(nbytes, nid);
if (unlikely(chunk == NULL))
_
and fix up all the callers, prototype, kerneldoc, etc. Probably as a
second followup patch.
Please take a look at that, add the additional details to the changelog
and resend?
next prev parent reply other threads:[~2022-06-14 17:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-12 10:59 wuchi
2022-06-13 18:14 ` Andrew Morton
2022-06-14 5:20 ` chi wu
2022-06-14 17:53 ` Andrew Morton [this message]
2022-06-15 12:41 ` chi wu
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=20220614105334.ec0227452f8639c7515f97aa@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=alexs@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=sjhuang@iluvatar.ai \
--cc=wuchi.zero@gmail.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
all inboxes | Powered by JetHome®