Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2012 12:39:42 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        freebsd-current@FreeBSD.org
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>, Matt Jacob <mjacob@FreeBSD.org>
Subject:   Re: BUFSIZ = 1024, still ?
Message-ID:  <5033575E.1080000@FreeBSD.org>
In-Reply-To: <E9DDBE53-C188-4CFD-9B7E-6CCDB12CC874@samsco.org>
References:  <6882.1345325806@critter.freebsd.dk> <50300C6D.3030501@feral.com> <E9DDBE53-C188-4CFD-9B7E-6CCDB12CC874@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
on 21/08/2012 04:59 Scott Long said the following:
> This gets brought up from time to time, and I honestly thought that I swept
> most of the problems up a few years ago.  The mistake that I made in the mlx
> driver that was recently corrected was evidence of a previous sweep.
> 
> If anyone wants to do another sweep, the thing to grep for is any drivers
> that use MAXPHYS to size their i/o's.  For the drivers that do that, you then
> have to see if they can actually handle an arbitrary number of scatter-gather
> elements.  If they can't then they need to stop using MAXPHYS and start using
> a constant that applies to the driver.  My quick scan shows the following
> would need to be investigated:
> 
> sys/dev/ata (legacy ata) /sys/dev/isp /sys/dev/mmcsd /sys/dev/mvs
> 
> The only other problem is that struct but contains an element sized on
> MAXPHYS for doing swapper I/O.  Increasing MAXPHYS will increase this, and at
> one point I think that Alan Cox might have wanted to find a better way to
> hold swap info.  Otherwise, increasing MAXPHYS causes no problems and is
> something that has run in production for quite some time at places like Yahoo
> and Netflix.

I would like to use this opportunity to remind about another abuse in drivers:
MAXBSIZE.  This constant should be private to buffer cache / FS drivers layer,
but some drivers abuse it for things related to physical I/O (mostly [only?] as
bus_dma_tag_create parameter).

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5033575E.1080000>