Re: [PATCH 2/2 net-next-2.6] net: QDISC_STATE_RUNNING dont need atomic bit ops

David Miller
2010-06-02T10:25:46Z

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 02 Jun 2010 11:50:33 +0200

> __QDISC_STATE_RUNNING is always changed while qdisc lock is held.
>
> We can avoid two atomic operations in xmit path, if we move this bit in
> a new __state container.
>
> Location of this __state container is carefully chosen so that fast path
> only dirties one qdisc cache line.
>
> THROTTLED bit could later be moved into this __state location too, to
> avoid dirtying first qdisc cache line.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Also looks good, applied.

One thing about naming. Here, even though we name the type and the
state member with two leading underscores, the things that actually
modify these state members are helper functions with names that lack
double underscores.

So really, reading the code, you don't see that special considerations
for these state changes might be necessary.