kern/160994: buf_ring(9): MD assumption in MI code

Arnaud Lacombe lacombar at gmail.com
Sat Sep 24 20:20:12 UTC 2011


>Number:         160994
>Category:       kern
>Synopsis:       buf_ring(9): MD assumption in MI code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 24 20:20:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Arnaud Lacombe
>Release:        
>Organization:
n/a
>Environment:
>Description:
`struct buf_ring', defined in `sys/sys/buf_ring.h' as:

struct buf_ring {
       volatile uint32_t       br_prod_head;
       volatile uint32_t       br_prod_tail;
       int                     br_prod_size;
       int                     br_prod_mask;
       uint64_t                br_drops;
       uint64_t                br_prod_bufs;
       uint64_t                br_prod_bytes;
       /*
        * Pad out to next L2 cache line
        */
       uint64_t                _pad0[11];

       volatile uint32_t       br_cons_head;
       volatile uint32_t       br_cons_tail;
       int                     br_cons_size;
       int                     br_cons_mask;

       /*
        * Pad out to next L2 cache line
        */
       uint64_t                _pad1[14];
#ifdef DEBUG_BUFRING
       struct mtx              *br_lock;
#endif
       void                    *br_ring[0];
};

is making an MD guess, the amount of padding to fit the size of a cache line, in MI API. It should be replaced by gcc's __aligned(CACHE_LINE_SIZE) as it is currently wasting space on architecture with 64bytes-long cache line.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list