DragonFly-18.104.22.1688.gd7215 master sys/dev/netif/emx if_emx.h
sepherosa at gmail.com
Tue Apr 28 20:35:53 PDT 2009
On Wed, Apr 29, 2009 at 9:42 AM, Matthew Dillon
<dillon at 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?
> :Best Regards,
> 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 will not pollute rx_data's
cache in CPU1.
Live Free or Die
More information about the Commits