bzero & bcopy alignment



Following recent discussion on alignment of bzero() and bcopy(), I've
added some statistics collecting code to bzero() and bcopy() for
practice (on a RELENG_6 box), and here are the cumulative results for
argument alignment:

128: 117190
64: 46495
32: 745178
16: 35313
8: 64580
4: 131045
2: 17969
1: 25099

This is somewhat early after bootup. First number is the alignment,
second argument is the number of calls that passed a pointer having the
alignment (e.g. there were 131045 instances of arguments which had data
aligned to 4 bytes in either bcopy or bzero). After some compiling
(start of a buildkernel), the data is:

128: 341440
64: 66812
32: 1020807
16: 75574
8: 192189
4: 266904
2: 44975
1: 36411

If the data is correct, most data seem to be aligned fairly ok.

Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • Re: bzero & bcopy alignment
    ... practice, and here are the cumulative results for ... turn an unaligned bcopy. ... First number is the alignment, ... aligned to 4 bytes in either bcopy or bzero). ...
    (freebsd-arch)
  • Re: bzero & bcopy alignment
    ... added some statistics collecting code to bzeroand bcopy() for ... practice, and here are the cumulative results for ... argument alignment: ... where in the source the unaligned functions are called, ...
    (freebsd-arch)
  • Re: bzero & bcopy alignment
    ... added some statistics collecting code to bzero() and bcopyfor ... practice, and here are the cumulative results for ... argument alignment: ... turn an unaligned bcopy. ...
    (freebsd-arch)
  • Re: bzero & bcopy alignment
    ... 2007/1/22, Luigi Rizzo: ... >>> Following recent discussion on alignment of bzero() and bcopy(), ... because these are constant strings, ...
    (freebsd-arch)
  • Re: bzero & bcopy alignment
    ... turn an unaligned bcopy. ... and the same for bzero, ... In the simplest form you could e.g. filter unaligned accesses ... because these are constant strings, ...
    (freebsd-arch)