2002-10-07 22:20:57

by Juan Gomez

[permalink] [raw]
Subject: kernelNFS(lockd) problem and patch suggestion





Hi all,

I noticed that after starting a linux NFS server, the first lock request
gets delayed about 30 seconds even after waiting the 45 seconds
corresponding to the grace period.
At first I thought this was due to the fact that being the first time a
lock is acquired through the server lockd/statd interaction was required
and the creation of a new file was involved
(i.e. statd/sm/client_IP) but still 30 seconds was way too long...

After taking a look at the code I realized that the lockd thread sets grace
period and then goes to sleep for a long time waiting for messages and the
first message always gets processed
before checking if the grace period has completed (which it might after
sleeping for a long time).

I think this can be easily fixed by clearing the grace period after waiting
for messages and before procesing them for correct operation as described
in the following patch.

I will appreciate if this patch can be considered for inclusion in the
general distribution of the kernel.

(See attached file: lockd_delay_patch.2.4.19)


Juan


Attachments:
lockd_delay_patch.2.4.19 (1.37 kB)

2002-10-07 23:46:09

by Trond Myklebust

[permalink] [raw]
Subject: Re: kernelNFS(lockd) problem and patch suggestion

>>>>> " " == Juan Gomez <[email protected]> writes:

> After taking a look at the code I realized that the lockd
> thread sets grace period and then goes to sleep for a long time
> waiting for messages and the first message always gets
> processed before checking if the grace period has completed

Please could you rediff using the '-u' option and drop the MIME
attachment thingy (See Documentation/SubmittingPatches).

Patch otherwise looks quite correct, so once the patch format is OK
then, by all means send it off to Marcelo and (if you could bang up
the same patch for 2.5.x) to Linus too.

Cheers,
Trond

2002-10-07 23:54:35

by Juan Gomez

[permalink] [raw]
Subject: Re: kernelNFS(lockd) problem and patch suggestion






OK I will do so...hopefully "Marcelo" is reading these postings as I do not
have his direct email.

Regards, Juan



|---------+---------------------------->
| | Trond Myklebust |
| | <trond.myklebust@|
| | fys.uio.no> |
| | |
| | 10/07/02 04:51 PM|
| | |
|---------+---------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
| |
| To: Juan Gomez/Almaden/IBM@IBMUS |
| cc: [email protected] |
| Subject: Re: kernelNFS(lockd) problem and patch suggestion |
| |
| |
>------------------------------------------------------------------------------------------------------------------------------|



>>>>> " " == Juan Gomez <[email protected]> writes:

> After taking a look at the code I realized that the lockd
> thread sets grace period and then goes to sleep for a long time
> waiting for messages and the first message always gets
> processed before checking if the grace period has completed

Please could you rediff using the '-u' option and drop the MIME
attachment thingy (See Documentation/SubmittingPatches).

Patch otherwise looks quite correct, so once the patch format is OK
then, by all means send it off to Marcelo and (if you could bang up
the same patch for 2.5.x) to Linus too.

Cheers,
Trond