Skip to content

Commit 163ecdf

Browse files
Shailabh NagarLinus Torvalds
authored andcommitted
[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>
1 parent d94a041 commit 163ecdf

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎Documentation/accounting/delay-accounting.txt‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ Compile the kernel with
6464
CONFIG_TASK_DELAY_ACCT=y
6565
CONFIG_TASKSTATS=y
6666

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.
7072

71-
and after the system has booted up, use a utility
73+
After the system has booted up, use a utility
7274
similar to getdelays.c to access the delays
7375
seen by a given task or a task group (tgid).
7476
The utility also allows a given command to be

‎Documentation/kernel-parameters.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,6 @@ running once the system is up.
448448
Format: <area>[,<node>]
449449
See also Documentation/networking/decnet.txt.
450450

451-
delayacct [KNL] Enable per-task delay accounting
452-
453451
dhash_entries= [KNL]
454452
Set number of hash buckets for dentry cache.
455453

@@ -1031,6 +1029,8 @@ running once the system is up.
10311029

10321030
nocache [ARM]
10331031

1032+
nodelayacct [KNL] Disable per-task delay accounting
1033+
10341034
nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects.
10351035

10361036
noexec [IA-64]

‎include/linux/delayacct.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static inline void delayacct_tsk_init(struct task_struct *tsk)
5555
{
5656
/* reinitialize in case parent's non-null pointer was dup'ed*/
5757
tsk->delays = NULL;
58-
if (unlikely(delayacct_on))
58+
if (delayacct_on)
5959
__delayacct_tsk_init(tsk);
6060
}
6161

@@ -80,7 +80,7 @@ static inline void delayacct_blkio_end(void)
8080
static inline int delayacct_add_tsk(struct taskstats *d,
8181
struct task_struct *tsk)
8282
{
83-
if (likely(!delayacct_on) || !tsk->delays)
83+
if (!delayacct_on || !tsk->delays)
8484
return 0;
8585
return __delayacct_add_tsk(d, tsk);
8686
}

‎kernel/delayacct.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
#include <linux/sysctl.h>
2020
#include <linux/delayacct.h>
2121

22-
int delayacct_on __read_mostly; /* Delay accounting turned on/off */
22+
int delayacct_on __read_mostly = 1; /* Delay accounting turned on/off */
2323
kmem_cache_t *delayacct_cache;
2424

25-
static int __init delayacct_setup_enable(char *str)
25+
static int __init delayacct_setup_disable(char *str)
2626
{
27-
delayacct_on = 1;
27+
delayacct_on = 0;
2828
return 1;
2929
}
30-
__setup("delayacct", delayacct_setup_enable);
30+
__setup("nodelayacct", delayacct_setup_disable);
3131

3232
void delayacct_init(void)
3333
{

0 commit comments

Comments
 (0)