On Tue, 5 Apr 2005, David S. Miller wrote:
> > I fail to see what the point of having a single instance of
> > atomic_dec_and_test for __refcnt is. In particular since the upper layers
> > guarantee that dst_destroy is not called multiple times for the same dst
> > entry.
>
> If this is true, what performance improvement could you possibly be
> seeing from this change?
We could make refcnt into an array of pointers that point to node specific
memory. This avoids cache line bouncing. However, you cannot atomically
dec_and_test an array. This is the only location where a dec_and_test is
used on dst->__refcnt.
> I know you are making this change for performance reasons, yet you
> aren't mentioning any details about this. That information is
> part of what we need to know to judge this change.
I figured that it is not worth posting the patch if there is a reason
for the dec_and_test here. I was sure if my assessment of the role
of this atomic_dec_and_test here is correct.
> I've very hesistant to undo atomic operation memory barriers, after
> all of the weird problems we had in the neighbour cache.
We can put an explicit barier in if that is the only reason for the
atomic_dec_and_test.
|