maximum MAXBSIZE

Gary Jennejohn gljennjohn at gmail.com
Fri Jan 10 08:32:51 UTC 2020


On Thu, 9 Jan 2020 14:14:09 -0700
Warner Losh <imp at bsdimp.com> wrote:

> On Thu, Jan 9, 2020 at 1:55 PM Peter Jeremy <peter at rulingia.com> wrote:
> 
> > On 2020-Jan-09 16:45:19 +0100, Gary Jennejohn <gljennjohn at gmail.com>
> > wrote:  
> > >On Thu, 9 Jan 2020 15:21:25 +0100 (CET)
> > >Wojciech Puchar <wojtek at puchar.net> wrote:  
> > >> why FreeBSD default is so completely wrong for modern hardware?
> > >>
> > >> i think 4MB is OK for HDDs, more may be optimal for RAID5 arrays.  
> > >
> > >POLA (principle of least amazement).  I certainly don't need a MAXPHYS set
> > >to 4MB on my desktop machine.  
> >
> > What are the downsides of running with MAXPHYS set to 4MB (or similar)?
> >  
> 
> There's two issues. One, it makes every buf and bio 32 times larger.
> Second, there's a lot of drivers that say their max I/O size is MAXPHYS
> when really they mean max(128k,MAXPHYS). Newer hardware is better about it,
> but not perfect (I had to fix a NVMe bug because the format of SG lists we
> used is limited to 4k which means our NVMe driver can't do more than 1MB
> I/Os). DFLTPHYS also needs to be raised. There are (or were) some drivers
> in the tree that bogusly used DFLTPHYS as the maximum I/O, though I think I
> caught all of those. And once you bump MAXPHYS, there's other limits you'll
> run into with fast SSDs/NVMe drives (like runningbufs limiting write
> throughput).
> 

[I reduced the Cc: list]

Not just storage drivers use MAXPHYS.  All of the attempts at porting
the rtsx SD controller driver from OpenBSD use MAXPHYS.  That's due to
the OpenBSD code using it; but MAXPHYS on OpenBSD is only 64KiB.  It
would definitely be a POLA violation if MAXPHYS were suddenly set to
e.g. 1MiB.  Assuming we ever get the DMA to work.

-- 
Gary Jennejohn


More information about the freebsd-hackers mailing list