From: linmiaohe <linmiaohe@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mm/mempool: Add 'else' to split mutually exclusive case
Date: Fri, 25 Sep 2020 02:47:58 +0000 [thread overview]
Message-ID: <3cc5c0cd2eef450ca8d8843ab72edc98@huawei.com> (raw)
Andrew Morton <akpm@linux-foundation.org> wrote:
> On Thu, 24 Sep 2020 07:16:41 -0400 Miaohe Lin <linmiaohe@huawei.com> wrote:
>
>> Add else to split mutually exclusive case and avoid some unnecessary check.
>> It doesn't seem to change code generation (compiler is smart), but I
>> think it helps readability.
>
> OK, I guess. But the comments are now in the wrong place.
>
Many thanks for kindly reply and fix the wrong comments place.
Have a good day!
> --- a/mm/mempool.c~mm-mempool-add-else-to-split-mutually-exclusive-case-fix
> +++ a/mm/mempool.c
> @@ -60,8 +60,8 @@ static void check_element(mempool_t *poo
> /* Mempools backed by slab allocator */
> if (pool->free == mempool_free_slab || pool->free == mempool_kfree) {
> __check_element(pool, element, ksize(element));
> - /* Mempools backed by page allocator */
> } else if (pool->free == mempool_free_pages) {
> + /* Mempools backed by page allocator */
> int order = (int)(long)pool->pool_data;
> void *addr = kmap_atomic((struct page *)element);
>
> @@ -83,8 +83,8 @@ static void poison_element(mempool_t *po
> /* Mempools backed by slab allocator */
> if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) {
> __poison_element(element, ksize(element));
> - /* Mempools backed by page allocator */
> } else if (pool->alloc == mempool_alloc_pages) {
> + /* Mempools backed by page allocator */
> int order = (int)(long)pool->pool_data;
> void *addr = kmap_atomic((struct page *)element);
>
> _
>
>
next reply other threads:[~2020-09-25 2:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 2:47 linmiaohe [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-09-24 11:16 Miaohe Lin
2020-09-25 2:40 ` Andrew Morton
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=3cc5c0cd2eef450ca8d8843ab72edc98@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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