Commit 163ecdff060f2fa9e8f5238882fd0137493556a6
Committed by
Linus Torvalds
1 parent
d94a041519
Exists in
master
and in
20 other branches
[PATCH] delay accounting: temporarily enable by default
Enable delay accounting by default so that feature gets coverage testing without requiring special measures. Earlier, it was off by default and had to be enabled via a boot time param. This patch reverses the default behaviour to improve coverage testing. It can be removed late in the kernel development cycle if its believed users shouldn't have to incur any cost if they don't want delay accounting. Or it can be retained forever if the utility of the stats is deemed common enough to warrant keeping the feature on. Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 4 changed files with 14 additions and 12 deletions Side-by-side Diff
Documentation/accounting/delay-accounting.txt
... | ... | @@ -64,11 +64,13 @@ |
64 | 64 | CONFIG_TASK_DELAY_ACCT=y |
65 | 65 | CONFIG_TASKSTATS=y |
66 | 66 | |
67 | -Enable the accounting at boot time by adding | |
68 | -the following to the kernel boot options | |
69 | - delayacct | |
67 | +Delay accounting is enabled by default at boot up. | |
68 | +To disable, add | |
69 | + nodelayacct | |
70 | +to the kernel boot options. The rest of the instructions | |
71 | +below assume this has not been done. | |
70 | 72 | |
71 | -and after the system has booted up, use a utility | |
73 | +After the system has booted up, use a utility | |
72 | 74 | similar to getdelays.c to access the delays |
73 | 75 | seen by a given task or a task group (tgid). |
74 | 76 | The utility also allows a given command to be |
Documentation/kernel-parameters.txt
... | ... | @@ -448,8 +448,6 @@ |
448 | 448 | Format: <area>[,<node>] |
449 | 449 | See also Documentation/networking/decnet.txt. |
450 | 450 | |
451 | - delayacct [KNL] Enable per-task delay accounting | |
452 | - | |
453 | 451 | dhash_entries= [KNL] |
454 | 452 | Set number of hash buckets for dentry cache. |
455 | 453 | |
... | ... | @@ -1030,6 +1028,8 @@ |
1030 | 1028 | on "Classic" PPC cores. |
1031 | 1029 | |
1032 | 1030 | nocache [ARM] |
1031 | + | |
1032 | + nodelayacct [KNL] Disable per-task delay accounting | |
1033 | 1033 | |
1034 | 1034 | nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects. |
1035 | 1035 |
include/linux/delayacct.h
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | { |
56 | 56 | /* reinitialize in case parent's non-null pointer was dup'ed*/ |
57 | 57 | tsk->delays = NULL; |
58 | - if (unlikely(delayacct_on)) | |
58 | + if (delayacct_on) | |
59 | 59 | __delayacct_tsk_init(tsk); |
60 | 60 | } |
61 | 61 | |
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | static inline int delayacct_add_tsk(struct taskstats *d, |
81 | 81 | struct task_struct *tsk) |
82 | 82 | { |
83 | - if (likely(!delayacct_on) || !tsk->delays) | |
83 | + if (!delayacct_on || !tsk->delays) | |
84 | 84 | return 0; |
85 | 85 | return __delayacct_add_tsk(d, tsk); |
86 | 86 | } |
kernel/delayacct.c
... | ... | @@ -19,15 +19,15 @@ |
19 | 19 | #include <linux/sysctl.h> |
20 | 20 | #include <linux/delayacct.h> |
21 | 21 | |
22 | -int delayacct_on __read_mostly; /* Delay accounting turned on/off */ | |
22 | +int delayacct_on __read_mostly = 1; /* Delay accounting turned on/off */ | |
23 | 23 | kmem_cache_t *delayacct_cache; |
24 | 24 | |
25 | -static int __init delayacct_setup_enable(char *str) | |
25 | +static int __init delayacct_setup_disable(char *str) | |
26 | 26 | { |
27 | - delayacct_on = 1; | |
27 | + delayacct_on = 0; | |
28 | 28 | return 1; |
29 | 29 | } |
30 | -__setup("delayacct", delayacct_setup_enable); | |
30 | +__setup("nodelayacct", delayacct_setup_disable); | |
31 | 31 | |
32 | 32 | void delayacct_init(void) |
33 | 33 | { |