From ebd6ea06c9de56c234fd005a9bfb338ea2f30373 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Thu, 4 Jun 2009 03:51:00 +0000 Subject: [PATCH] Branch HEAD b=18399 i=adilger, johann Using trylock to avoid deadlock. Author: ZhangHongChao --- .../patches/prune-icache-use-trylock-rhel5.patch | 13 +++++++++++++ .../patches/prune-icache-use-trylock-sles10.patch | 13 +++++++++++++ lustre/kernel_patches/series/2.6-rhel5.series | 1 + lustre/kernel_patches/series/2.6-sles10.series | 1 + 4 files changed, 28 insertions(+) create mode 100644 lustre/kernel_patches/patches/prune-icache-use-trylock-rhel5.patch create mode 100644 lustre/kernel_patches/patches/prune-icache-use-trylock-sles10.patch diff --git a/lustre/kernel_patches/patches/prune-icache-use-trylock-rhel5.patch b/lustre/kernel_patches/patches/prune-icache-use-trylock-rhel5.patch new file mode 100644 index 0000000..beadec2 --- /dev/null +++ b/lustre/kernel_patches/patches/prune-icache-use-trylock-rhel5.patch @@ -0,0 +1,13 @@ +--- linux/fs/inode.c.orig 2009-01-24 03:28:57.000000000 +0800 ++++ linux/fs/inode.c 2009-01-24 03:30:18.000000000 +0800 +@@ -418,7 +418,9 @@ static void prune_icache(int nr_to_scan) + int nr_scanned; + unsigned long reap = 0; + +- mutex_lock(&iprune_mutex); ++ if (!mutex_trylock(&iprune_mutex)) ++ return; ++ + spin_lock(&inode_lock); + for (nr_scanned = 0; nr_scanned < nr_to_scan; nr_scanned++) { + struct inode *inode; diff --git a/lustre/kernel_patches/patches/prune-icache-use-trylock-sles10.patch b/lustre/kernel_patches/patches/prune-icache-use-trylock-sles10.patch new file mode 100644 index 0000000..51924f6 --- /dev/null +++ b/lustre/kernel_patches/patches/prune-icache-use-trylock-sles10.patch @@ -0,0 +1,13 @@ +--- linux/fs/inode.c.orig 2009-01-24 03:28:57.000000000 +0800 ++++ linux/fs/inode.c 2009-01-24 03:30:18.000000000 +0800 +@@ -418,7 +418,9 @@ static void prune_icache(int nr_to_scan) + int nr_scanned; + unsigned long reap = 0; + +- down(&iprune_sem); ++ if (down_trylock(&iprune_sem)) ++ return; ++ + spin_lock(&inode_lock); + for (nr_scanned = 0; nr_scanned < nr_to_scan; nr_scanned++) { + struct inode *inode; diff --git a/lustre/kernel_patches/series/2.6-rhel5.series b/lustre/kernel_patches/series/2.6-rhel5.series index f059ecd..227bcda 100644 --- a/lustre/kernel_patches/series/2.6-rhel5.series +++ b/lustre/kernel_patches/series/2.6-rhel5.series @@ -23,3 +23,4 @@ raid5-mmp-unplug-dev.patch small-fixes-about-jbd.patch jbd-slab-race-2.6-rhel5.patch mpt-fusion-max-sge.patch +prune-icache-use-trylock-rhel5.patch diff --git a/lustre/kernel_patches/series/2.6-sles10.series b/lustre/kernel_patches/series/2.6-sles10.series index 182a3d0..cf1254c 100644 --- a/lustre/kernel_patches/series/2.6-sles10.series +++ b/lustre/kernel_patches/series/2.6-sles10.series @@ -15,3 +15,4 @@ proc-sleep-2.6.16-sles10.patch export-nr_free_buffer_pages.patch quota-large-limits-sles10.patch raid5-mmp-unplug-dev-sles10.patch +prune-icache-use-trylock-sles10.patch -- 1.8.3.1