From nobody@FreeBSD.org  Sat Sep 24 20:17:04 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B84C9106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Sep 2011 20:17:04 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id A872B8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Sep 2011 20:17:04 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p8OKH4k3086660
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Sep 2011 20:17:04 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p8OKH4Bc086659;
	Sat, 24 Sep 2011 20:17:04 GMT
	(envelope-from nobody)
Message-Id: <201109242017.p8OKH4Bc086659@red.freebsd.org>
Date: Sat, 24 Sep 2011 20:17:04 GMT
From: Arnaud Lacombe <lacombar@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: buf_ring(9): MD assumption in MI code
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>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:  Wed Oct 05 05:48:19 UTC 2011
>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:
