Commit Graph

3 Commits

Author SHA1 Message Date
Petr Oros 3f94ccb304 ynl: samples: fix recycling rate calculation
JIRA: https://issues.redhat.com/browse/RHEL-57755

Upstream commit(s):
commit 900b2801bf250affe410193a0d27a2ba9f2db4e5
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Thu Mar 7 14:11:22 2024 -0800

    ynl: samples: fix recycling rate calculation

    Running the page-pool sample on production machines under moderate
    networking load shows recycling rate higher than 100%:

    $ page-pool
        eth0[2]     page pools: 14 (zombies: 0)
                    refs: 89088 bytes: 364904448 (refs: 0 bytes: 0)
                    recycling: 100.3% (alloc: 1392:2290247724 recycle: 469289484:1828235386)

    Note that outstanding refs (89088) == slow alloc * cache size (1392 * 64)
    which means this machine is recycling page pool pages perfectly, not
    a single page has been released.

    The extra 0.3% is because sample ignores allocations from the ptr_ring.
    Treat those the same as alloc_fast, the ring vs cache alloc is
    already captured accurately enough by recycling stats.

    With the fix:

    $ page-pool
        eth0[2]     page pools: 14 (zombies: 0)
                    refs: 89088 bytes: 364904448 (refs: 0 bytes: 0)
                    recycling: 100.0% (alloc: 1392:2331141604 recycle: 473625579:1857460661)

    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-11-20 10:13:45 +01:00
Petr Oros b90d906624 tools: ynl: fix build of the page-pool sample
JIRA: https://issues.redhat.com/browse/RHEL-31941

Upstream commit(s):
commit ee1eb9de81dbdbf078df659062e4df256a009627
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Wed Nov 29 11:36:19 2023 -0800

    tools: ynl: fix build of the page-pool sample

    The name of the "destroyed" field in the reply was not changed
    in the sample after we started calling it "detach_time".

    page-pool.c: In function ‘main’:
    page-pool.c:84:33: error: ‘struct <anonymous>’ has no member named ‘destroyed’
       84 |                 if (pp->_present.destroyed)
          |                                 ^

    Fixes: 637567e4a3ef ("tools: ynl: add sample for getting page-pool information")
    Link: https://lore.kernel.org/r/20231129193622.2912353-2-kuba@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-05-16 19:27:56 +02:00
Petr Oros e158d3a07f tools: ynl: add sample for getting page-pool information
JIRA: https://issues.redhat.com/browse/RHEL-31941

Upstream commit(s):
commit 637567e4a3ef6f6a5ffa48781207d270265f7e68
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Sun Nov 26 15:07:40 2023 -0800

    tools: ynl: add sample for getting page-pool information

    Regenerate the tools/ code after netdev spec changes.

    Add sample to query page-pool info in a concise fashion:

    $ ./page-pool
        eth0[2]     page pools: 10 (zombies: 0)
                    refs: 41984 bytes: 171966464 (refs: 0 bytes: 0)
                    recycling: 90.3% (alloc: 656:397681 recycle: 89652:270201)

    Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Signed-off-by: Petr Oros <poros@redhat.com>
2024-05-16 19:27:56 +02:00