2002-09-19 06:17:37

by Kedar Sovani

[permalink] [raw]
Subject: Isolation of nfs threads

Hey,
I am resending this message, can anyone please comment about the problem stated below.

How does nfs maintain the isolation between multiple
threads.That is when one nfs thread is running how does it avoid other
nfs threads from running. This is achieved in BSD using the splxxx()
functions. But in LINUX i do not see any similare function which handles
this.
Or more generally how does the LINUX kernel, lower and raise the
interrupt level it is currently working on? How does it apply to NFS ?

Waiting for reply,

rgds,
Kedar.



2002-09-20 00:05:33

by Rusty Russell

[permalink] [raw]
Subject: Re: Isolation of nfs threads

In message <[email protected]> you write:
> It is probably worth reading Rusty's unreliable guide to kernel
> locking. See the bottom of:
>
> http://www.netfilter.org/unreliable-guides/
>
> The html link seems to be broken... Rusty???

Hmm... I usually point people straight to the kernel sources (the
canonical guide is in Documentation/DocBook/)

But google to the rescue:

http://kernelnewbies.org/documents/kdoc/kernel-locking/lklockingguide.html

Cheers!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.


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

2002-09-19 11:32:42

by NeilBrown

[permalink] [raw]
Subject: Re: Isolation of nfs threads

On Thursday September 19, [email protected] wrote:
> Hey,
> I am resending this message, can anyone please comment about the problem stated below.
>
> How does nfs maintain the isolation between multiple
> threads.That is when one nfs thread is running how does it avoid other
> nfs threads from running. This is achieved in BSD using the splxxx()
> functions. But in LINUX i do not see any similare function which handles
> this.
> Or more generally how does the LINUX kernel, lower and raise the
> interrupt level it is currently working on? How does it apply to NFS ?

spinlocks mostly, and semaphores.

look for "lock_kernel" and "unlock_kernel" which is a specialised sort
of lock that is released when the process "schedules", and gives
another process a turn at the cpu, and is then automatically claimed
again when the process gets another turn.

The nfsd code in 2.4 mostly depends on the this lock.

The network and rpc bits use spinlock (spin_lock, spin_unlock).

The nfsd code in 2.5 uses a semaphore (up/down) and some spinlocks to
avoid needing lock_kernel (also known as the Big Kernel Lock).

It is probably worth reading Rusty's unreliable guide to kernel
locking. See the bottom of:

http://www.netfilter.org/unreliable-guides/

The html link seems to be broken... Rusty???

NeilBrown


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

2002-09-19 14:36:15

by Kashif Shaikh

[permalink] [raw]
Subject: Re: Isolation of nfs threads

On Thu, 2002-09-19 at 07:32, Neil Brown wrote:

>
> http://www.netfilter.org/unreliable-guides/
>
> The html link seems to be broken... Rusty???
For now here is the link until Rusty fixes it:

http://www.netfilter.org/unreliable-guides/kernel-locking/kernel-locking.docbook/lklockingguide.html

Kashif Shaikh

>
> NeilBrown
>
>
> -------------------------------------------------------
> 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




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