From: Andrew Morton <akpm@linux-foundation.org>
To: wuchi <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: Mon, 13 Jun 2022 11:14:04 -0700 [thread overview]
Message-ID: <20220613111404.5253fe6ac69f5fd145dd437c@linux-foundation.org> (raw)
In-Reply-To: <20220612105937.30862-1-wuchi.zero@gmail.com>
On Sun, 12 Jun 2022 18:59:37 +0800 wuchi <wuchi.zero@gmail.com> wrote:
> The demand size (chunk->avail > size > round_down(chunk->avail)) will
> lead to meaningless algo calls in gen_pool_alloc_algo_owner without the
> patch, alse move the follow code:
> size = nbits << order
> out of read-side critical section.
>
Nobody has seriously worked on this code in a long time :(
Please expand more on the flaw. What are "algo calls"? Why are they
meaningless, etc? What are the runtime effects of this error?
> --- a/lib/genalloc.c
> +++ b/lib/genalloc.c
> @@ -193,6 +193,7 @@ int gen_pool_add_owner(struct gen_pool *pool, unsigned long virt, phys_addr_t ph
> if (unlikely(chunk == NULL))
> return -ENOMEM;
>
> + size = nbits << pool->min_alloc_order;
If we're going to do this then gen_pool_add_owner() no longer needs its
`size' argument.
next prev parent reply other threads:[~2022-06-13 19:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-12 10:59 [PATCH] lib/genalloc: Set chunk size to real size which gen_pool managed wuchi
2022-06-13 18:14 ` Andrew Morton [this message]
2022-06-14 5:20 ` chi wu
2022-06-14 17:53 ` Andrew Morton
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=20220613111404.5253fe6ac69f5fd145dd437c@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