From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: guangrong.xiao@gmail.com
Cc: pbonzini@redhat.com, mst@redhat.com, mtosatti@redhat.com,
qemu-devel@nongnu.org, kvm@vger.kernel.org, peterx@redhat.com,
wei.w.wang@intel.com, jiang.biao2@zte.com.cn, eblake@redhat.com,
quintela@redhat.com, cota@braap.org,
Xiao Guangrong <xiaoguangrong@tencent.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/5] bitops: introduce change_bit_atomic
Date: Fri, 23 Nov 2018 10:23:35 +0000 [thread overview]
Message-ID: <20181123102334.GB2373@work-vm> (raw)
In-Reply-To: <20181122072028.22819-2-xiaoguangrong@tencent.com>
* guangrong.xiao@gmail.com (guangrong.xiao@gmail.com) wrote:
> From: Xiao Guangrong <xiaoguangrong@tencent.com>
>
> It will be used by threaded workqueue
>
> Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> include/qemu/bitops.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
> index 3f0926cf40..c522958852 100644
> --- a/include/qemu/bitops.h
> +++ b/include/qemu/bitops.h
> @@ -79,6 +79,19 @@ static inline void change_bit(long nr, unsigned long *addr)
> *p ^= mask;
> }
>
> +/**
> + * change_bit_atomic - Toggle a bit in memory atomically
> + * @nr: Bit to change
> + * @addr: Address to start counting from
> + */
> +static inline void change_bit_atomic(long nr, unsigned long *addr)
> +{
> + unsigned long mask = BIT_MASK(nr);
> + unsigned long *p = addr + BIT_WORD(nr);
> +
> + atomic_xor(p, mask);
> +}
> +
> /**
> * test_and_set_bit - Set a bit and return its old value
> * @nr: Bit to set
> --
> 2.14.5
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2018-11-23 10:23 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 7:20 [Qemu-devel] [PATCH v3 0/5] migration: improve multithreads guangrong.xiao
2018-11-22 7:20 ` [Qemu-devel] [PATCH v3 1/5] bitops: introduce change_bit_atomic guangrong.xiao
2018-11-23 10:23 ` Dr. David Alan Gilbert [this message]
2018-11-28 9:35 ` Juan Quintela
2018-11-22 7:20 ` [Qemu-devel] [PATCH v3 2/5] util: introduce threaded workqueue guangrong.xiao
2018-11-23 11:02 ` Dr. David Alan Gilbert
2018-11-26 7:57 ` Xiao Guangrong
2018-11-26 10:56 ` Dr. David Alan Gilbert
2018-11-27 7:17 ` Xiao Guangrong
2018-11-26 18:55 ` Emilio G. Cota
2018-11-27 8:30 ` Xiao Guangrong
2018-11-24 0:12 ` Emilio G. Cota
2018-11-26 8:06 ` Xiao Guangrong
2018-11-26 18:49 ` Emilio G. Cota
2018-11-27 8:29 ` Xiao Guangrong
2018-11-24 0:17 ` Emilio G. Cota
2018-11-26 8:18 ` Xiao Guangrong
2018-11-26 10:28 ` Paolo Bonzini
2018-11-27 8:31 ` Xiao Guangrong
2018-11-27 12:49 ` Christophe de Dinechin
2018-11-27 13:51 ` Paolo Bonzini
2018-12-04 15:49 ` Christophe de Dinechin
2018-12-04 17:16 ` Paolo Bonzini
2018-12-10 3:23 ` Xiao Guangrong
2018-11-27 17:39 ` Emilio G. Cota
2018-11-28 8:55 ` Xiao Guangrong
2018-11-22 7:20 ` [Qemu-devel] [PATCH v3 3/5] migration: use threaded workqueue for compression guangrong.xiao
2018-11-23 18:17 ` Dr. David Alan Gilbert
2018-11-23 18:22 ` Paolo Bonzini
2018-11-23 18:29 ` Dr. David Alan Gilbert
2018-11-26 8:00 ` Xiao Guangrong
2018-11-22 7:20 ` [Qemu-devel] [PATCH v3 4/5] migration: use threaded workqueue for decompression guangrong.xiao
2018-11-22 7:20 ` [Qemu-devel] [PATCH v3 5/5] tests: add threaded-workqueue-bench guangrong.xiao
2018-11-22 21:25 ` [Qemu-devel] [PATCH v3 0/5] migration: improve multithreads no-reply
2018-11-22 21:35 ` no-reply
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=20181123102334.GB2373@work-vm \
--to=dgilbert@redhat.com \
--cc=cota@braap.org \
--cc=eblake@redhat.com \
--cc=guangrong.xiao@gmail.com \
--cc=jiang.biao2@zte.com.cn \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=wei.w.wang@intel.com \
--cc=xiaoguangrong@tencent.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).