netdev
[Top] [All Lists]

Re: [BK PATCHES] 2.6.x net driver fixes

To: Jeff Garzik <jgarzik@xxxxxxxxx>
Subject: Re: [BK PATCHES] 2.6.x net driver fixes
From: Linus Torvalds <torvalds@xxxxxxxx>
Date: Wed, 14 Jul 2004 14:28:11 -0700 (PDT)
Cc: Andrew Morton <akpm@xxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <40F58EFD.7080904@xxxxxxxxx>
References: <20040714192706.GA24447@xxxxxxxxxxxxx> <Pine.LNX.4.58.0407141229480.20824@xxxxxxxxxxxxxxx> <40F58EFD.7080904@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx

On Wed, 14 Jul 2004, Jeff Garzik wrote:
> > 
> > The weaker ordering constraint is called "read_barrier_depends()", and
> > should be a no-op on all but alpha. Would you want to use that to fix the
> > alpha case too?
> 
> What would the proper fix be?
> 
>       rmb();
>       read_barrier_depends();

No, just a

        index = *indexpointer;
        read_barrier_depends();
        data = dataptr[index];

which on most architectures is a no-op, but in case the hardware might do
data or address speculation, and needs a dependent load barrier, it will
do the right thing.

For stuff that isn't data dependent, you have to use the full rmb(), which 
obviously isn't a no-op on most setups.

                Linus

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [BK PATCHES] 2.6.x net driver fixes, Linus Torvalds <=