Skip to contentSkip to conversation

O_NONBLOCK for regular files

DISCUSSION Greg Banks 2 participants 6 messages Mar 20, 2004 – Apr 13, 2005

Subsystems (3)
lore
Share & tools
lore

Greg Banks

author
#0 lore raw
Quoted 5 lines · Jamie Lokier
Quoted 2 lines · Christoph Hellwig

It's used to [...] return EAGAIN to the nfs server so it doesn't block all nfsd threads on possible long-enduring HSM operations.

How does nfsd get notified when the operation is possible?

It doesn't; the nfsd sends an RPC reply containing the NFSERR_JUKEBOX error to the NFS client, which sleeps and retries the operation after a few seconds. If the operation is not yet possible the cycle repeats.

This is according to the RFC for NFSv3 and NFS clients (including Linux) know how to handle it. The point is to free the nfsd and corresponding client-side resources for other NFS traffic while HSM operation continues. Also, without this there's a pathological situation where the client keeps retrying, getting a new nfsd each time, until all the nfsds are blocked on the same file and all NFS traffic to the server stops.

Greg.

Signature · 2 lines
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.
author
#1 lore raw

G'day,

Quoted 10 lines · Greg Banks
Quoted 5 lines · Jamie Lokier
Quoted 2 lines · Christoph Hellwig

It's used to [...] return EAGAIN to the nfs server so it doesn't block all nfsd threads on possible long-enduring HSM operations.

How does nfsd get notified when the operation is possible?

It doesn't; the nfsd sends an RPC reply containing the NFSERR_JUKEBOX error to the NFS client, which sleeps and retries the operation after a few seconds. If the operation is not yet possible the cycle repeats.

http://marc.theaimsgroup.com/?l=linux-fsdevel&m=107959907311576&w=2

This thread was started by Christoph Hellwig 13 months ago to discuss the possibility of using O_NONBLOCK in nfsd to make the combination of NFS and Hierarchical Storage Managers play nicely together. The thread petered out with no firm conclusion but no major objections either.

There's now a patch to actually do it, see

http://marc.theaimsgroup.com/?l=linux-nfs&m=111087383132762&w=2

Does anyone want to give a firm yea or nea to this approach? I'd really like to get this patch moving in the pipeline.

Greg.

Signature · 14 lines
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#2 lore raw

on den 13.04.2005 Klokka 10:45 (+1000) skreiv Greg Banks:

Quoted 6 lines

There's now a patch to actually do it, see

http://marc.theaimsgroup.com/?l=linux-nfs&m=111087383132762&w=2

Does anyone want to give a firm yea or nea to this approach? I'd really like to get this patch moving in the pipeline.

Nay...

if (rqstp->rq_vers == 3)

is BAD!

We're already busy with rq_vers == 4 (which has the same issues). This sort of condition needs to be handled in a more version-independent manner.

Cheers,
Trond

Signature · 1 line
Trond Myklebust <[email protected]>
author
#3 lore raw
Quoted 11 lines · Trond Myklebust

on den 13.04.2005 Klokka 10:45 (+1000) skreiv Greg Banks:

Quoted 6 lines

There's now a patch to actually do it, see

http://marc.theaimsgroup.com/?l=linux-nfs&m=111087383132762&w=2

Does anyone want to give a firm yea or nea to this approach? I'd really like to get this patch moving in the pipeline.

Nay...

Quoted 7 lines

if (rqstp->rq_vers == 3)

is BAD!

We're already busy with rq_vers == 4 (which has the same issues). This sort of condition needs to be handled in a more version-independent manner.

Yes, Neil already made this point. I have a new version of the patch which does

if (rqstp->rq_vers >= 3)

which I'll resend if there are no other issues. I assume that'll be good enough.

Any other issues?

Greg.

Signature · 2 lines
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.
#4 lore raw

on den 13.04.2005 Klokka 16:03 (+1000) skreiv Greg Banks:

Quoted 3 lines

Any other issues?

Greg.

Well, I'm sa bit curious as to what "iap->ia_valid |= ATTR_NO_BLOCK" will do. AFAICS, there is nothing that actually tests for it.

Trond

Signature · 1 line
Trond Myklebust <[email protected]>
author
#5 lore raw
Quoted 8 lines · Trond Myklebust

on den 13.04.2005 Klokka 16:03 (+1000) skreiv Greg Banks:

Quoted 3 lines

Any other issues?

Greg.

Well, I'm sa bit curious as to what "iap->ia_valid |= ATTR_NO_BLOCK" will do. AFAICS, there is nothing that actually tests for it.

fs/xfs/linux-2.6/xfs_iops.c:linvfs_setattr() does

    535 #ifdef ATTR_NO_BLOCK
    536         if ((ia_valid & ATTR_NO_BLOCK))
    537                 flags |= ATTR_NONBLOCK;
    538 #endif

and later ATTR_NONBLOCK is used to change the behaviour of DMAPI callouts from XFS.

Greg.

Signature · 2 lines
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.