linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Writing on raw device with software RAID 0 is slow
@ 2001-02-28 14:58 Martin Rauh
  2001-03-01 12:14 ` Stephen C. Tweedie
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Rauh @ 2001-02-28 14:58 UTC (permalink / raw)
  To: linux-kernel

Hello,

Writing to an software RAID 0 containing 4 SCSI discs is very fast.
I get transfer rates of about 100 MBytes/s. The filesystem on the RAID
is ext2.

Writing to the same RAID directly (that means on the raw device without
a filesystem) works
but gives low transfer rates of about 31 MBytes/s.

Any explanation for that?

thanks and greetings,

Martin Rauh




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

* Re: Writing on raw device with software RAID 0 is slow
  2001-02-28 14:58 Writing on raw device with software RAID 0 is slow Martin Rauh
@ 2001-03-01 12:14 ` Stephen C. Tweedie
  2001-03-01 15:44   ` Ben LaHaise
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen C. Tweedie @ 2001-03-01 12:14 UTC (permalink / raw)
  To: Martin Rauh; +Cc: linux-kernel, Stephen Tweedie

Hi,

On Wed, Feb 28, 2001 at 03:58:11PM +0100, Martin Rauh wrote:
> 
> Writing to an software RAID 0 containing 4 SCSI discs is very fast.
> I get transfer rates of about 100 MBytes/s. The filesystem on the RAID
> is ext2.
> 
> Writing to the same RAID directly (that means on the raw device without
> a filesystem) works
> but gives low transfer rates of about 31 MBytes/s.
> 
> Any explanation for that?

Raw IO is always synchronous: it gets flushed to disk before the write
returns.  You don't get any write-behind with raw IO, so the smaller
the blocksize you write in, the slower things get.

--Stephen

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

* Re: Writing on raw device with software RAID 0 is slow
  2001-03-01 12:14 ` Stephen C. Tweedie
@ 2001-03-01 15:44   ` Ben LaHaise
  2001-03-01 16:02     ` Stephen C. Tweedie
  0 siblings, 1 reply; 7+ messages in thread
From: Ben LaHaise @ 2001-03-01 15:44 UTC (permalink / raw)
  To: Stephen C. Tweedie; +Cc: Martin Rauh, linux-kernel

Hello all,

On Thu, 1 Mar 2001, Stephen C. Tweedie wrote:

> Raw IO is always synchronous: it gets flushed to disk before the write
> returns.  You don't get any write-behind with raw IO, so the smaller
> the blocksize you write in, the slower things get.

More importantly, the mainstream raw io code only writes in 64KB chunks
that are unpipelined, which can lead to writes not hitting the drive
before the sector passes under the rw head.  You can work around this to
some extent by issuing multiple writes (via threads, or the aio work I've
done) at the expense of atomicity.  Also, before we allow locking of
arbitrary larger ios in main memory, we need bean counting to prevent the
obvious DoSes.

		-ben


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

* Re: Writing on raw device with software RAID 0 is slow
  2001-03-01 15:44   ` Ben LaHaise
@ 2001-03-01 16:02     ` Stephen C. Tweedie
  2001-03-01 16:08       ` Ben LaHaise
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen C. Tweedie @ 2001-03-01 16:02 UTC (permalink / raw)
  To: Ben LaHaise; +Cc: Stephen C. Tweedie, Martin Rauh, linux-kernel

Hi,

On Thu, Mar 01, 2001 at 10:44:38AM -0500, Ben LaHaise wrote:
> 
> On Thu, 1 Mar 2001, Stephen C. Tweedie wrote:
> 
> > Raw IO is always synchronous: it gets flushed to disk before the write
> > returns.  You don't get any write-behind with raw IO, so the smaller
> > the blocksize you write in, the slower things get.
> 
> More importantly, the mainstream raw io code only writes in 64KB chunks
> that are unpipelined, which can lead to writes not hitting the drive
> before the sector passes under the rw head.  You can work around this to
> some extent by issuing multiple writes (via threads, or the aio work I've
> done) at the expense of atomicity.  Also, before we allow locking of
> arbitrary larger ios in main memory, we need bean counting to prevent the
> obvious DoSes.

Yep.  There shouldn't be any problem increasing the 64KB size, it's
only the lack of accounting for the pinned memory which stopped me
increasing it by default.

--Stephen

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

* Re: Writing on raw device with software RAID 0 is slow
  2001-03-01 16:02     ` Stephen C. Tweedie
@ 2001-03-01 16:08       ` Ben LaHaise
  2001-03-01 16:29         ` Stephen C. Tweedie
  0 siblings, 1 reply; 7+ messages in thread
From: Ben LaHaise @ 2001-03-01 16:08 UTC (permalink / raw)
  To: Stephen C. Tweedie; +Cc: Martin Rauh, linux-kernel

On Thu, 1 Mar 2001, Stephen C. Tweedie wrote:

> Yep.  There shouldn't be any problem increasing the 64KB size, it's
> only the lack of accounting for the pinned memory which stopped me
> increasing it by default.

Actually, how about making it a sysctl?  That's probably the most
reasonable approach for now since the optimal size depends on hardware.

		-ben


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

* Re: Writing on raw device with software RAID 0 is slow
  2001-03-01 16:08       ` Ben LaHaise
@ 2001-03-01 16:29         ` Stephen C. Tweedie
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen C. Tweedie @ 2001-03-01 16:29 UTC (permalink / raw)
  To: Ben LaHaise; +Cc: Stephen C. Tweedie, Martin Rauh, linux-kernel

Hi,

On Thu, Mar 01, 2001 at 11:08:13AM -0500, Ben LaHaise wrote:
> On Thu, 1 Mar 2001, Stephen C. Tweedie wrote:
> 
> Actually, how about making it a sysctl?  That's probably the most
> reasonable approach for now since the optimal size depends on hardware.

Fine with me.

--Stephen

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

* Re: Writing on raw device with software RAID 0 is slow
@ 2001-03-01 16:47 Douglas Gilbert
  0 siblings, 0 replies; 7+ messages in thread
From: Douglas Gilbert @ 2001-03-01 16:47 UTC (permalink / raw)
  To: linux-kernel

 
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Ben LaHaise wrote:
> On Thu, 1 Mar 2001, Stephen C. Tweedie wrote:
> 
> > Yep.  There shouldn't be any problem increasing the 64KB size, it's
> > only the lack of accounting for the pinned memory which stopped me
> > increasing it by default.
> 
> Actually, how about making it a sysctl?  That's probably the most
> reasonable approach for now since the optimal size depends on hardware.

Something else may slow down raw IO. A buffer
that looks contiguous in the user space typically looks
quite splintered from the kernel's perspective. This
means that a buffer of 64 KB in the user space ends
up being a scatter gather list of 16 elements (assuming
PAGE_SIZE of 4KB) en route to the IDE or SCSI subsystem.

Now one SCSI adapter that I have examined must push each
scatter gather element through its firmware to the DMA 
engine which can only hold one element at a time. 
That takes time.

Doug Gilbert

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

end of thread, other threads:[~2001-03-01 16:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-28 14:58 Writing on raw device with software RAID 0 is slow Martin Rauh
2001-03-01 12:14 ` Stephen C. Tweedie
2001-03-01 15:44   ` Ben LaHaise
2001-03-01 16:02     ` Stephen C. Tweedie
2001-03-01 16:08       ` Ben LaHaise
2001-03-01 16:29         ` Stephen C. Tweedie
2001-03-01 16:47 Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).