From: Dominik Brodowski Subject: Re: [PATCH] Hotplug cpu: fix p4-clockmod Date: Sun, 5 Sep 2004 09:31:14 +0200 Sender: cpufreq-bounces@www.linux.org.uk Message-ID: <20040905073114.GA18513@dominikbrodowski.de> References: <20040829125717.GA17032@dominikbrodowski.de> <20040830200407.GB8563@dominikbrodowski.de> <20040830214707.GA9324@dominikbrodowski.de> <20040903153727.GA9969@dominikbrodowski.de> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cpufreq-bounces+glkc-cpufreq=gmane.org@www.linux.org.uk Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Zwane Mwaikambo Cc: CPU Freq ML On Sat, Sep 04, 2004 at 09:00:19PM -0400, Zwane Mwaikambo wrote: > On Fri, 3 Sep 2004, Dominik Brodowski wrote: > > > But I _really_ _don't_ _like_ _it_. Having to disable preemption for the > > corner case of CPU hotplug. How often do CPU hotplug events happen? Very > > rarely compared to _other_ valid preempting code, e.g. audio IRQs... And I > > don't see _any_ reason why CPU hotplug couldn't wait until a cpufreq request > > for a CPU is finished. However, the current CPU hotplug notifiers don't > > allow for this: they only notify the notifiers if the CPU is down, not > > before to avoid migrating to/switching frequency of the dying CPU. > > Well interrupts would still preempt (side note, do any of these hardware > programming have timing requirements? If so preempt might be a problem > anyway) those scheduling preemption disabled sections. Interrupts yes, but not interrupt handling threads [voluntary_preempt] or even "interrupt users" like a video player which requested more data... And concerning hardwre requirements: AFAIK there are only requirements of _minimum_ and not maximum delay between certain "steps" in the switching process. > > A) > > > > DOWN: > > 1.) notifier informs cpufreq that CPU is dying > > 2.) cpufreq grabs policy lock > > 3.) sets a flag or something so that future cpufreq-related calls for this > > CPU will fail > > 4.) cpufreq release policy lock > > 5.) cpu is removed from online_map .... > > > > > > UP: > > 1.) cpu is online > > 2.) notifier informs cpufreq that CPU is ONLINE > > 3.) cpufreq grabs policy lock > > 4.) clears the flag mentioned above > > > > Problem: ->exit() and ->init() aren't called for the CPU going off- or > > online which means that changes in their cpufreq capabilities won't be > > noticed. > > Well the major differences between A and B appear to be discovery of new > capabilities on online processors. I wouldn't go that far as asynchronous > multiprocessing systems aren't supported in general, _yet_. AMD allows for different max freqs in their Opteron systems, the new time-of-day core will support different-freq CPUs soon, so this is indeed an issue. Thanks, Dominik