Skip to contentSkip to conversation

Isolation of nfs threads

DISCUSSION Kedar Sovani 4 participants 4 messages Sep 19, 2002 – Sep 20, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 10 lines · 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

#2 lore raw
Quoted 4 lines · Neil Brown

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

Quoted 11 lines

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

#3 lore raw
In reply to Neil Brown

In message <[email protected]> you write:

Quoted 6 lines

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