All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [PATCH 2/3] exec: adjuest rcu_read_lock requiement
Date: Fri, 29 Apr 2016 15:56:54 +0800	[thread overview]
Message-ID: <20160429075654.GO1421@ad.usersys.redhat.com> (raw)
In-Reply-To: <1461123261-15408-3-git-send-email-arei.gonglei@huawei.com>

In the subject line, s/adjuest/adjust/ and s/requiement/requirement/.

On Wed, 04/20 11:34, Gonglei wrote:
> qemu_ram_unset_idstr() don't need rcu lock anymore,

s/don't/doesn't/

> meanwhile adjuest the range of rcu lock in

s/adjuest/adjust/ or just s/adjuest/make/

> qemu_ram_set_idstr() as small as possible.
> 
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  exec.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index 101f0f4..b0ecbcd 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1418,8 +1418,6 @@ void qemu_ram_set_idstr(RAMBlock *block, const char *name, DeviceState *dev)
>      RAMBlock *new_block = block;
>      RAMBlock *old_block;
>  
> -    rcu_read_lock();
> -
>      assert(new_block);
>      assert(!new_block->idstr[0]);
>  
> @@ -1432,6 +1430,7 @@ void qemu_ram_set_idstr(RAMBlock *block, const char *name, DeviceState *dev)
>      }
>      pstrcat(new_block->idstr, sizeof(new_block->idstr), name);
>  
> +    rcu_read_lock();
>      QLIST_FOREACH_RCU(old_block, &ram_list.blocks, next) {
>          if (old_block != new_block &&
>              !strcmp(old_block->idstr, new_block->idstr)) {
> @@ -1443,7 +1442,6 @@ void qemu_ram_set_idstr(RAMBlock *block, const char *name, DeviceState *dev)
>      rcu_read_unlock();
>  }
>  
> -/* Called with iothread lock held.  */

This still seems true to me, why removing?

>  void qemu_ram_unset_idstr(RAMBlock *block)
>  {
>      /* FIXME: arch_init.c assumes that this is not called throughout
> @@ -1451,11 +1449,9 @@ void qemu_ram_unset_idstr(RAMBlock *block)
>       * does not work anyway.
>       */
>  
> -    rcu_read_lock();
>      if (block) {
>          memset(block->idstr, 0, sizeof(block->idstr));
>      }
> -    rcu_read_unlock();
>  }
>  
>  static int memory_try_enable_merging(void *addr, size_t len)
> -- 
> 1.7.12.4
> 
> 

  reply	other threads:[~2016-04-29  8:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20  3:34 [Qemu-devel] [PATCH 0/3] memory: some little optimzation Gonglei
2016-04-20  3:34 ` [Qemu-devel] [PATCH 1/3] memory: drop find_ram_block() Gonglei
2016-04-29  7:48   ` Fam Zheng
2016-04-29  8:57     ` Gonglei (Arei)
2016-04-20  3:34 ` [Qemu-devel] [PATCH 2/3] exec: adjuest rcu_read_lock requiement Gonglei
2016-04-29  7:56   ` Fam Zheng [this message]
2016-04-29  8:59     ` Gonglei (Arei)
2016-04-20  3:34 ` [Qemu-devel] [PATCH 3/3] memory: pass RAMBlock as a agrument Gonglei
2016-04-29  8:06   ` Fam Zheng
2016-04-29  9:03     ` Gonglei (Arei)
2016-05-09 11:41 ` [Qemu-devel] [PATCH 0/3] memory: some little optimzation Paolo Bonzini
2016-05-10  2:05   ` Gonglei (Arei)

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=20160429075654.GO1421@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.