Skip to contentSkip to conversation

ARM perf events spin locks

DISCUSSION Jamie Iles 3 participants 8 messages Nov 30, 2010

lore
Share & tools
lore

Jamie Iles

author
#0 lore raw

Hi Will,

I think we should convert the spinlocks in the ARM perf events code to raw spinlocks for realtime. Should we wait for your split set to get merged first before doing this?

Jamie

#1 lore raw
Quoted 1 line

Hi Will,

Hello,

Quoted 3 lines

I think we should convert the spinlocks in the ARM perf events code to raw spinlocks for realtime. Should we wait for your split set to get merged first before doing this?

Since this is a logically separate change, I think we're better off waiting until the split stuff has been merged. As for the raw spinlocks, by realtime do you mean PREEMPT_RT? Also, do we actually *need* raw spinlocks in the perf code?

Will

author
#2 lore raw
Quoted 4 lines · Will Deacon
Quoted 1 line

Hi Will,

Hello,

Quoted 8 lines
Quoted 3 lines

I think we should convert the spinlocks in the ARM perf events code to raw spinlocks for realtime. Should we wait for your split set to get merged first before doing this?

Since this is a logically separate change, I think we're better off waiting until the split stuff has been merged. As for the raw spinlocks, by realtime do you mean PREEMPT_RT? Also, do we actually *need* raw spinlocks in the perf code?

Yes, I meant PREEMPT_RT. It won't stop working without raw spinlocks but I'm not convinced that we couldn't lose too much accuracy with normal spinlocks. I am however willing to be convinced otherwise!

Jamie

#3 lore raw

Jamie,

Quoted 9 lines · Will Deacon
Quoted 8 lines
Quoted 1 line

Hi Will,

Hello,

Quoted 3 lines

I think we should convert the spinlocks in the ARM perf events code to raw spinlocks for realtime. Should we wait for your split set to get merged first before doing this?

Quoted 7 lines
Quoted 4 lines

Since this is a logically separate change, I think we're better off waiting until the split stuff has been merged. As for the raw spinlocks, by realtime do you mean PREEMPT_RT? Also, do we actually *need* raw spinlocks in the perf code?

Yes, I meant PREEMPT_RT. It won't stop working without raw spinlocks but I'm not convinced that we couldn't lose too much accuracy with normal spinlocks. I am however willing to be convinced otherwise!

Well struct perf_event_ctx has a lock field which is of type raw_spinlock_t. I *think* this is always held by the core perf code before calling the backend, however IRQs may still be enabled so we probably do need to change our pmu_lock.

Is that a sane analysis?

Will

author
#4 lore raw
Quoted 19 lines · Will Deacon

Jamie,

Quoted 9 lines · Will Deacon
Quoted 8 lines
Quoted 1 line

Hi Will,

Hello,

Quoted 3 lines

I think we should convert the spinlocks in the ARM perf events code to raw spinlocks for realtime. Should we wait for your split set to get merged first before doing this?

Quoted 7 lines
Quoted 4 lines

Since this is a logically separate change, I think we're better off waiting until the split stuff has been merged. As for the raw spinlocks, by realtime do you mean PREEMPT_RT? Also, do we actually *need* raw spinlocks in the perf code?

Yes, I meant PREEMPT_RT. It won't stop working without raw spinlocks but I'm not convinced that we couldn't lose too much accuracy with normal spinlocks. I am however willing to be convinced otherwise!

Quoted 5 lines

Well struct perf_event_ctx has a lock field which is of type raw_spinlock_t. I *think* this is always held by the core perf code before calling the backend, however IRQs may still be enabled so we probably do need to change our pmu_lock.

Is that a sane analysis?

That sounds perfectly reasonable to me! We don't hold these locks for any potentially long periods of time so it's probably better to be safe! Do you want me to make this change after perf-split is merged or is that something you're happy to do?

Jamie

#5 lore raw
Quoted 9 lines
Quoted 5 lines

Well struct perf_event_ctx has a lock field which is of type raw_spinlock_t. I *think* this is always held by the core perf code before calling the backend, however IRQs may still be enabled so we probably do need to change our pmu_lock.

Is that a sane analysis?

That sounds perfectly reasonable to me! We don't hold these locks for any potentially long periods of time so it's probably better to be safe! Do you want me to make this change after perf-split is merged or is that something you're happy to do?

I don't mind doing it as a separate patch after Russell has pulled my perf-split branch. I don't think it should form part of the pull though because it's unrelated.

Will

#6 lore raw
Quoted 4 lines · Will Deacon
Quoted 4 lines
Quoted 4 lines

Well struct perf_event_ctx has a lock field which is of type raw_spinlock_t. I *think* this is always held by the core perf code before calling the backend, however IRQs may still be enabled so we probably do need to change our pmu_lock.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Is that a sane analysis?

That sounds perfectly reasonable to me! We don't hold these locks for any potentially long periods of time so it's probably better to be safe! Do you want me to make this change after perf-split is merged or is that something you're happy to do?

I don't mind doing it as a separate patch after Russell has pulled my perf-split branch.

You mean this?

commit f1690d17d2c7afa2a2079e3c91eb2bca8c1c5ecd
Merge: 612275a 43eab87
Author: Russell King <[email protected]>
Date: Fri Nov 26 10:26:43 2010 +0000

Merge branch 'perf-split' of git://linux-arm.org/linux-2.6-wd into devel-stable

Sorry, I didn't push the tree out for a week or so because I was busy with other things (like the pgtable stuff.)

#7 lore raw
Quoted 11 lines
Quoted 2 lines

I don't mind doing it as a separate patch after Russell has pulled my perf-split branch.

You mean this?

commit f1690d17d2c7afa2a2079e3c91eb2bca8c1c5ecd
Merge: 612275a 43eab87
Author: Russell King <[email protected]>
Date: Fri Nov 26 10:26:43 2010 +0000

Merge branch 'perf-split' of git://linux-arm.org/linux-2.6-wd into devel-stable

Aha, brilliant - thanks.

Quoted 2 lines

Sorry, I didn't push the tree out for a week or so because I was busy with other things (like the pgtable stuff.)

There's no rest for the weary! I'll submit the patch to fix perf for sparse to the patch system (I didn't realise you'd pulled my changes on Friday) and tackle this spinlock thing at the same time.

Cheers,

Will