Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Sep 2011 20:17:04 GMT
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/160994: buf_ring(9): MD assumption in MI code
Message-ID:  <201109242017.p8OKH4Bc086659@red.freebsd.org>
Resent-Message-ID: <201109242020.p8OKKBOv064234@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109242017.p8OKH4Bc086659>