Re: 2.5.70-bk16: nfs crash

Dipankar Sarma (dipankar@in.ibm.com)
Thu, 12 Jun 2003 21:23:45 +0530


On Thu, Jun 12, 2003 at 08:35:14AM -0700, Trond Myklebust wrote:
> >>>>> " " == Dipankar Sarma <dipankar@in.ibm.com> writes:
> > __d_drop() *must not* initialize d_hash fields. Lockfree lookup
> > depends on that. If __d_drop() needs to be allowed on an
> > unhashed dentry, the right thing to do would be to check for
> > DCACHE_UNHASHED before unhashing. I will submit a patch a
> > little later to do this.
>
> Can you please remind us exactly what the benefits of all this are?
> Why can't d_free() immediately free the memory instead of relying on
> the RCU mechanism?

Because we no longer hold the dcache_lock while doing a d_lookup().
With the dentry still around (RCU wouldn't happen until all CPUs
do a context switch or execute user-level code), lookup can continue
to traverse the hash list while another CPU deletes the currrent
dentry. Once RCU happens, it is guranteed that no other CPU
could be in that dentry during hash list traversal. That is why
we have _rcu versions of the list deletion macros.
Lockfree d_lookup() gives us significant benefits in larger
SMP machines.

Does my patch meet the requirements that you had for __d_drop() ?

Thanks
Dipankar
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/