lkml.org 
[lkml]   [2011]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 04/15] ftrace: pack event structures.
    From
    Date
    On Fri, 2010-12-03 at 16:13 -0800, David Sharp wrote:
    > Ftrace event structures have a 12-byte struct trace_entry at the beginning.
    > If the structure is aligned, this means that if the first field is 64-bits,
    > there will be 4 bytes of padding. Ironically, due to the 4-byte ringbuffer
    > header, this will make 64-bit writes unaligned, if the ring buffer position
    > is currently 64-bit aligned:
    > 4(rb)+12(ftrace)+4(pad) = 20; 20%8 = 4

    Actually the better answer is: It's time to nuke the lock_depth field.
    That was added temporarily in helping to remove the BKL, and now that
    it's pretty much gone, I say we need to nuke it. That will remove 4
    bytes from the 12 byte ftrace header giving us a 8 byte header. Much
    nicer :)

    I'll do that today. Thanks!

    -- Steve

    >
    > Adding __attribute__((packed)) to the event structures removes the extra
    > space from the trace events, and actually improves alignment of trace
    > events with a first field that is 64-bits.
    >
    > About 65 tracepoints have a 4-byte pad at offset 12:
    > # find events -name format | xargs -n1 awk '
    > $1=="name:" {name=$2}
    > $1=="format:"{FS="\t"}
    > $3=="offset:12;" && $4=="size:4;"{okay=1}
    > $3=="offset:16;" && !okay {print name}' | wc -l
    > 65
    >
    > With all 'syscalls' and 'timer' events enabled, this results in a 5%
    > improvement in a simple 512MB read benchmark with warm caches.




    \
     
     \ /
      Last update: 2011-03-09 14:05    [W:3.450 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site