Re: [viro-vfs:work.dcache2] [__dentry_kill()] 1b738f196e: stress-ng.sysinfo.ops_per_sec -27.2% regression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 30, 2023 at 12:54:01PM +0800, kernel test robot wrote:

> The kernel config and materials to reproduce are available at:
> https://download.01.org/0day-ci/archive/20231130/202311300906.1f989fa8-oliver.sang@xxxxxxxxx
> 
> =========================================================================================
> class/compiler/cpufreq_governor/disk/fs/kconfig/nr_threads/rootfs/tbox_group/test/testcase/testtime:
>   os/gcc-12/performance/1HDD/ext4/x86_64-rhel-8.3/10%/debian-11.1-x86_64-20220510.cgz/lkp-icl-2sp7/sysinfo/stress-ng/60s
> 
> commit: 
>   e3640d37d0 ("d_prune_aliases(): use a shrink list")
>   1b738f196e ("__dentry_kill(): new locking scheme")

Very interesting...  Out of curiosity, what effect would the following
have on top of 1b738f196e?

diff --git a/fs/dcache.c b/fs/dcache.c
index b212a65ed190..d4a95e690771 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1053,16 +1053,14 @@ void d_prune_aliases(struct inode *inode)
 }
 EXPORT_SYMBOL(d_prune_aliases);
 
-static inline void shrink_kill(struct dentry *victim)
+static inline void shrink_kill(struct dentry *victim, struct list_head *list)
 {
-	do {
-		rcu_read_unlock();
-		victim = __dentry_kill(victim);
-		rcu_read_lock();
-	} while (victim && lock_for_kill(victim));
 	rcu_read_unlock();
-	if (victim)
+	victim = __dentry_kill(victim);
+	if (victim) {
+		to_shrink_list(victim, list);
 		spin_unlock(&victim->d_lock);
+	}
 }
 
 void shrink_dentry_list(struct list_head *list)
@@ -1084,7 +1082,7 @@ void shrink_dentry_list(struct list_head *list)
 			continue;
 		}
 		d_shrink_del(dentry);
-		shrink_kill(dentry);
+		shrink_kill(dentry, list);
 	}
 }
 
@@ -1514,7 +1512,7 @@ void shrink_dcache_parent(struct dentry *parent)
 				spin_unlock(&data.victim->d_lock);
 				rcu_read_unlock();
 			} else {
-				shrink_kill(data.victim);
+				shrink_kill(data.victim, &data.dispose);
 			}
 		}
 		if (!list_empty(&data.dispose))




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux