ltp: handle missing online file
PATCH 1/1 ltp: handle missing online file
gather_node_cpus() fails if the /sys/devices/system/node/nodeX/cpuX/online file is missing for any cpu other than cpu0. The absence of the online file should not be treated as a failure, but as an indication that the cpu is not hot-pluggable and cannot be taken offline.
testcases/kernel/mem/lib/mem.c +7 -9
@@ -786,16 +786,14 @@ static void gather_node_cpus(char *cpus, long nd)if (path_exist (path, nd, i)) {snprintf (path1,BUFSIZ ,"%s/online" , path);/* -* No cpu0/online knob, as it can't support to -* on/offline cpu0, so if the 'nd' node contains -* cpu0, it should skip to check cpu0/online's value. +* if there is no online knob, then the cpu cannot +* be taken offline */ -if (i ==0 ) - goto next; -SAFE_FILE_SCANF (cleanup, path1,"%ld" , &online); -if (online ==0 ) -continue ; -next: +if (path_exist (path1)) { +SAFE_FILE_SCANF (cleanup, path1,"%ld" , &online); +if (online ==0 ) +continue ; + }sprintf (buf,"%d," , i);strcat (cpus, buf); }
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 6 lines · Dave Kleikamp
gather_node_cpus()fails if the/sys/devices/system/node/nodeX/cpuX/onlinefile is missing for any cpu other than cpu0. The absence of the online file should not be treated as a failure, but as an indication that the cpu is not hot-pluggable and cannot be taken offline.Signed-off-by Dave Kleikamp <[email protected]>
Quoted 32 lines
testcases/kernel/mem/lib/mem.c +7
-10@@ -786,16 +786,14 @@ static void gather_node_cpus(char *cpus, long nd)if (path_exist (path, nd, i)) {snprintf (path1,BUFSIZ ,"%s/online" , path);/* -* No cpu0/online knob, as it can't support to -* on/offline cpu0, so if the 'nd' node contains -* cpu0, it should skip to check cpu0/online's value. +* if there is no online knob, then the cpu cannot +* be taken offline */ -if (i ==0 ) - goto next; -SAFE_FILE_SCANF (cleanup, path1,"%ld" , &online); -if (online ==0 ) -continue ; -next: +if (path_exist (path1)) { +SAFE_FILE_SCANF (cleanup, path1,"%ld" , &online); +if (online ==0 ) +continue ; + }sprintf (buf,"%d," , i);strcat (cpus, buf); } ------------------------------------------------------------------------------Introducing Performance Central, a new site from SourceForge and
Quoted 9 lines
AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
----- Original Message -----
Quoted 11 lines
From: "Dave Kleikamp" <[email protected]>
To: [email protected]
Sent: Tuesday, 20 August, 2013 10:34:39 PM
Subject: [LTP] [PATCH] ltp: handle missing online file
gather_node_cpus()fails if the/sys/devices/system/node/nodeX/cpuX/onlinefile is missing for any cpu other than cpu0. The absence of the online file should not be treated as a failure, but as an indication that the cpu is not hot-pluggable and cannot be taken offline.Signed-off-by Dave Kleikamp <[email protected]>
Looks good to me. One comment inline.
testcases/kernel/mem/lib/mem.c static void gather_node_cpus(char *cpus, long nd) · line 786
Quoted 7 lines
testcases/kernel/mem/lib/mem.c +0
-0@@ -786,16 +786,14 @@ static void gather_node_cpus(char *cpus, long nd)if (path_exist (path, nd, i)) {
^^ ^^
|---|--> Are these parameters used for anything?
Line above already does snprintf.Quoted 25 lines
testcases/kernel/mem/lib/mem.c +7
-10snprintf (path1,BUFSIZ ,"%s/online" , path);/* -* No cpu0/online knob, as it can't support to -* on/offline cpu0, so if the 'nd' node contains -* cpu0, it should skip to check cpu0/online's value. +* if there is no online knob, then the cpu cannot +* be taken offline */ -if (i ==0 ) - goto next; -SAFE_FILE_SCANF (cleanup, path1,"%ld" , &online); -if (online ==0 ) -continue ; -next: +if (path_exist (path1)) { +SAFE_FILE_SCANF (cleanup, path1,"%ld" , &online); +if (online ==0 ) +continue ; + }sprintf (buf,"%d," , i);strcat (cpus, buf); } ------------------------------------------------------------------------------Introducing Performance Central, a new site from SourceForge and
Quoted 9 lines
AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 22 lines · Jan Stancek
----- Original Message -----
Quoted 11 lines
From: "Dave Kleikamp" <[email protected]>
To: [email protected]
Sent: Tuesday, 20 August, 2013 10:34:39 PM
Subject: [LTP] [PATCH] ltp: handle missing online file
gather_node_cpus()fails if the/sys/devices/system/node/nodeX/cpuX/onlinefile is missing for any cpu other than cpu0. The absence of the online file should not be treated as a failure, but as an indication that the cpu is not hot-pluggable and cannot be taken offline.Signed-off-by Dave Kleikamp <[email protected]>Looks good to me. One comment inline.
Reviewed-by Jan Stancek <[email protected]>Quoted 1 line
Quoted 9 lines
testcases/kernel/mem/lib/mem.c static void gather_node_cpus(char *cpus, long nd) · line 786
Quoted 6 lines
testcases/kernel/mem/lib/mem.c +0
-0@@ -786,16 +786,14 @@ static void gather_node_cpus(char *cpus, long nd)if (path_exist (path, nd, i)) {^^ ^^ |---|--> Are these parameters used for anything? Line above already does snprintf.
They aren't. That's why I left them off the call I added below.
Quoted 15 lines
Quoted 15 lines
testcases/kernel/mem/lib/mem.c +2
-9snprintf (path1,BUFSIZ ,"%s/online" , path);/* -* No cpu0/online knob, as it can't support to -* on/offline cpu0, so if the 'nd' node contains -* cpu0, it should skip to check cpu0/online's value. +* if there is no online knob, then the cpu cannot +* be taken offline */ -if (i ==0 ) - goto next; -SAFE_FILE_SCANF (cleanup, path1,"%ld" , &online); -if (online ==0 ) -continue ; -next:
Quoted 8 lines
testcases/kernel/mem/lib/mem.c static void gather_node_cpus(char *cpus, long nd) · line 799
Quoted 8 lines
testcases/kernel/mem/lib/mem.c +5
-0+if (path_exist (path1)) { +SAFE_FILE_SCANF (cleanup, path1,"%ld" , &online); +if (online ==0 ) +continue ; + }sprintf (buf,"%d," , i);strcat (cpus, buf); }
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list