From: "jianchao.wang" <jianchao.w.wang@oracle.com>
To: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Omar Sandoval <osandov@fb.com>,
Yi Zhang <yi.zhang@redhat.com>
Subject: Re: [PATCH] sbitmap: order RW on old associated instance and setting clear bit
Date: Tue, 19 Mar 2019 13:17:31 +0800 [thread overview]
Message-ID: <9e784c48-2865-a14a-d8f4-e6c74f258f48@oracle.com> (raw)
In-Reply-To: <20190319042447.27580-1-ming.lei@redhat.com>
Hi Ming
On 3/19/19 12:24 PM, Ming Lei wrote:
> @@ -591,6 +591,15 @@ EXPORT_SYMBOL_GPL(sbitmap_queue_wake_up);
> void sbitmap_queue_clear(struct sbitmap_queue *sbq, unsigned int nr,
> unsigned int cpu)
> {
> + /*
> + * Once the clear bit is set, it will be visible to allocation
> + * side.
> + *
> + * This memory barrier orders any READ/WRITE on the to-be-freed
> + * asssociated instance for avoiding potential use-after-free, and
> + * its pair is the memory barrier implied in sbitmap_get().
which one ?
> + */
> + smp_mb();
smp_mb_before_atomic should be enough.
> sbitmap_deferred_clear_bit(&sbq->sb, nr);
Thanks
Jianchao
next prev parent reply other threads:[~2019-03-19 5:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-19 4:24 [PATCH] sbitmap: order RW on old associated instance and setting clear bit Ming Lei
2019-03-19 5:17 ` jianchao.wang [this message]
2019-03-19 7:58 ` Ming Lei
2019-03-19 8:16 ` jianchao.wang
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=9e784c48-2865-a14a-d8f4-e6c74f258f48@oracle.com \
--to=jianchao.w.wang@oracle.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=osandov@fb.com \
--cc=yi.zhang@redhat.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