Displaying 20 results from an estimated 120 matches for "rwsem".
2013 Aug 30
17
[PATCH] rwsem: add rwsem_is_contended
Btrfs uses an rwsem to control access to its extent tree. Threads will hold a
read lock on this rwsem while they scan the extent tree, and if need_resched()
they will drop the lock and schedule. The transaction commit needs to take a
write lock for this rwsem for a very short period to switch out the commit
roots....
2017 Feb 08
0
[PATCH 2/2] locking/mutex, rwsem: Reduce vcpu_is_preempted() calling frequency
As the vcpu_is_preempted() call is pretty costly compared with other
checks within mutex_spin_on_owner() and rwsem_spin_on_owner(), they
are done at a reduce frequency of once every 256 iterations.
Signed-off-by: Waiman Long <longman at redhat.com>
---
kernel/locking/mutex.c | 5 ++++-
kernel/locking/rwsem-xadd.c | 6 ++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/kernel/lock...
2016 Jul 21
0
[PATCH v3 4/4] kernel/locking: Drop the overhead of {mutex, rwsem}_spin_on_owner
...wner
8.45% sched-messaging [kernel.vmlinux] [k] mutex_unlock
4.12% sched-messaging [kernel.vmlinux] [k] system_call
3.01% sched-messaging [kernel.vmlinux] [k] system_call_common
2.83% sched-messaging [kernel.vmlinux] [k] copypage_power7
2.64% sched-messaging [kernel.vmlinux] [k] rwsem_spin_on_owner
2.00% sched-messaging [kernel.vmlinux] [k] osq_lock
after patch:
9.99% sched-messaging [kernel.vmlinux] [k] mutex_unlock
5.28% sched-messaging [unknown] [H] 0xc0000000000768e0
4.27% sched-messaging [kernel.vmlinux] [k] __copy_tofrom_user_power7
3.77% sched-me...
2013 Jan 03
2
3.8-rc2: EFI framebuffer lock inversion...
...in process (950) terminated with status 1
======================================================
[ INFO: possible circular locking dependency detected ]
3.8.0-rc2-expert #1 Not tainted
-------------------------------------------------------
Xorg/1193 is trying to acquire lock:
((fb_notifier_list).rwsem){++++.+}, at: [<ffffffff810697c1>]
__blocking_notifier_call_chain+0x51/0xc0
but task is already holding lock:
(console_lock){+.+.+.}, at: [<ffffffff81263f95>] do_fb_ioctl+0x2e5/0x5f0
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-...
2012 Aug 24
4
[PATCH] Btrfs: pass lockdep rwsem metadata to async commit transaction
The freeze rwsem is taken by sb_start_intwrite() and dropped during the
commit_ or end_transaction(). In the async case, that happens in a worker
thread. Tell lockdep the calling thread is releasing ownership of the
rwsem and the async thread is picking it up.
Josef and I worked out a more complicated solution t...
2017 Feb 08
1
[PATCH 2/2] locking/mutex,rwsem: Reduce vcpu_is_preempted() calling frequency
On Wed, Feb 08, 2017 at 01:00:25PM -0500, Waiman Long wrote:
> As the vcpu_is_preempted() call is pretty costly compared with other
> checks within mutex_spin_on_owner() and rwsem_spin_on_owner(), they
> are done at a reduce frequency of once every 256 iterations.
That's just disgusting.
2017 Feb 08
1
[PATCH 2/2] locking/mutex,rwsem: Reduce vcpu_is_preempted() calling frequency
On Wed, Feb 08, 2017 at 01:00:25PM -0500, Waiman Long wrote:
> As the vcpu_is_preempted() call is pretty costly compared with other
> checks within mutex_spin_on_owner() and rwsem_spin_on_owner(), they
> are done at a reduce frequency of once every 256 iterations.
That's just disgusting.
2017 Feb 08
4
[PATCH 1/2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function
It was found when running fio sequential write test with a XFS ramdisk
on a 2-socket x86-64 system, the %CPU times as reported by perf were
as follows:
71.27% 0.28% fio [k] down_write
70.99% 0.01% fio [k] call_rwsem_down_write_failed
69.43% 1.18% fio [k] rwsem_down_write_failed
65.51% 54.57% fio [k] osq_lock
9.72% 7.99% fio [k] __raw_callee_save___kvm_vcpu_is_preempted
4.16% 4.16% fio [k] __kvm_vcpu_is_preempted
So making vcpu_is_preempted() a callee-save function has a pretty high
cost assoc...
2017 Feb 08
4
[PATCH 1/2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function
It was found when running fio sequential write test with a XFS ramdisk
on a 2-socket x86-64 system, the %CPU times as reported by perf were
as follows:
71.27% 0.28% fio [k] down_write
70.99% 0.01% fio [k] call_rwsem_down_write_failed
69.43% 1.18% fio [k] rwsem_down_write_failed
65.51% 54.57% fio [k] osq_lock
9.72% 7.99% fio [k] __raw_callee_save___kvm_vcpu_is_preempted
4.16% 4.16% fio [k] __kvm_vcpu_is_preempted
So making vcpu_is_preempted() a callee-save function has a pretty high
cost assoc...
2016 Jul 21
5
[PATCH v3 0/4] implement vcpu preempted check
change from v2:
no code change, fix typos, update some comments
change from v1:
a simplier definition of default vcpu_is_preempted
skip mahcine type check on ppc, and add config. remove dedicated macro.
add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
add more comments
thanks boqun and Peter's suggestion.
This patch set aims to fix lock holder preemption issues.
test-case:
perf record -a perf bench sched messaging -g 400 -p && perf report
before patch:
18.09% sched-messaging [kernel.vmli...
2016 Jul 21
5
[PATCH v3 0/4] implement vcpu preempted check
change from v2:
no code change, fix typos, update some comments
change from v1:
a simplier definition of default vcpu_is_preempted
skip mahcine type check on ppc, and add config. remove dedicated macro.
add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
add more comments
thanks boqun and Peter's suggestion.
This patch set aims to fix lock holder preemption issues.
test-case:
perf record -a perf bench sched messaging -g 400 -p && perf report
before patch:
18.09% sched-messaging [kernel.vmli...
2016 Oct 25
0
[GIT PULL v2 4/5] processor.h: Remove cpu_relax_lowlatency users
...915/i915_gem_request.c | 2 +-
drivers/vhost/net.c | 4 ++--
kernel/locking/mcs_spinlock.h | 4 ++--
kernel/locking/mutex.c | 4 ++--
kernel/locking/osq_lock.c | 6 +++---
kernel/locking/qrwlock.c | 6 +++---
kernel/locking/rwsem-xadd.c | 4 ++--
lib/lockref.c | 2 +-
8 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 8832f8e..383d134 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c...
2012 Apr 22
1
[PATCH 1/5] drm: add optional per device rwsem for all ioctls
...s(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 6116e3b..c54e9f8 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -464,6 +464,9 @@ long drm_ioctl(struct file *filp,
} else
memset(kdata, 0, usize);
+ if (dev->driver->ioctls_need_rwsem)
+ down_read(&dev->ioctls_rwsem);
+
if (ioctl->flags & DRM_UNLOCKED)
retcode = func(dev, kdata, file_priv);
else {
@@ -472,6 +475,9 @@ long drm_ioctl(struct file *filp,
mutex_unlock(&drm_global_mutex);
}
+ if (dev->driver->ioctls_need_rwsem)
+ up_read...
2013 Nov 06
0
[PATCH] Btrfs: fix lockdep error in async commit
...c1>] SyS_ioctl+0x81/0xa0
[ 2372.462991] [<ffffffff817045a4>] tracesys+0xdd/0xe2
====================================================
It''s because that we don''t do the right thing when checking if it''s ok to
tell lockdep that we''re trying to release the rwsem.
If the trans handle''s type is TRANS_ATTACH, we won''t acquire the freeze rwsem, but
as TRANS_ATTACH fits the check (trans < TRANS_JOIN_NOLOCK), we''ll release the freeze
rwsem, which makes lockdep complains a lot.
Reported-by: Ma Jianpeng <majianpeng@gmail.com>...
2012 Apr 04
1
Centos 5.6 Kernel Panics
...3 12:41:25 sp2 kernel: d9d18000 bf384f01 00000ceb 0000b2f9
00000001 d9d1810c c2013ac4 edc5de40
Apr 3 12:41:25 sp2 kernel: 08515c98 c6cb37b8 c2014464 c200cc80
00000020 00000000 00000000 00000000
Apr 3 12:41:25 sp2 kernel: Call Trace:
Apr 3 12:41:25 sp2 kernel: [<c0622f16>]
rwsem_down_write_failed+0x126/0x141
Apr 3 12:41:25 sp2 kernel: [<c0439989>] .text.lock.rwsem+0x2b/0x3a
Apr 3 12:41:25 sp2 kernel: [<c046aa6a>] sys_mprotect+0xbd/0x1eb
Apr 3 12:41:25 sp2 kernel: [<c0404f4b>] syscall_call+0x7/0xb
Apr 3 12:41:25 sp2 kernel: ====================...
2016 Oct 19
10
[PATCH v4 0/5] implement vcpu preempted check
change from v3:
add x86 vcpu preempted check patch
change from v2:
no code change, fix typos, update some comments
change from v1:
a simplier definition of default vcpu_is_preempted
skip mahcine type check on ppc, and add config. remove dedicated macro.
add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
add more comments
thanks boqun and Peter's suggestion.
This patch set aims to fix lock holder preemption issues.
test-case:
perf record -a perf bench sched messaging -g 400 -p && perf report
18.09% sched-messaging [kernel.vmlinux] [k] osq_...
2016 Oct 19
10
[PATCH v4 0/5] implement vcpu preempted check
change from v3:
add x86 vcpu preempted check patch
change from v2:
no code change, fix typos, update some comments
change from v1:
a simplier definition of default vcpu_is_preempted
skip mahcine type check on ppc, and add config. remove dedicated macro.
add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
add more comments
thanks boqun and Peter's suggestion.
This patch set aims to fix lock holder preemption issues.
test-case:
perf record -a perf bench sched messaging -g 400 -p && perf report
18.09% sched-messaging [kernel.vmlinux] [k] osq_...
2016 Jun 28
11
[PATCH v2 0/4] implement vcpu preempted check
change fomr v1:
a simplier definition of default vcpu_is_preempted
skip mahcine type check on ppc, and add config. remove dedicated macro.
add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
add more comments
thanks boqun and Peter's suggestion.
This patch set aims to fix lock holder preemption issues.
test-case:
perf record -a perf bench sched messaging -g 400 -p && perf report
18.09% sched-messaging [kernel.vmlinux] [k] osq_...
2016 Jun 28
11
[PATCH v2 0/4] implement vcpu preempted check
change fomr v1:
a simplier definition of default vcpu_is_preempted
skip mahcine type check on ppc, and add config. remove dedicated macro.
add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
add more comments
thanks boqun and Peter's suggestion.
This patch set aims to fix lock holder preemption issues.
test-case:
perf record -a perf bench sched messaging -g 400 -p && perf report
18.09% sched-messaging [kernel.vmlinux] [k] osq_...
2016 Oct 28
16
[PATCH v6 00/11] implement vcpu preempted check
...patch
change from v3:
add x86 vcpu preempted check patch
change from v2:
no code change, fix typos, update some comments
change from v1:
a simplier definition of default vcpu_is_preempted
skip mahcine type check on ppc, and add config. remove dedicated macro.
add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
add more comments
thanks boqun and Peter's suggestion.
This patch set aims to fix lock holder preemption issues.
test-case:
perf record -a perf bench sched messaging -g 400 -p && perf report
18.09% sched-messaging [kernel.vmlinux] [k] osq_...