Re: [PATCH] Add patch to let watchdog and perf work on Pentium4s (rhbz 713675)
On Wed, Oct 19, 2011 at 08:14:59PM -0400, Don Zickus wrote: > > Patch looks ok. The bug is against f15, but I'm assuming we want this > > on all branches. (And amusingly, f15 gets the most rejects..) > > These are 3.1 backports, so I think just f15. I assume f16 will go out > the door with 3.1? Yes. Or a really late -rc of it depending on schedule anyway. Close enough. > > the spec rejects are pretty trivial of course, but do you want to just > > create a fedora account, for committing stuff like this ? > > Backports are usually non-controversial. > > For some bizarre reason I am still enjoying other people committing my > patches. ;-p > > I think I have a fedora account (maybe not commit permission), but it > doesn't matter to me. Josh asked me to post, so I posted. :-) It's fine. I'll grab it tomorrow morning and commit it. josh ___ kernel mailing list kernel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/kernel
Re: [PATCH] Add patch to let watchdog and perf work on Pentium4s (rhbz 713675)
On Wed, Oct 19, 2011 at 04:32:07PM -0400, Dave Jones wrote: > On Wed, Oct 19, 2011 at 02:43:44PM -0400, Don Zickus wrote: > > Not sure what the patch prefence is for the mailing list. This patch > applies > > to the fedpkg kernel git tree. Better changelog below. > > > > Waiting on test feedback. > > Patch looks ok. The bug is against f15, but I'm assuming we want this > on all branches. (And amusingly, f15 gets the most rejects..) These are 3.1 backports, so I think just f15. I assume f16 will go out the door with 3.1? > > (16:24:26:davej@adamo:fedora-kernel)$ ./apply.sh f15 perf.diff > patching file kernel.spec > Hunk #1 FAILED at 649. > Hunk #2 FAILED at 1240. > 2 out of 2 hunks FAILED -- saving rejects to file kernel.spec.rej > patching file x86-p4-make-watchdog-and-perf-work-together.patch Yeah, sorry I wasn't sure if I should post the patch or the what I committed to git. > > the spec rejects are pretty trivial of course, but do you want to just > create a fedora account, for committing stuff like this ? > Backports are usually non-controversial. For some bizarre reason I am still enjoying other people committing my patches. ;-p I think I have a fedora account (maybe not commit permission), but it doesn't matter to me. Josh asked me to post, so I posted. :-) Cheers, Don ___ kernel mailing list kernel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/kernel
Re: [PATCH] Add patch to let watchdog and perf work on Pentium4s (rhbz 713675)
On Wed, Oct 19, 2011 at 04:32:07PM -0400, Dave Jones wrote: > On Wed, Oct 19, 2011 at 02:43:44PM -0400, Don Zickus wrote: > > Not sure what the patch prefence is for the mailing list. This patch > applies > > to the fedpkg kernel git tree. Better changelog below. > > > > Waiting on test feedback. > > Patch looks ok. The bug is against f15, but I'm assuming we want this > on all branches. (And amusingly, f15 gets the most rejects..) > > (16:24:26:davej@adamo:fedora-kernel)$ ./apply.sh f15 perf.diff > patching file kernel.spec > Hunk #1 FAILED at 649. > Hunk #2 FAILED at 1240. > 2 out of 2 hunks FAILED -- saving rejects to file kernel.spec.rej > patching file x86-p4-make-watchdog-and-perf-work-together.patch This should only be needed on f15. Don probably diffed this before I added a few commits to f15 yesterday afternoon. josh ___ kernel mailing list kernel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/kernel
Re: [PATCH] Add patch to let watchdog and perf work on Pentium4s (rhbz 713675)
On Wed, Oct 19, 2011 at 02:43:44PM -0400, Don Zickus wrote: > Not sure what the patch prefence is for the mailing list. This patch applies > to the fedpkg kernel git tree. Better changelog below. > > Waiting on test feedback. Patch looks ok. The bug is against f15, but I'm assuming we want this on all branches. (And amusingly, f15 gets the most rejects..) (16:24:26:davej@adamo:fedora-kernel)$ ./apply.sh f15 perf.diff patching file kernel.spec Hunk #1 FAILED at 649. Hunk #2 FAILED at 1240. 2 out of 2 hunks FAILED -- saving rejects to file kernel.spec.rej patching file x86-p4-make-watchdog-and-perf-work-together.patch (16:24:35:davej@adamo:fedora-kernel)$ ./apply.sh f16 perf.diff patching file kernel.spec Hunk #1 FAILED at 649. Hunk #2 succeeded at 1355 with fuzz 2 (offset 115 lines). 1 out of 2 hunks FAILED -- saving rejects to file kernel.spec.rej patching file x86-p4-make-watchdog-and-perf-work-together.patch (16:24:39:davej@adamo:fedora-kernel)$ ./apply.sh master perf.diff patching file kernel.spec Hunk #1 FAILED at 649. Hunk #2 succeeded at 1347 with fuzz 2 (offset 107 lines). 1 out of 2 hunks FAILED -- saving rejects to file kernel.spec.rej patching file x86-p4-make-watchdog-and-perf-work-together.patch the spec rejects are pretty trivial of course, but do you want to just create a fedora account, for committing stuff like this ? Backports are usually non-controversial. Dave ___ kernel mailing list kernel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/kernel
[PATCH] Add patch to let watchdog and perf work on Pentium4s (rhbz 713675)
Not sure what the patch prefence is for the mailing list. This patch applies to the fedpkg kernel git tree. Better changelog below. Waiting on test feedback. Cheers, Don --- kernel.spec |2 + x86-p4-make-watchdog-and-perf-work-together.patch | 267 + 2 files changed, 269 insertions(+), 0 deletions(-) create mode 100644 x86-p4-make-watchdog-and-perf-work-together.patch diff --git a/kernel.spec b/kernel.spec index 176dbfc..f6eccf6 100644 --- a/kernel.spec +++ b/kernel.spec @@ -649,6 +649,7 @@ Patch12016: disable-i8042-check-on-apple-mac.patch Patch12023: ums-realtek-driver-uses-stack-memory-for-DMA.patch Patch12024: usb-add-quirk-for-logitech-webcams.patch Patch12025: crypto-register-cryptd-first.patch +Patch12026: x86-p4-make-watchdog-and-perf-work-together.patch # Runtime power management Patch12203: linux-2.6-usb-pci-autosuspend.patch @@ -1240,6 +1241,7 @@ ApplyPatch add-appleir-usb-driver.patch ApplyPatch ums-realtek-driver-uses-stack-memory-for-DMA.patch ApplyPatch usb-add-quirk-for-logitech-webcams.patch ApplyPatch crypto-register-cryptd-first.patch +ApplyPatch x86-p4-make-watchdog-and-perf-work-together.patch # rhbz#605888 ApplyPatch dmar-disable-when-ricoh-multifunction.patch diff --git a/x86-p4-make-watchdog-and-perf-work-together.patch b/x86-p4-make-watchdog-and-perf-work-together.patch new file mode 100644 index 000..9ef049b --- /dev/null +++ b/x86-p4-make-watchdog-and-perf-work-together.patch @@ -0,0 +1,267 @@ +BZ https://bugzilla.redhat.com/show_bug.cgi?id=713675 + +Let nmi watchdog and perf work together on a P4. Combination of the following 3.1 +upstream commits (the second commit reverts the first one). + +commit 1880c4ae182afb5650c5678949ecfe7ff66a724e +Author: Cyrill Gorcunov +Date: Thu Jun 23 16:49:18 2011 +0400 + +perf, x86: Add hw_watchdog_set_attr() in a sake of nmi-watchdog on P4 + +Due to restriction and specifics of Netburst PMU we need a separated +event for NMI watchdog. In particular every Netburst event +consumes not just a counter and a config register, but also an +additional ESCR register. + +Since ESCR registers are grouped upon counters (i.e. if ESCR is occupied +for some event there is no room for another event to enter until its +released) we need to pick up the "least" used ESCR (or the most available +one) for nmi-watchdog purposes -- so MSR_P4_CRU_ESCR2/3 was chosen. + +With this patch nmi-watchdog and perf top should be able to run simultaneously. + +Signed-off-by: Cyrill Gorcunov +CC: Lin Ming +CC: Arnaldo Carvalho de Melo +CC: Frederic Weisbecker +Tested-and-reviewed-by: Don Zickus +Tested-and-reviewed-by: Stephane Eranian +Signed-off-by: Peter Zijlstra +Link: http://lkml.kernel.org/r/20110623124918.GC13050@sun +Signed-off-by: Ingo Molnar + +commit f91298709790b9a483752ca3c967845537df2af3 +Author: Cyrill Gorcunov +Date: Sat Jul 9 00:17:12 2011 +0400 + +perf, x86: P4 PMU - Introduce event alias feature + +Instead of hw_nmi_watchdog_set_attr() weak function +and appropriate x86_pmu::hw_watchdog_set_attr() call +we introduce even alias mechanism which allow us +to drop this routines completely and isolate quirks +of Netburst architecture inside P4 PMU code only. + +The main idea remains the same though -- to allow +nmi-watchdog and perf top run simultaneously. + +Note the aliasing mechanism applies to generic +PERF_COUNT_HW_CPU_CYCLES event only because arbitrary +event (say passed as RAW initially) might have some +additional bits set inside ESCR register changing +the behaviour of event and we can't guarantee anymore +that alias event will give the same result. + +P.S. Thanks a huge to Don and Steven for for testing + and early review. + +Acked-by: Don Zickus +Tested-by: Steven Rostedt +Signed-off-by: Cyrill Gorcunov +CC: Ingo Molnar +CC: Peter Zijlstra +CC: Stephane Eranian +CC: Lin Ming +CC: Arnaldo Carvalho de Melo +CC: Frederic Weisbecker +Link: http://lkml.kernel.org/r/20110708201712.GS23657@sun +Signed-off-by: Steven Rostedt + + +diff --git a/arch/x86/include/asm/perf_event_p4.h b/arch/x86/include/asm/perf_event_p4.h +index 56fd9e3..4d86c86 100644 +--- a/arch/x86/include/asm/perf_event_p4.h b/arch/x86/include/asm/perf_event_p4.h +@@ -102,6 +102,14 @@ + #define P4_CONFIG_HT (1ULL << P4_CONFIG_HT_SHIFT) + + /* ++ * If an event has alias it should be marked ++ * with a special bit. (Don't forget to check ++ * P4_PEBS_CONFIG_MASK and related bits on ++ * modification.) ++ */ ++#define P4_CONFIG_ALIASABLE (1 << 9) ++ ++/* + * The bits we allow to pass for RAW events + */ + #define P4_CONFIG_MASK_ESCR \ +@@ -123,6 +131,31 @@ + (p4_config_pack_escr(P4_CONFIG_MASK_ESCR)) | \ +