public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* question on SMP and read()/write()
@ 2000-10-28 14:31 Oliver Neukum
  2000-10-28 16:19 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Neukum @ 2000-10-28 14:31 UTC (permalink / raw)
  To: linux-kernel

Hi,

I've noticed that sys_read() and sys_write() don't grab the big kernel lock.
As file descriptors may be shared, must device drivers provide SMP safe
read() and write() methods ?

	TIA
		Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question on SMP and read()/write()
       [not found] <Pine.LNX.4.10.10010281042130.8717-100000@coffee.psychology.mcmaster.ca>
@ 2000-10-28 15:42 ` Oliver Neukum
  0 siblings, 0 replies; 3+ messages in thread
From: Oliver Neukum @ 2000-10-28 15:42 UTC (permalink / raw)
  To: Mark Hahn; +Cc: linux-kernel

On Saturday 28 October 2000 16:43, you wrote:
> > I've noticed that sys_read() and sys_write() don't grab the big kernel
> > lock. As file descriptors may be shared, must device drivers provide SMP
> > safe read() and write() methods ?
>
> no.  FD's refer to files; block drivers don't, and the nontrivial
> code between sys_* and drivers deals with this sort of thing.

Sure block drivers need not do this, but how about drivers for character 
devices ? It seems that sys_read() calls a function provided by the
f_op table without any locking. Isn't this the function a driver for a 
character device must provide to the VFS ?

	TIA
		Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question on SMP and read()/write()
  2000-10-28 14:31 question on SMP and read()/write() Oliver Neukum
@ 2000-10-28 16:19 ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2000-10-28 16:19 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: linux-kernel

> I've noticed that sys_read() and sys_write() don't grab the big kernel lock.
> As file descriptors may be shared, must device drivers provide SMP safe
> read() and write() methods ?

Yes. This is true in 2.2 as well although the inode lock provides some protection
on writes.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-10-28 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-10-28 14:31 question on SMP and read()/write() Oliver Neukum
2000-10-28 16:19 ` Alan Cox
     [not found] <Pine.LNX.4.10.10010281042130.8717-100000@coffee.psychology.mcmaster.ca>
2000-10-28 15:42 ` Oliver Neukum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox