Delay in WRITE delegation recall during COMMIT

Ajay Gulati gulati at cs.rice.edu
Fri Aug 18 13:09:53 EDT 2006


Hi Bruce,
You are right, the linux kernel doesn't give out write delegations. I 
had been playing with write delegations and had 
modified the code in __setlease() to make it work. I thought I had removed 
that patch for my current testing but when you mentioned it, I went back 
and checked again just to find that it was compiled in by mistake. Here is 
the change in __setlease() (fs/locks.c) that caused write delegation to 
be granted.

if ((arg == F_WRLCK)
 	    && ((atomic_read(&dentry->d_count) > 2)
 		|| (atomic_read(&inode->i_count) > 2)))
 		goto out;

I am sorry for this confusion. Either its not an issue anymore or I am 
not sure if this might re-appear once write delegation is enabled because 
breaklease is called during nfsd_commit().

Both client and server are linux 2.6.17-rc6 with CITI patch from the 
website. The server gives out write delegation with just the modification 
mentioned in __setlease(). 
The delay situation exists even without conflicting open. This 
should recreate the delay:

f1 = open(file1, RDONLY)
close(f1)
f2 = open(file2, RDWR) 		// here write delegation is given 
write(75KB)
close(f2)

this close takes 90 seconds because of this 
loop between COMMIT and Deleg recall. If the writes are less than 64KB, 
then no COMMIT is sent and everything works fine. 
breaklease is called as part of nfsd_open() call from nfsd_commit().

Thanks
-Ajay

On Thu, 17 Aug 2006, J. Bruce Fields wrote:

> On Thu, Aug 17, 2006 at 03:38:22PM -0500, Ajay Gulati wrote:
>> Hi All,
>> I am testing write delegations on nfsv4 and it seems that there is some
>> sort of loop between COMMIT and DELEGRETURN, that causes commit to take 90
>> seconds on closing of a file.
>> The scenario to duplicate is as follows:
>>
>> f1 = open(file1, RDONLY)
>> close(f1)
>> f2 = open(file2, RDWR)	// you will get write delegation
>> write(f2, 75KB data)
>> f3= open(file2,RDWR)
>> close(f2)
>> close(f3)
>
> What's the server?  The linux server currently never gives out write
> delegations at all.
>
> --b.
>


More information about the NFSv4 mailing list