Skip to contentSkip to conversation

Rename "swapper" to "idle"

PATCH In review Hua Zhong 7 participants 9 messages Apr 20, 2006 – Apr 21, 2006

lore
Share & tools
lore

Hua Zhong

author
#0 lore raw

PATCH 1/1 Rename "swapper" to "idle"

This patch renames the "swapper" process (pid 0) to a more appropriate name "idle". The name "swapper" is not obviously meaningful and confuses a lot of people (e.g., when seen in oops report).

Patch not tested, but I guess it works. :-)

include/linux/init_task.h +1 -1
index 41ecbb8..5e3ca4f 100644
@@ -108,7 +108,7 @@ #define INIT_TASK(tsk)      \
       .cap_permitted  = CAP_FULL_SET,                                 \
       .keep_capabilities = 0,                                         \
       .user           = INIT_USER,                                    \
-       .comm           = "swapper",                                    \
+       .comm           = "idle",                                       \
       .thread         = INIT_THREAD,                                  \
       .fs             = &init_fs,                                     \
       .files          = &init_files,                                  \
#1 lore raw
Quoted 3 lines · Hua Zhong

This patch renames the "swapper" process (pid 0) to a more appropriate name "idle". The name "swapper" is not obviously meaningful and confuses a lot of people (e.g., when seen in oops report).

Patch not tested, but I guess it works. :-)

Usually a patch not tested will never be accepted no matter how trivial it is, unless you had to modify a driver to match a new syntax or something and you don't have the device. Did you at least compile it?

Quoted 8 lines
include/linux/init_task.h +0 -0
index 41ecbb8..5e3ca4f 100644

include/linux/init_task.h #define INIT_TASK(tsk) \

Quoted 9 lines
include/linux/init_task.h +1 -2
@@ -108,7 +108,7 @@ #define INIT_TASK(tsk)      \
        .cap_permitted  = CAP_FULL_SET,                                 \
        .keep_capabilities = 0,                                         \
        .user           = INIT_USER,                                    \
-       .comm           = "swapper",                                    \
+       .comm           = "idle",                                       \
        .thread         = INIT_THREAD,                                  \
        .fs             = &init_fs,                                     \
        .files          = &init_files,                                  \
-

Yes, swapper is because of historical reasons. In most text books for Unix, the initial process on boot up is called "swapper". Probably because those early Unix systems had this process handle the swapping (as kswapd does today).

By doing this, it will probably make Linux out of sync with all the text books on Unix, so it really is Linus' call.

-- Steve

#2 lore raw
In reply to Hua Zhong
Quoted 2 lines · Hua Zhong

This patch renames the "swapper" process (pid 0) to a more appropriate name "idle". The name "swapper" is not obviously meaningful and confuses a lot of people (e.g., when seen in oops report). Patch not tested, but I guess it works. :-)

on win the system idle process shows up in taskmanager so you can see its cpu usage and ctx switches scheduled from it. We could avoid the skipping in /proc, also?

Gruss
Bernd

#3 lore raw
Quoted 3 lines · Bernd Eckenfels
Quoted 2 lines · Hua Zhong

This patch renames the "swapper" process (pid 0) to a more appropriate name "idle". The name "swapper" is not obviously meaningful and confuses a lot of people (e.g., when seen in oops report). Patch not tested, but I guess it works. :-)

As we saw in "Which process is associated with process ID 0 (swapper)", pid 0 can actually do things, such as resend TCP packets. Methinks idle isn't the best name either.

Quoted 7 lines

on win the system idle process shows up in taskmanager so you can see its cpu usage and ctx switches scheduled from it. We could avoid the skipping in /proc, also?

Gruss
Bernd

Please, no!

I already have to explain this mess about Windows. We shouldn't be implementing Microsoft's flaws. Why waist the a line of screen for top?

author
#4 lore raw
Quoted 11 lines · Bernd Eckenfels
Quoted 2 lines
Quoted 1 line · Hua Zhong

This patch renames the "swapper" process (pid 0) to a

more appropriate name "idle". The name "swapper" is not obviously meaningful and confuses a lot of people (e.g., when seen in oops report).

Quoted 1 line
Quoted 1 line

Patch not tested, but I guess it works. :-)

As we saw in "Which process is associated with process ID 0 (swapper)", pid 0 can actually do things, such as resend TCP packets. Methinks idle isn't the best name either.

Swapper does not do these things. It just happens to be "running" at that time (and it is always running if the system is idle).

IOW, it is indeed an "idle" process. In fact, all it does is cpu_idle().

Quoted 19 lines
Quoted 1 line

on win the system idle process shows up in taskmanager so

you can see

Quoted 1 line

its cpu usage and ctx switches scheduled from it. We could

avoid the

Quoted 4 lines

skipping in /proc, also?

Gruss
Bernd

Please, no!

I already have to explain this mess about Windows. We shouldn't be implementing Microsoft's flaws. Why waist the a line of screen for top?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#5 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Hua Zhong

Swapper does not do these things. It just happens to be "running" at that time (and it is always running if the system is idle).

IOW, it is indeed an "idle" process. In fact, all it does is cpu_idle().

Really? Are your sure that swapper only does cpu_idle()??? -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFESO7nNWc9T2Wr2JcRAkRlAJwIJumKnS0tj1BvhYZPfoChR7fSAwCdEcC9 TFKn1OA9Wv448TqFU1bxk5k=
=eGf2
-----END PGP SIGNATURE-----

#6 lore raw
Quoted 6 lines · Mikado
Quoted 3 lines · Hua Zhong

Swapper does not do these things. It just happens to be "running" at that time (and it is always running if the system is idle).

IOW, it is indeed an "idle" process. In fact, all it does is cpu_idle().

Really? Are your sure that swapper only does cpu_idle()???

Yes.
Idle is by definition Nothing.

Signature · 1 line
Greetings Michael.
#7 lore raw
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

Swapper does not do these things. It just happens to be "running" at that time (and it is always running if the system is idle).

IOW, it is indeed an "idle" process. In fact, all it does is cpu_idle().

Really? Are your sure that swapper only does cpu_idle()???

Yes.
Idle is by definition Nothing.

So call it "voidd" :>

Jan Engelhardt

#8 lore raw
Quoted 11 lines · Jan Engelhardt
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

Swapper does not do these things. It just happens to be "running" at that time (and it is always running if the system is idle).

IOW, it is indeed an "idle" process. In fact, all it does is cpu_idle().

Really? Are your sure that swapper only does cpu_idle()???

Yes.
Idle is by definition Nothing.

So call it "voidd" :>

That should be "kvoidd" :P

-- Steve