Skip to contentSkip to conversation

x86,pat Convert memtype_lock into an rw_lock.

PATCH H. Peter Anvin 3 participants 5 messages Mar 17, 2010 – Mar 24, 2010

lore
Share & tools
lore
#0 lore raw

Well, as you know :) tglx and I are on the road ... I'll try to get to it on Friday before I take off again.

Quoted 7 lines · Suresh Siddha
Quoted 5 lines · On Mon, 2010-03-15 at 06:21 -0700, [email protected] wrote:

Convert the memtype_lock from a spin_lock to an rw_lock. The first version of my patch had this and it did improve performance for fault in times. The atomic page flags patch (first in the series) improves things much greater for ram pages. This patch is to help the other pages.

Quoted 8 lines

X86 folks, can you please queue both these patches if you don't have any objections.

thanks,
suresh

--
Sent from my mobile phone, pardon any lack of formatting.

#1 lore raw
Quoted 1 line · H. Peter Anvin

Well, as you know :) tglx and I are on the road ... I'll try to get to it on Friday before I take off again.

Also I talked to Thomas about this rwlock conversion and he referred to RT issues with rwlock. And the best is to avoid this using RCU.

For now, the second patch can be perhaps dropped, as we are being proactive anyways. We can revisit this in the future.

First patch "[patch 1/2] x86,pat Update the page flags for memtype atomically instead of using memtype_lock. -V3" is good to go.

thanks,
suresh

#2 lore raw
Quoted 5 lines · Suresh Siddha
Quoted 1 line · H. Peter Anvin

Well, as you know :) tglx and I are on the road ... I'll try to get to it on Friday before I take off again.

Also I talked to Thomas about this rwlock conversion and he referred to RT issues with rwlock. And the best is to avoid this using RCU.

Its not just RT, even for mainline rwlock_t is a massive pain and often is no better (actually worse) than a spinlock due to the massive cacheline bouncing it introduces.

#3 lore raw
Quoted 10 lines · Peter Zijlstra
Quoted 5 lines · Suresh Siddha
Quoted 1 line · H. Peter Anvin

Well, as you know :) tglx and I are on the road ... I'll try to get to it on Friday before I take off again.

Also I talked to Thomas about this rwlock conversion and he referred to RT issues with rwlock. And the best is to avoid this using RCU.

Its not just RT, even for mainline rwlock_t is a massive pain and often is no better (actually worse) than a spinlock due to the massive cacheline bouncing it introduces.

Don't we have the same cacheline bouncing issues with the ticket spinlocks?

thanks,
suresh

#4 lore raw
Quoted 8 lines · Suresh Siddha
Quoted 7 lines · Peter Zijlstra
Quoted 5 lines · Suresh Siddha
Quoted 1 line · H. Peter Anvin

Well, as you know :) tglx and I are on the road ... I'll try to get to it on Friday before I take off again.

Also I talked to Thomas about this rwlock conversion and he referred to RT issues with rwlock. And the best is to avoid this using RCU.

Quoted 6 lines
Quoted 3 lines

Its not just RT, even for mainline rwlock_t is a massive pain and often is no better (actually worse) than a spinlock due to the massive cacheline bouncing it introduces.

Don't we have the same cacheline bouncing issues with the ticket spinlocks?

Sure, but the rwlock_t is unfair and can degrade into much worse performance than the spinlock.

Thing is, rwlock_t needs to write to the cacheline for each read acquire, so unless the hold time is much-much longer than the cacheline bounce time, its just not worth it, but since its a rwlock_t it should be have short hold time, hence its a useless construct :-)