Index: linux-2.6-git-2.6.31-bisect2/include/linux/sysctl.h =================================================================== --- linux-2.6-git-2.6.31-bisect2.orig/include/linux/sysctl.h +++ linux-2.6-git-2.6.31-bisect2/include/linux/sysctl.h @@ -69,6 +69,7 @@ enum 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-2.6.31-bisect2/kernel/sysctl.c =================================================================== --- linux-2.6-git-2.6.31-bisect2.orig/kernel/sysctl.c +++ linux-2.6-git-2.6.31-bisect2/kernel/sysctl.c @@ -177,6 +177,7 @@ static struct ctl_table_root sysctl_tabl .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[]; @@ -230,6 +231,13 @@ static struct ctl_table root_table[] = { .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 @@ -244,6 +252,19 @@ static int min_wakeup_granularity_ns; 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[] = { #ifdef CONFIG_SCHED_DEBUG { Index: linux-2.6-git-2.6.31-bisect2/mm/backing-dev.c =================================================================== --- linux-2.6-git-2.6.31-bisect2.orig/mm/backing-dev.c +++ linux-2.6-git-2.6.31-bisect2/mm/backing-dev.c @@ -305,6 +305,7 @@ void set_bdi_congested(struct backing_de } 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 @@ -320,6 +321,7 @@ long congestion_wait(int sync, long time 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);