From: nikita Date: Sat, 28 Oct 2006 13:31:56 +0000 (+0000) Subject: procsleep patch: on statistics reset, allocate info if necessary. X-Git-Tag: v1_8_0_110~486^2~317 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=be9a3b58a18b2385256b0aeef81be562a08c0e94;p=fs%2Flustre-release.git procsleep patch: on statistics reset, allocate info if necessary. --- diff --git a/lustre/kernel_patches/patches/proc-sleep-2.6.9.patch b/lustre/kernel_patches/patches/proc-sleep-2.6.9.patch index a65c0f0..850184b 100644 --- a/lustre/kernel_patches/patches/proc-sleep-2.6.9.patch +++ b/lustre/kernel_patches/patches/proc-sleep-2.6.9.patch @@ -393,7 +393,7 @@ Index: linux/kernel/sleep_info.c =================================================================== --- linux.orig/kernel/sleep_info.c +++ linux/kernel/sleep_info.c -@@ -0,0 +1,424 @@ +@@ -0,0 +1,426 @@ +#include +#include +#include @@ -752,9 +752,11 @@ Index: linux/kernel/sleep_info.c + return ret; +} + -+static void reset_sleep_info(struct sleep_info *sinfo) ++static void reset_sleep_info(struct sleep_info *sinfo, int nr_traces) +{ + spin_lock(&sleep_serializer); ++ if (sinfo->p == NULL) ++ alloc_sleep_info(sinfo, nr_traces); + if (sinfo->p != NULL) + zero_sleep_info(sinfo->p); + spin_unlock(&sleep_serializer); @@ -765,7 +767,7 @@ Index: linux/kernel/sleep_info.c +{ + struct task_struct *tsk = PROC_I(file->f_dentry->d_inode)->task; + -+ reset_sleep_info(&tsk->sinfo); ++ reset_sleep_info(&tsk->sinfo, SLEEP_TRACES_DEF); + return count; +} + @@ -803,7 +805,7 @@ Index: linux/kernel/sleep_info.c +static ssize_t global_sleep_write(struct file *file, const char __user *buffer, + size_t count, loff_t *ppos) +{ -+ reset_sleep_info(&global_sinfo); ++ reset_sleep_info(&global_sinfo, GLOBAL_SLEEP_TRACES_DEF); + return count; +} +