Re: 2.5.38-mm2 [PATCH] (dcache)

Dipankar Sarma
2002-09-23T09:45:48Z

On Mon, Sep 23, 2002 at 04:22:28AM +0000, Andrew Morton wrote:
> url: http://www.zip.com.au/~akpm/linux/patches/2.5/2.5.38/2.5.38-mm2/
>
> read_barrier_depends.patch
> extended barrier primitives
>
> rcu_ltimer.patch
> RCU core
>
> dcache_rcu.patch
> Use RCU for dcache
>

Hi Andrew,

dcache_rcu orders writes using wmb() (list_del_rcu) while deleting from
the hash list and the d_lookup() hash list traversal requires an rmb() for
alpha. So, we need to use the read_barrier_depends() interface there.
This isn't a problem with any other archs AFAIK.

Thanks
--
Dipankar Sarma <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.

--- fs/dcache.c Mon Sep 23 11:47:26 2002
+++ /tmp/dcache.c Mon Sep 23 12:54:33 2002
@@ -870,7 +870,9 @@
rcu_read_lock();
tmp = head->next;
for (;;) {
- struct dentry * dentry = list_entry(tmp, struct dentry, d_hash);
+ struct dentry * dentry;
+ read_barrier_depends();
+ dentry = list_entry(tmp, struct dentry, d_hash);
if (tmp == head)
break;
tmp = tmp->next;