tech-kern archive

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

Re: pool: removing ioff?



Le 16/03/2019 à 18:00, Greg Troxel a écrit :
Maxime Villard <max%m00nbsd.net@localhost> writes:

I would like to remove the 'ioff' argument from pool_init() and friends,
documented as 'align_offset' in the man page. This parameter allows the
caller to specify that the alignment given in 'align' is to be applied at
the offset 'ioff' within the buffer.

I think we're better-off with hard-aligned structures, ie with __aligned(32)
in the case of XSCALE. Then we just pass align=32 in the pool, and that's it.

I would prefer to avoid any confusion in the pool initializers and drop ioff,
rather than having this kind of marginal and not-well-defined features that
add complexity with no real good reason.

Note also that, as far as I can tell, our policy in the kernel has always
been to hard-align the structures, and then pass the same alignment in the
allocators.

I am not objecting as I can't make a performance/complexity argument.

But, I wonder if this comes from the Solaris allocation design, and that
the ioff notion is not about alignment for 4/8 objects to fit the way
the CPU wants, but for say 128 byte objects to be lined up on various
different offsets in different pages to make caching work better.  But
perhaps that doesn't exist in NetBSD, or is done differently, or my
memory of the paper is off.

Indeed, Sun's SLAB had cache coloring.

We do too in our pool subsystem, that's not related to ioff, we don't
lose it as a result of removing ioff.


Home | Main Index | Thread Index | Old Index