linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "xiaofeng.yan" <xiaofeng.yan2012@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	dledford@redhat.com, jgg@ziepe.ca, oulijun@huawei.com,
	yanxiaofeng7@jd.com
Subject: Re: [PATCH 1/2] [xarry]:Fixed an issue with memory allocated using the GFP_KERNEL flag in spinlocks
Date: Wed, 4 Nov 2020 02:36:08 +0000	[thread overview]
Message-ID: <20201104023608.GK27442@casper.infradead.org> (raw)
In-Reply-To: <20201104023213.760-1-xiaofeng.yan2012@gmail.com>

On Wed, Nov 04, 2020 at 10:32:12AM +0800, xiaofeng.yan wrote:
>  	xa_lock_irq(xa);
> -	curr = __xa_store(xa, index, entry, gfp);
> +	curr = __xa_store(xa, index, entry, GFP_ATOMIC);
>  	xa_unlock_irq(xa);

You haven't actually seen a bug, have you?  You just read the code
wrongly.

void *__xa_store(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp)
...
        } while (__xas_nomem(&xas, gfp));
...
        if (gfpflags_allow_blocking(gfp)) {
                xas_unlock_type(xas, lock_type);
                xas->xa_alloc = kmem_cache_alloc(radix_tree_node_cachep, gfp);
                xas_lock_type(xas, lock_type);


      parent reply	other threads:[~2020-11-04  2:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04  2:32 [PATCH 1/2] [xarry]:Fixed an issue with memory allocated using the GFP_KERNEL flag in spinlocks xiaofeng.yan
2020-11-04  2:32 ` [PATCH 2/2] infiniband: Modify the reference to xa_store_irq() because the parameter of this function has changed xiaofeng.yan
2020-11-04 18:58   ` Jason Gunthorpe
2020-11-04 19:30     ` Matthew Wilcox
2020-11-04 21:34       ` Jason Gunthorpe
2020-11-04  2:36 ` Matthew Wilcox [this message]

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=20201104023608.GK27442@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oulijun@huawei.com \
    --cc=xiaofeng.yan2012@gmail.com \
    --cc=yanxiaofeng7@jd.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).