Index: linux-2.6-git/include/linux/sysctl.h =================================================================== --- linux-2.6-git.orig/include/linux/sysctl.h 2010-02-05 16:48:08.000000000 +0100 +++ linux-2.6-git/include/linux/sysctl.h 2010-02-05 16:48:50.000000000 +0100 @@ -68,6 +68,7 @@ CTL_BUS=8, /* Busses */ CTL_ABI=9, /* Binary emulation */ CTL_CPU=10, /* CPU stuff (speed scaling, etc) */ + CTL_PERF=11, /* Performance counters and timer sums for debugging */ CTL_ARLAN=254, /* arlan wireless driver */ CTL_S390DBF=5677, /* s390 debug */ CTL_SUNRPC=7249, /* sunrpc debug */ Index: linux-2.6-git/kernel/sysctl.c =================================================================== --- linux-2.6-git.orig/kernel/sysctl.c 2010-02-05 16:48:08.000000000 +0100 +++ linux-2.6-git/kernel/sysctl.c 2010-02-05 16:48:27.000000000 +0100 @@ -183,6 +183,7 @@ .default_set.list = LIST_HEAD_INIT(root_table_header.ctl_entry), }; +static struct ctl_table perf_table[]; static struct ctl_table kern_table[]; static struct ctl_table vm_table[]; static struct ctl_table fs_table[]; @@ -236,6 +237,13 @@ .mode = 0555, .child = dev_table, }, + { + .ctl_name = CTL_PERF, + .procname = "perf", + .mode = 0555, + .child = perf_table, + }, + /* * NOTE: do not add new entries to this table unless you have read * Documentation/sysctl/ctl_unnumbered.txt @@ -250,6 +258,19 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ #endif +extern unsigned long perf_count_congestion_wait; +static struct ctl_table perf_table[] = { + { + .ctl_name = CTL_UNNUMBERED, + .procname = "perf_count_congestion_wait", + .data = &perf_count_congestion_wait, + .mode = 0666, + .maxlen = sizeof(unsigned long), + .proc_handler = &proc_doulongvec_minmax, + }, + { .ctl_name = 0 } +}; + static struct ctl_table kern_table[] = { { .ctl_name = CTL_UNNUMBERED, Index: linux-2.6-git/mm/backing-dev.c =================================================================== --- linux-2.6-git.orig/mm/backing-dev.c 2010-02-05 16:48:08.000000000 +0100 +++ linux-2.6-git/mm/backing-dev.c 2010-02-05 16:48:27.000000000 +0100 @@ -739,6 +739,7 @@ } EXPORT_SYMBOL(set_bdi_congested); +unsigned long perf_count_congestion_wait = 0; /** * congestion_wait - wait for a backing_dev to become uncongested * @sync: SYNC or ASYNC IO @@ -754,6 +755,7 @@ DEFINE_WAIT(wait); wait_queue_head_t *wqh = &congestion_wqh[sync]; + perf_count_congestion_wait++; prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE); ret = io_schedule_timeout(timeout); finish_wait(wqh, &wait);