Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Thu, 4 Jun 2009 03:51:00 +0000 (03:51 +0000)
committeryangsheng <yangsheng>
Thu, 4 Jun 2009 03:51:00 +0000 (03:51 +0000)
b=18399

i=adilger, johann

Using trylock to avoid deadlock.
Author: ZhangHongChao

lustre/kernel_patches/patches/prune-icache-use-trylock-rhel5.patch [new file with mode: 0644]
lustre/kernel_patches/patches/prune-icache-use-trylock-sles10.patch [new file with mode: 0644]
lustre/kernel_patches/series/2.6-rhel5.series
lustre/kernel_patches/series/2.6-sles10.series

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 (file)
index 0000000..beadec2
--- /dev/null
@@ -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 (file)
index 0000000..51924f6
--- /dev/null
@@ -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;
index f059ecd..227bcda 100644 (file)
@@ -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
index 182a3d0..cf1254c 100644 (file)
@@ -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