diff options
author | Shailabh Nagar <nagar@watson.ibm.com> | 2006-07-30 06:03:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-31 16:28:37 -0400 |
commit | 163ecdff060f2fa9e8f5238882fd0137493556a6 (patch) | |
tree | 955aa8397edf1ddc64a2429bc2986331c286e47c | |
parent | d94a041519f3ab1ac023bf917619cd8c4a7d3c01 (diff) |
[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>
-rw-r--r-- | Documentation/accounting/delay-accounting.txt | 10 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 4 | ||||
-rw-r--r-- | include/linux/delayacct.h | 4 | ||||
-rw-r--r-- | kernel/delayacct.c | 8 |
4 files changed, 14 insertions, 12 deletions
diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.txt index be215e58423b..1443cd71d263 100644 --- a/Documentation/accounting/delay-accounting.txt +++ b/Documentation/accounting/delay-accounting.txt | |||
@@ -64,11 +64,13 @@ Compile the kernel with | |||
64 | CONFIG_TASK_DELAY_ACCT=y | 64 | CONFIG_TASK_DELAY_ACCT=y |
65 | CONFIG_TASKSTATS=y | 65 | CONFIG_TASKSTATS=y |
66 | 66 | ||
67 | Enable the accounting at boot time by adding | 67 | Delay accounting is enabled by default at boot up. |
68 | the following to the kernel boot options | 68 | To disable, add |
69 | delayacct | 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 | similar to getdelays.c to access the delays | 74 | similar to getdelays.c to access the delays |
73 | seen by a given task or a task group (tgid). | 75 | seen by a given task or a task group (tgid). |
74 | The utility also allows a given command to be | 76 | The utility also allows a given command to be |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index e11f7728ec6f..b50595a0550f 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -448,8 +448,6 @@ running once the system is up. | |||
448 | Format: <area>[,<node>] | 448 | Format: <area>[,<node>] |
449 | See also Documentation/networking/decnet.txt. | 449 | See also Documentation/networking/decnet.txt. |
450 | 450 | ||
451 | delayacct [KNL] Enable per-task delay accounting | ||
452 | |||
453 | dhash_entries= [KNL] | 451 | dhash_entries= [KNL] |
454 | Set number of hash buckets for dentry cache. | 452 | Set number of hash buckets for dentry cache. |
455 | 453 | ||
@@ -1031,6 +1029,8 @@ running once the system is up. | |||
1031 | 1029 | ||
1032 | nocache [ARM] | 1030 | nocache [ARM] |
1033 | 1031 | ||
1032 | nodelayacct [KNL] Disable per-task delay accounting | ||
1033 | |||
1034 | nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects. | 1034 | nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects. |
1035 | 1035 | ||
1036 | noexec [IA-64] | 1036 | noexec [IA-64] |
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 8a284cc6fd5f..11487b6e7127 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h | |||
@@ -55,7 +55,7 @@ static inline void delayacct_tsk_init(struct task_struct *tsk) | |||
55 | { | 55 | { |
56 | /* reinitialize in case parent's non-null pointer was dup'ed*/ | 56 | /* reinitialize in case parent's non-null pointer was dup'ed*/ |
57 | tsk->delays = NULL; | 57 | tsk->delays = NULL; |
58 | if (unlikely(delayacct_on)) | 58 | if (delayacct_on) |
59 | __delayacct_tsk_init(tsk); | 59 | __delayacct_tsk_init(tsk); |
60 | } | 60 | } |
61 | 61 | ||
@@ -80,7 +80,7 @@ static inline void delayacct_blkio_end(void) | |||
80 | static inline int delayacct_add_tsk(struct taskstats *d, | 80 | static inline int delayacct_add_tsk(struct taskstats *d, |
81 | struct task_struct *tsk) | 81 | struct task_struct *tsk) |
82 | { | 82 | { |
83 | if (likely(!delayacct_on) || !tsk->delays) | 83 | if (!delayacct_on || !tsk->delays) |
84 | return 0; | 84 | return 0; |
85 | return __delayacct_add_tsk(d, tsk); | 85 | return __delayacct_add_tsk(d, tsk); |
86 | } | 86 | } |
diff --git a/kernel/delayacct.c b/kernel/delayacct.c index f05392d64267..57ca3730205d 100644 --- a/kernel/delayacct.c +++ b/kernel/delayacct.c | |||
@@ -19,15 +19,15 @@ | |||
19 | #include <linux/sysctl.h> | 19 | #include <linux/sysctl.h> |
20 | #include <linux/delayacct.h> | 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 | kmem_cache_t *delayacct_cache; | 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 | return 1; | 28 | return 1; |
29 | } | 29 | } |
30 | __setup("delayacct", delayacct_setup_enable); | 30 | __setup("nodelayacct", delayacct_setup_disable); |
31 | 31 | ||
32 | void delayacct_init(void) | 32 | void delayacct_init(void) |
33 | { | 33 | { |