[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/24] exec: adjust rcu_read_lock requirement
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 10/24] exec: adjust rcu_read_lock requirement |
Date: |
Mon, 23 May 2016 17:09:45 +0200 |
From: Gonglei <address@hidden>
qemu_ram_unset_idstr() doesn't need rcu lock anymore,
meanwhile make the range of rcu lock in
qemu_ram_set_idstr() as small as possible.
Signed-off-by: Gonglei <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
exec.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/exec.c b/exec.c
index e2966ce..8cf535d 100644
--- a/exec.c
+++ b/exec.c
@@ -1421,8 +1421,6 @@ void qemu_ram_set_idstr(RAMBlock *new_block, const char
*name, DeviceState *dev)
{
RAMBlock *block;
- rcu_read_lock();
-
assert(new_block);
assert(!new_block->idstr[0]);
@@ -1435,6 +1433,7 @@ void qemu_ram_set_idstr(RAMBlock *new_block, const char
*name, DeviceState *dev)
}
pstrcat(new_block->idstr, sizeof(new_block->idstr), name);
+ rcu_read_lock();
QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
if (block != new_block &&
!strcmp(block->idstr, new_block->idstr)) {
@@ -1453,12 +1452,9 @@ void qemu_ram_unset_idstr(RAMBlock *block)
* migration. Ignore the problem since hot-unplug during migration
* 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.8.3.1
- [Qemu-devel] [PULL 00/24] Misc patches for 2016-05-23, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 03/24] i386: kvmvapic: initialise imm32 variable, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 06/24] ioapic: keep RO bits for IOAPIC entry, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 05/24] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 09/24] memory: drop find_ram_block(), Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 08/24] vl: change runstate only if new state is different from current state, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 13/24] memory: remove unnecessary masking of MemoryRegion ram_addr, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 07/24] ioapic: clear remote irr bit for edge-triggered interrupts, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 01/24] exec.c: Ensure right alignment also for file backed ram, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 02/24] docs/atomics.txt: Update pointer to linux macro, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 10/24] exec: adjust rcu_read_lock requirement,
Paolo Bonzini <=
- [Qemu-devel] [PULL 18/24] esp: check command buffer length before write(CVE-2016-4439), Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 04/24] configure: Allow builds with extra warnings, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 15/24] Remove config-devices.mak on 'make clean', Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 14/24] cpus.c: Use pthread_sigmask() rather than sigprocmask(), Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 23/24] nmi: remove x86 specific nmi handling, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 19/24] esp: check dma length before reading scsi command(CVE-2016-4441), Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 12/24] memory: Drop FlatRange.romd_mode, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 17/24] scripts/signrom.py: Check for magic in option ROMs., Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 11/24] memory: Remove code for mr->may_overlap, Paolo Bonzini, 2016/05/23
- [Qemu-devel] [PULL 16/24] scripts/signrom.py: Allow option ROM checksum script to write the size header., Paolo Bonzini, 2016/05/23