Project

General

Profile

Actions

Feature #15107

closed

kcephfs: be less pessimistic about rcu walk in d_revalidate

Added by Sage Weil about 8 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:

Description

Al says:

BTW, looks like ceph is too pessimistic
about bailing out of RCU mode on ->d_revalidate(), might be worth looking
into at some point...

static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
{
    int valid = 0;
    struct inode *dir;

    if (flags & LOOKUP_RCU)
        return -ECHILD;

dating from 34286d666 (2.6.38).
Actions #1

Updated by Jeff Layton almost 8 years ago

  • Assignee set to Jeff Layton
Actions #2

Updated by Jeff Layton almost 8 years ago

Yeah, looks quite doable to handle some of these cases in RCU-walk mode. The main limitation is that you can't sleep there, so we'd need to reorganize dentry_lease_is_valid is a little to ensure that we don't try to send a lease renewal while in that mode, or maybe queue the lease renewal to a workqueue or something.

Actions #3

Updated by Jeff Layton almost 8 years ago

First patches are now in the testing branch. I think it's probably also possible to queue the lease renewal to a workqueue as well:

Basically what we'd need to do is add a list_head to the fsclient and a new spinlock. When we want to queue up a lease renewal, we'd add the the ceph_dentry_info to the list and queue up the workqueue job. When it runs, it scrapes all of the entries off the list and sends the lease renewals for them.

The main problem is sorting out the refcounting, but I think having per-sb work instead of per-dentry work will take care of the potential deadlock I saw.

Actions #4

Updated by Zheng Yan about 7 years ago

  • Status changed from New to Resolved

by commits:
5b484a513149f53613d376a9d1cd0391de099fb4
14fb9c9efe3570459b6bddd76a990140917237ad
f49d1e058d23a5fabeb1499be739af8b3db52164

Actions

Also available in: Atom PDF