OSDN Git Service

net: sched: when clearing NOLOCK, clear TCQ_F_CPUSTATS, too
authorPaolo Abeni <pabeni@redhat.com>
Wed, 10 Apr 2019 12:32:40 +0000 (14:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Apr 2019 19:20:46 +0000 (12:20 -0700)
commit8a53e616de294873fec1a75ddb77ecb3d225cee0
tree417d298678e0f2bba183375d0754ff2f8ccbe19e
parent9c01c9f1f2a3ddbddbf3b233cc6bfa86f5a59af0
net: sched: when clearing NOLOCK, clear TCQ_F_CPUSTATS, too

Since stats updating is always consistent with TCQ_F_CPUSTATS flag,
we can disable it at qdisc creation time flipping such bit.

In my experiments, if the NOLOCK flag is cleared, per CPU stats
accounting does not give any measurable performance gain, but it
waste some memory.

Let's clear TCQ_F_CPUSTATS together with NOLOCK, when enslaving
a NOLOCK qdisc to 'lock' one.

Use stats update helper inside pfifo_fast, to cope correctly with
TCQ_F_CPUSTATS flag change.

As a side effect, q.qlen value for any child qdiscs is always
consistent for all lock classfull qdiscs.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sch_generic.h
net/sched/sch_api.c
net/sched/sch_generic.c