Re: [PATCH net-next] neigh: speedup neigh_resolve_output()

Eric Dumazet
2010-10-11T19:46:07Z

Le lundi 11 octobre 2010 à 12:16 -0700, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 07 Oct 2010 22:44:07 +0200
>
> > Le jeudi 07 octobre 2010 à 14:53 +0200, Eric Dumazet a écrit :
> >
> >> Further improvements would need to use a seqlock instead of an rwlock to
> >> protect neigh->ha[], to not dirty neigh too often and remove two atomic
> >> ops.
> >>
> >
> > I implemented this idea in following patch, on top on previous one.
> >
> > [PATCH net-next] neigh: speedup neigh_resolve_output()
>
> So Eric do you think this is more efficient than the idea I
> proposed, which is to "cmpxchg 'hh' and RCU"?
>
> If you think this seqlock thing is faster or more desirable
> for some reason, I'll add it.
>
> Thanks!

Hmm, we would need a neigh->ha pointer to some struct, with rcu
protection. It adds a dereference in hot path. I believe this seqlock
(only for pathological cases, where dst are used for few packets) should
be fine.

Note: After this patch, I have a "struct neighbour" small field reorg
pending, not yet submitted.

Thanks