[PATCH] Support for large number of md(4) disks

Wojciech A. Koszek dunstan at zsno.ids.czest.pl
Sun Jan 22 09:34:22 PST 2006

On Wed, Jan 18, 2006 at 09:25:01PM -0800, Maxim Sobolev wrote:
> Wojciech A. Koszek wrote:
> >On Mon, Jan 16, 2006 at 01:56:29PM -0800, Maxim Sobolev wrote:
> >>Hi,
> >
> >Hi Maxim,
> >
> >>IMHO there is better approach to fetch unknown amount of data from the 
> >>kernel using ioctl(2) facility. The main idea is that you allocate some 
> >>buffer of size sufficient in 95% of cases (for md(4) I think 8-16 
> >>entries are enough), attach it to some structure which has size of the 
> >>buffer as one of its members and send pointer to that structure as an 
> >>argument to ioctl(2).
> Yes, there is a difference. I don't like your approach when you are 
> trying to win the race fixed amount of times (5) and then just bailing 
> out, asymptotic approach is better IMHO. Especially considering that 
> memory is cheap nowadays and you won't have any problems with allocating 
> space for many thousand configuration entries, even in the case when you 
> are really going to use only few of them.
> Regarding you assumption that meeting the situation when total number of 
> devices changes quickly I don't quite agree. A simple script can make 
> number of md(4) devices going up/down by few hundred per second easily, 
> your approach will behave erratically in such case.

I got some feedback from people who use md(4) in such cases. Looking at
bugs@ gives me a feel there is also a real need for mdconfig -l working

...this is why updated patch is here:


It starts with 16 entries in the user-space.
* Wojciech Koszek && <dunstan%zsno.ids.czest.pl>

More information about the freebsd-current mailing list