Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: [tls-maxphys] src/sys/dev

On Wed, Oct 10, 2012 at 08:17:05AM -0400, Thor Lancelot Simon wrote:
> On Wed, Oct 10, 2012 at 11:34:48AM +0200, Manuel Bouyer wrote:
> > 
> > I'm not sure what the best way to handle this would be.
> > If we assume that maxphys is a power of 2, we could use a maxphys-derived
> > mask here. Otherwise, maybe we should compute and cache the largest 
> > power-of-2
> > value below maxphys in v_mount, as is done in vfs_vnops.c:vn_ra_allocctx()
> > (actually, this would remove ra_iochunk as we could use the mount point's
> > value)
> I originally did that.  There were some negative performance consequences.
> With two of the SCSI (RAID, actually) controllers I have on hand, the DMA
> descriptor format effectively imposes a restriction of 192K on transfer
> size.  But these are exactly the sort of devices that really like to see
> large writes.  The next lower power of two is 128k...
> I think a lot of the clever math with shifts and masks should perhaps go
> away.  Any efficiency improvements it yields are, I think, swamped by the
> 5,000 function calls we make to do a single I/O.

I suspect UVM wants to do batch of read or writes in power of 2 size,
aligned on power of 2 boundaries. Or this is my feeling after playing
with the readahead code, and I wouldn't be surprised if the write
code had the same requirement.

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference

Home | Main Index | Thread Index | Old Index