[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9d4eebb99d53224366c387ae314173b870d134c.camel@mediatek.com>
Date: Fri, 9 Dec 2022 10:26:09 +0000
From: Yanchao Yang (杨彦超)
<Yanchao.Yang@...iatek.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"ryazanov.s.a@...il.com" <ryazanov.s.a@...il.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"loic.poulain@...aro.org" <loic.poulain@...aro.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"johannes@...solutions.net" <johannes@...solutions.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>
CC: Chris Feng (冯保林)
<Chris.Feng@...iatek.com>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Mingliang Xu (徐明亮)
<mingliang.xu@...iatek.com>,
"linuxwwan@...iatek.com" <linuxwwan@...iatek.com>,
Min Dong (董敏) <min.dong@...iatek.com>,
"m.chetan.kumar@...el.com" <m.chetan.kumar@...el.com>,
"linuxwwan@...el.com" <linuxwwan@...el.com>,
Liang Lu (吕亮) <liang.lu@...iatek.com>,
Haijun Liu (刘海军)
<haijun.liu@...iatek.com>,
Haozhe Chang (常浩哲)
<Haozhe.Chang@...iatek.com>,
Hua Yang (杨华) <Hua.Yang@...iatek.com>,
Xiayu Zhang (张夏宇)
<Xiayu.Zhang@...iatek.com>,
Aiden Wang (王咏麒)
<Aiden.Wang@...iatek.com>,
Felix Chen (陈非) <Felix.Chen@...iatek.com>,
Ting Wang (王挺) <ting.wang@...iatek.com>,
Guohao Zhang (张国豪)
<Guohao.Zhang@...iatek.com>,
Mingchuang Qiao (乔明闯)
<Mingchuang.Qiao@...iatek.com>,
Lambert Wang (王伟)
<Lambert.Wang@...iatek.com>
Subject: Re: [PATCH net-next v1 02/13] net: wwan: tmi: Add buffer management
Hello Sergey,
On Sun, 2022-12-04 at 22:58 +0400, Sergey Ryazanov wrote:
> On 22.11.2022 15:11, Yanchao Yang wrote:
> > From: MediaTek Corporation <linuxwwan@...iatek.com>
> >
> > To malloc I/O memory as soon as possible, buffer management comes
> > into being.
> > It creates buffer pools that reserve some buffers through deferred
> > works when
> > the driver isn't busy.
> >
> > The buffer management provides unified memory allocation/de-
> > allocation
> > interfaces for other modules. It supports two buffer types of SKB
> > and page.
> > Two reload work queues with different priority values are provided
> > to meet
> > various requirements of the control plane and the data plane.
> >
> > When the reserved buffer count of the pool is less than a threshold
> > (default
> > is 2/3 of the pool size), the reload work will restart to allocate
> > buffers
> > from the OS until the buffer pool becomes full. When the buffer
> > pool fills,
> > the OS will recycle the buffer freed by the user.
> >
> > Signed-off-by: Mingliang Xu <mingliang.xu@...iatek.com>
> > Signed-off-by: MediaTek Corporation <linuxwwan@...iatek.com>
> > ---
> > drivers/net/wwan/mediatek/Makefile | 3 +-
> > drivers/net/wwan/mediatek/mtk_bm.c | 369
> > ++++++++++++++++++++++++++++
> > drivers/net/wwan/mediatek/mtk_bm.h | 79 ++++++
> > drivers/net/wwan/mediatek/mtk_dev.c | 11 +-
> > drivers/net/wwan/mediatek/mtk_dev.h | 1 +
> > 5 files changed, 461 insertions(+), 2 deletions(-)
> > create mode 100644 drivers/net/wwan/mediatek/mtk_bm.c
> > create mode 100644 drivers/net/wwan/mediatek/mtk_bm.h
>
> Yanchao, can you share some numbers, how this custom pool is
> outperform
> the regular kernel allocator?
Prepare 2 drivers *.ko for comparison.
Driver A (following named A): enable pre-allocate buffer pool.
Driver B (following named A): disenable pre-allocate buffer pool. It
uses kernel API directly (__dev_alloc_skb and netdev_alloc_frag)
Test Instrument: Keysight UXM TA
Iperf command:
Server Command: iperf3 -s -p 5002 -i 1
Client Command: iperf3 -c 192.168.2.1 -p 5002 -i 1 -w 8M -t 30 -R -P 5
Test result: Fig 1. A’s TCP DL throughput Fig 2. B’s TCP DL throughput
(Ref attachment)
From the results, it represents that the A’s IP packets throughput
reaches 7Gbits/sec, while B’s throughput is 4.7Gbits/sec. A’s
throughput is up about 50% compared with B.
In addition, from ftrace, it represents following results.
A: it takes 14.241828s for allocating 33211099 buffers. The average
time is about 0.4us.
B: it takes 7.677069s for allocating 10890789 buffers. The average time
is about 0.7us.
>
> --
> Sergey
many thanks.
Yanchao.Yang
Download attachment "fig1.jpg" of type "image/jpeg" (35073 bytes)
Download attachment "fig2.jpg" of type "image/jpeg" (36156 bytes)
Powered by blists - more mailing lists