Summary: | x11-plugins/wmfire-1.2.4-r1 only monitors n-1 processors on SMP systems with n processors | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | wbk <coydog> |
Component: | Current packages | Assignee: | Gentoo Dockapp Team <desktop-dock> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | patched wmfire.c |
Description
wbk
2012-02-18 01:04:13 UTC
Thanks for the report! You can attach the patch here and I will add it to a revision bump, until a new upstream release (if any) happens. (In reply to comment #1) > Thanks for the report! You can attach the patch here and I will add it to a > revision bump, until a new upstream release (if any) happens. I'd be happy to. I've also found another closely-related bug (it didn't show up with the command-line options I normally use, but I caught it during further testing). If you don't specify a CPU or core on the command-line, and browse through cores by clicking on wmfire, the first core doesn't show up. I have a fix for this bug, too. I just need to grab an older version from my RCS repository; my local source has some color palette enhancements I am working on that shouldn't be included with the bugfix. I should be able to get this to you tonight. Please forgive my ignorance, but I am new to Gentoo and I still need to RTFM on the proper Gentoo ways of doing things. What's the proper format for posting a patch? Can I just post my patched source file here as an attachment, or would a diff be more appropriate? Thanks! Created attachment 303449 [details]
patched wmfire.c
The cleanest way to fix both SMP bugs seemed to be to split the "test" logic and return code in change_cpu()into a separate function, more_cpus(). This way, we can test for more CPU's to monitor before incrementing our current CPU. Return type of change_cpu() was changed to void to prevent confusion, since it no longer has meaningful information to return. Trying to simultaneously
check and increment the current CPU was the root cause of the SMP
issues.
I also got rid of the cpu_av flag and replaced it with a special value for cpu_id, CPU_AV = -1. I then had to create another special value (CPU_NEXT) for the "which" arg to change_cpu(), so that the pre-existing special value of -1 wouldn't conflict with CPU_NEXT. This simplifies the logic in change_cpu()/more_cpus(), since it's now only maintaining one variable instead of two.
A minor change to the main loop logic was required so that we call change_cpu() later in the process, after we've decided what we're going to monitor. This prevents skipping CPU's.
All of this has the felicitous side effect that the "average cpu" monitor can now be specified on the command line with a flag of "-c -1", which was not possible previously.
Unified diffs are generally preferred, but after your work on this I made the patch myself :) wmfire-1.4-r2 is in tree, thanks for the report and fix! (In reply to comment #4) > Unified diffs are generally preferred, but after your work on this I made the > patch myself :) > > wmfire-1.4-r2 is in tree, thanks for the report and fix! Thank you! I intend to contribute more in the future, so I will read up to on the proper gentoo procedures for patches. |