Re: [PATCH] rtas_errd: Add support for cpu and memory hotplugging via RTAS event
Thomas Falcon <[email protected]> Mon, 10 Nov 2014 13:37:38 -0600
| Newsgroups | gmane.linux.tools.diag.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --------------030201040202000004060709 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 11/09/2014 10:53 PM, Vasant Hegde wrote: > On 11/07/2014 10:46 PM, Thomas Falcon wrote: >> On 11/06/2014 11:40 PM, Vasant Hegde wrote: >>> On 11/05/2014 12:03 AM, Thomas Falcon wrote: >>>> This patch adds support for handling RTAS hotplug events for cpus and memory >>>> blocks in addition to such events for pci devices. It includes additional >>>> support for events indicating an addition or a removal of multiple cpus or >>>> logical memory blocks. Finally, for debugging purposes, it includes the option >>>> to handle the event without calling the drmgr command. >>>> >>> >>> Thomas, >>> >>> Patch looks good. Could you please describe how to test this patch? >> >> Thanks. To test, I used a cpu or memory hotplug event file, and ran rtas_errd with that file as input: >> >> rtas_errd -d -f hotplug_file.txt >> >> You can include the "-R" option if you want to run drmgr. With that option, it does everything except actually running the drmgr command. >> >> rtas_errd -d -R -f hotplug_file.txt > > Thanks! > > I'm planning to add testsuite for rtas_errd (and few other tools). Could you please pass input file to me (hotplug_file.txt) so that when we write test cases we will include this as well. Sure. Right now the file contains hotplug event that requests adding 1 cpu. But there is the capability to add or remove multiple cpus, memory blocks, and by drc_index. You might need to have multiple test files. tom > > -Vasant > >> >>> >>> @Nathan, >>> >>> Could you please Ack this one ? >>> >>> -Vasant >>> >>>> Signed-off-by: Thomas Falcon <[email protected]> >>>> --- >>>> rtas_errd/hotplug.c | 16 ++++++++++++++++ >>>> 1 file changed, 16 insertions(+) >>>> >>>> diff --git a/rtas_errd/hotplug.c b/rtas_errd/hotplug.c >>>> index 0f84f8d..91036b2 100644 >>>> --- a/rtas_errd/hotplug.c >>>> +++ b/rtas_errd/hotplug.c >>>> @@ -24,6 +24,7 @@ void handle_hotplug_event(struct event *re) >>>> pid_t child; >>>> int status, rc; >>>> char drc_index[11]; >>>> + char count[4]; >>>> char *drmgr_args[] = { DRMGR_PROGRAM_NOPATH, "-c", NULL, NULL, NULL, >>>> NULL, NULL, "-d4", "-V", NULL}; >>>> >>>> @@ -39,6 +40,12 @@ void handle_hotplug_event(struct event *re) >>>> drmgr_args[2] = "pci"; >>>> drmgr_args[6] = "-n"; >>>> break; >>>> + case RTAS_HP_TYPE_CPU: >>>> + drmgr_args[2] = "cpu"; >>>> + break; >>>> + case RTAS_HP_TYPE_MEMORY: >>>> + drmgr_args[2] = "mem"; >>>> + break; >>>> default: >>>> dbg("Unknown or unsupported hotplug type %d\n", >>>> hotplug->type); >>>> @@ -63,6 +70,11 @@ void handle_hotplug_event(struct event *re) >>>> snprintf(drc_index, 11, "%#x", hotplug->u1.drc_index); >>>> drmgr_args[5] = drc_index; >>>> break; >>>> + case RTAS_HP_ID_DRC_COUNT: >>>> + drmgr_args[4] = "-q"; >>>> + snprintf(count, 4, "%u", hotplug->u1.count); >>>> + drmgr_args[5] = count; >>>> + break; >>>> default: >>>> dbg("Unknown or unsupported hotplug identifier %d\n", >>>> hotplug->identifier); >>>> @@ -73,6 +85,10 @@ void handle_hotplug_event(struct event *re) >>>> drmgr_args[1], drmgr_args[2], drmgr_args[3], >>>> drmgr_args[4], drmgr_args[5], drmgr_args[6]); >>>> >>>> +#ifdef DEBUG >>>> + if(no_drmgr) >>>> + return; >>>> +#endif >>>> /* invoke drmgr */ >>>> dbg("Invoke drmgr command\n"); >>>> >>> >> > --------------030201040202000004060709 Content-Type: text/plain; charset=UTF-8; name="hotplug_test" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="hotplug_test" UlRBUzogMSAtLS0tLS0tLSBSVEFTIGV2ZW50IGJlZ2luIC0tLS0tLS0tClJUQVMgMDogMDYz NDYwZTUgMDAwMDAwNjggODYwMDhlMDAgMDAwMDAwMDAKUlRBUyAxOiAwMDAwMDAwMCA0OTQy NGQwMCA1MDQ4MDAzMCAwMDAwMDAwMApSVEFTIDI6IDIwMTQwOTIzIDIzNTI1NDAwIDAwMDAw MDAwIDAwMDAwMDAwClJUQVMgMzogNDgwMDAwMDMgMDAwMDAwMDAgMDAwMDAwMDAgMDAwMDAw MDAKUlRBUyA0OiAwMDAwMDAwMCAwMDAwMDAwMCA1NTQ4MDAxOCAwMDAwMDAwMApSVEFTIDU6 IDgwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwClJUQVMgNjogNDg1MDAwMTAg MDEwMDAwMDAgMDEwMTAzMDAgMDAwMDAwMDEKUlRBUzogMSAtLS0tLS0tLSBSVEFTIGV2ZW50 IGVuZCAtLS0tLS0tLS0tCg== --------------030201040202000004060709 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk --------------030201040202000004060709 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-diag-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-diag-devel --------------030201040202000004060709--