Port-amd64 archive

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

amd64: 2MB alignments



I would like to add 2MB alignments between each section of the kernel on amd64.
It will uniformize the performance on each region and make the mappings more
consistent.

Currently we map rodata and data with superpages only on the fly - eg if data
is in [3.1MB;7.6MB[, we only map [4MB;6MB[ with superpages, and keep the rest
with normal pages. The issue is that there are some parts of the segments that
are less optimized than others.

We cannot apply magic tricks like packing rarely-used structures at the end
of the segments since, as the previous example points out, even the beginning
may not be optimized.

Also, there may be a noticeable performance fluctuation: each change in the
kernel potentially offsets all of its sections, and it is possible that adding
a static array causes critical routines to be pushed outside of a large page
and to be mapped with normal pages, thereby reducing performance while it
theoretically should not.

In NetBSD-current there are currently 784 normal pages that belong to the
kernel image. Applying [1] brings this number down to zero. The drawback of
this change is that we lose some memory in the padding, but to me this is
reasonable enough on amd64.

I remember there was some fuss last time I talked about that, so let's fight
now.

Maxime

[1] http://m00nbsd.net/garbage/large/alignlarge.diff

(note: the max-page-size change is necessary, because of a missing feature in
the bootloader; I'm cooking another patch for that too)


Home | Main Index | Thread Index | Old Index