2003-04-30 15:00:35

by Wendy Cheng

[permalink] [raw]
Subject: question on sk_sem within svc_sendto

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


2003-04-30 15:30:30

by Trond Myklebust

[permalink] [raw]
Subject: Re: 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

2003-04-30 15:53:21

by Wendy Cheng

[permalink] [raw]
Subject: Re: question on sk_sem within svc_sendto

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

2003-04-30 18:02:50

by Trond Myklebust

[permalink] [raw]
Subject: Re: question on sk_sem within svc_sendto

>>>>> " " == 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