From: William Kucharski <william.kucharski@oracle.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org
Subject: Re: [PATCH] vmalloc: Convert to XArray
Date: Wed, 3 Jun 2020 11:35:24 -0600 [thread overview]
Message-ID: <3CE9C10C-2C1E-4363-94A6-BD4724881926@oracle.com> (raw)
In-Reply-To: <20200603171448.5894-1-willy@infradead.org>
> On Jun 3, 2020, at 11:14 AM, Matthew Wilcox <willy@infradead.org> wrote:
>
[ ... snip ... ]
> - err = radix_tree_preload(gfp_mask);
> - if (unlikely(err)) {
> - kfree(vb);
> - free_vmap_area(va);
> - return ERR_PTR(err);
> - }
> -
> vaddr = vmap_block_vaddr(va->va_start, 0);
> spin_lock_init(&vb->lock);
> vb->va = va;
> @@ -1594,11 +1586,12 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask)
> INIT_LIST_HEAD(&vb->free_list);
>
> vb_idx = addr_to_vb_idx(va->va_start);
> - spin_lock(&vmap_block_tree_lock);
> - err = radix_tree_insert(&vmap_block_tree, vb_idx, vb);
> - spin_unlock(&vmap_block_tree_lock);
> - BUG_ON(err);
> - radix_tree_preload_end();
> + err = xa_insert(&vmap_blocks, vb_idx, vb, gfp_mask);
> + if (err) {
> + kfree(vb);
> + free_vmap_area(va);
> + return ERR_PTR(err);
> + }
>
Should the "(err)" here be "unlikely(err)" as the radix tree version was?
Nice change and simplifies the code quite a bit.
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
next prev parent reply other threads:[~2020-06-03 17:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 17:14 Matthew Wilcox
2020-06-03 17:35 ` William Kucharski [this message]
2020-06-04 3:33 ` Matthew Wilcox
2020-06-04 10:59 ` William Kucharski
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=3CE9C10C-2C1E-4363-94A6-BD4724881926@oracle.com \
--to=william.kucharski@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.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