Skip to contentSkip to conversation

question on sk_sem within svc_sendto

DISCUSSION Wendy Cheng 2 participants 4 messages Apr 30, 2003 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

We're in the middle of fine-tuning our linux-based file server and currently examining the NFS zero-copy path with 2.5.x kernel. There is a semaphore (sk_sem) within svc_sendto() that serializes the outgoing data. Could someone shed some light and give us an explanation why this semaphore is needed - just for education purpose.Great thanks...

Wendy

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Wendy Cheng <[email protected]> writes:

> We're in the middle of fine-tuning our linux-based file server > and currently examining the NFS zero-copy path with 2.5.x > kernel. There is a semaphore (sk_sem) within svc_sendto() that > serializes the outgoing data. Could someone shed some light and > give us an explanation why this semaphore is needed - just for > education purpose.Great thanks...

You need to send one datagram at a time down each socket otherwise the client might receive data which is partially from one request, partially from another.

Cheers,
Trond

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#3 lore raw

This makes sense (for me) in TCP case but how about UDP ? Does the 2.5.x kernel send multiple NFS UDP packets within one reply (for one single request) ?

Wendy

----- Original Message -----
From: "Trond Myklebust" <[email protected]>
To: "Wendy Cheng" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, April 30, 2003 11:30 AM
Subject: Re: [NFS] question on sk_sem within svc_sendto

| >>>>> " " == Wendy Cheng <[email protected]> writes:
| 
|      > We're in the middle of fine-tuning our linux-based file server
|      > and currently examining the NFS zero-copy path with 2.5.x
|      > kernel. There is a semaphore (sk_sem) within svc_sendto() that
|      > serializes the outgoing data. Could someone shed some light and
|      > give us an explanation why this semaphore is needed - just for
|      > education purpose.Great thanks...
| 
| You need to send one datagram at a time down each socket otherwise the
| client might receive data which is partially from one request,
| partially from another.
| 
| Cheers,
|   Trond
| 

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Wendy Cheng <[email protected]> writes:

> This makes sense (for me) in TCP case but how about UDP ? Does > the 2.5.x kernel send multiple NFS UDP packets within one reply > (for one single request) ?

When using MSG_MORE in order to aggregate the data, you need to ensure that only your thread is accessing that socket. If not, another nfsd thread may corrupt your request by injecting its payload.

So yes, in 2.5.x the semaphore is also needed for UDP.

Cheers,
Trond

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs