DragonFly commits List (threaded) for 2009-04
DragonFly BSD
DragonFly commits List (threaded) for 2009-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: DragonFly-2.3.0.828.gd7215 master sys/dev/netif/emx if_emx.h


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Wed, 29 Apr 2009 13:39:39 +0200

Sepherosa Ziehau wrote:
On Wed, Apr 29, 2009 at 9:42 AM, Matthew Dillon
<dillon@apollo.backplane.com> wrote:
:Yeah.  However, could you tell me the major reason you want to put
:__cachealign in struct field?  I guess you worried about emx_rxdata
:being used outside of emx_softc?
   It's more obvious that the array needs to be cache-aligned if it is
   in the softc structure.  Also, it's more C-like.  Putting storage
   attributes on structural definitions is not very C-like.  The storage
   attributes should be on declarations instead.

Mmm, setting __cachealign on struct field (i.e. in emx_softc) does not achieve what I want here: I want the struct's size to be (N * cacheline_size) in addition to be cacheline_size aligned. So in ifpoll, CPU0's writing to rx_data[0] will not pollute rx_data[1]'s cache in CPU1.

Right. Every array element needs to be cache aligned, not only the array by itself.


cheers
 simon



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]