From owner-freebsd-bugs@FreeBSD.ORG Sat Sep 24 20:20:12 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17940106568C for ; Sat, 24 Sep 2011 20:20:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CF3B38FC2C for ; Sat, 24 Sep 2011 20:20:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p8OKKBP1064242 for ; Sat, 24 Sep 2011 20:20:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p8OKKBOv064234; Sat, 24 Sep 2011 20:20:11 GMT (envelope-from gnats) Resent-Date: Sat, 24 Sep 2011 20:20:11 GMT Resent-Message-Id: <201109242020.p8OKKBOv064234@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Arnaud Lacombe Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B84C9106566C for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/160994: buf_ring(9): MD assumption in MI code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2011 20:20:12 -0000 >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: