[git commit] ash: 16-bit ->nprocs field is a pain for many CPUs

Denys Vlasenko vda.linux at googlemail.com
Wed Jan 11 17:44:15 UTC 2017


commit: https://git.busybox.net/busybox/commit/?id=4c179373e07fbc1d8fc8e53c7096fce9ee4b08b6
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
getoptscmd                                           527     540     +13
getjob                                               280     286      +6
makejob                                              278     282      +4
forkchild                                            602     600      -2
waitcmd                                              208     205      -3
showjob                                              382     379      -3
getstatus                                             83      80      -3
dowait                                               408     405      -3
freejob                                               93      89      -4
fg_bgcmd                                             290     286      -4
forkshell                                            260     255      -5
killcmd                                              224     218      -6
jobno                                                 17      11      -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/10 up/down: 23/-39)           Total: -16 bytes

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/shell/ash.c b/shell/ash.c
index 02545f5..bfdd940 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3392,12 +3392,13 @@ struct job {
 #if JOBS
 	int stopstatus;         /* status of a stopped job */
 #endif
-	uint32_t
-		nprocs: 16,     /* number of processes */
-		state: 8,
+	unsigned nprocs;        /* number of processes */
+
 #define JOBRUNNING      0       /* at least one proc running */
 #define JOBSTOPPED      1       /* all procs are stopped */
 #define JOBDONE         2       /* all procs are completed */
+	unsigned
+		state: 8,
 #if JOBS
 		sigint: 1,      /* job was killed by SIGINT */
 		jobctl: 1,      /* job running under job control */


More information about the busybox-cvs mailing list