From: Chris J A. <ar...@li...> - 2008-04-25 21:29:21
|
Jason, I couldn't apply the patch against 2.6.25 because of some errors... so I manually just entered just the arch-independent code. I tested with the patch, and my machine crashed... but I'm making some modifications. A couple of comments: I am going to start adding a generic hotplug function... so if a model doesn't have oprofile_ops.hotplug it can call a generic function. In addition to arch specific functions for hotplug, I need to be able to dynamically add new cpu buffers if cpus have been made online. This can be done with a generic callback to add buffers as necessary when a cpu is onlined. I am not really sure what should be done when a cpu is DEAD, should we save the samples that have already been taken on that cpu and free that cpu buffer? or save the cpu buffer in case the cpu is brought back up again? Also in wq_sync_buffer() : if (b->cpu != smp_processor_id()) { printk("WQ on CPU%d, prefer CPU%d\n", smp_processor_id(), b->cpu); } sync_buffer(b->cpu); Do we need to check if b->cpu is online before calling sync_buffer... this is where my machine crashes in my test cases... Finally, should we add #ifdef CONFIG_HOTPLUG_CPU directives to our code to make sure that kernels that aren't built with hotplug cpu support don't have extra code that doesn't do anything or won't compile. Please let me know what you think, I will be continuing to work on the following issues on Monday. --chris On Thu, 2008-04-24 at 16:53 -0500, Jason Yeh wrote: > Chris, > > Here is the patch including the changes I have made against 2.6.25 so > far. Please keep me updated on the arch independent stuff. Let me know > if the patch is screwed up in anyway. > > Jason > > Chris J Arges wrote: > > On Thu, 2008-04-24 at 10:54 -0500, Jason Yeh wrote: > >> Chris J Arges wrote: > >> > >>> Just wondering if you mean you have started to look into CPU hotplug > >>> support. I have been working a patch that would make sure CPU buffers > >>> are allocated/deallocated appropriately (essentially a do-no-harm fix), > >>> so that my system doesn't crash when I online/offline CPUs. If you can > >>> direct me to whomever is working on this, this effort won't be > >>> duplicated. Furthermore, it might be good to look at this from an x86 > >>> perspective as I'm looking at this from a POWER perspective. > >>> > >> I started working on it but haven't made it very far yet. So far I have > >> only added a generic cpu notifier, made changes to the per cpu buffer in > >> cpu_buffer.c, and the AMD msrs allocations. > >> > >> If you have already coded the architecture independent part, I would be > >> happy to use it and only implement the x86 specific part. > >> > >> > >> Jason > >> > > Jason, > > If you could send me what you have so far, I could merge it together > > with what I have. I have only done pretty much the same amount or less. > >>From what I'm seeing the generic part needs to do the following: > > > > 1) setup callback for cpu hotplug events (put into separate file > > hotplug.c?). Make sure that this is registered during oprofile setup, > > and any arch specific stuff can be further handled in their arch > > specific setup. Call appropriate allocations of cpu buffers on ONLINE > > and DEAD events. > > > > 2) Make a function in cpu_buffers.c for allocating a new cpu buffer when > > needed, and free a cpu_buffer when a cpu is swapped out. But do we > > really need to free the buffers? > > > > 3) Make sure the cpu buffers sync correctly with the event buffer on > > allocation or deallocation events. > > > > Let me know what you think, > > thanks > > > >> ------------------------------------------------------------------------- > >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > >> Don't miss this year's exciting event. There's still time to save $100. > >> Use priority code J8TL2D2. > >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > >> _______________________________________________ > >> oprofile-list mailing list > >> opr...@li... > >> https://lists.sourceforge.net/lists/listinfo/oprofile-list > -- Chris J Arges Software Engineer IBM Linux Technology Center Austin, TX ar...@li... |