From: Stephen Hemminger <stephen@networkplumber.org>
To: "Zhou, YidingX" <yidingx.zhou@intel.com>
Cc: Ferruh Yigit <ferruh.yigit@xilinx.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Zhang, Qi Z" <qi.z.zhang@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [PATCH] net/pcap: reduce time for stopping device
Date: Wed, 31 Aug 2022 09:42:19 -0700 [thread overview]
Message-ID: <20220831094219.74f5aa6c@hermes.local> (raw)
In-Reply-To: <DM5PR1101MB2107A250EC67513C52E95D5885769@DM5PR1101MB2107.namprd11.prod.outlook.com>
On Mon, 29 Aug 2022 11:50:29 +0000
"Zhou, YidingX" <yidingx.zhou@intel.com> wrote:
> I draw a diagram to describe it more clearly
>
> fwrite fclose/fflush fclose/fdatasync
> --------->| libc buffer |----------------> | disk cache in RAM |---------------------> |disk|
> | 4096 Bytes | | size is determined by OS | | |
>
> When the libc buffer is full, the system will automatically sync it to the disk cache.
> It is easily full as it's only 4096 B size. so there is no need to call 'fflush()' every time.
> The real time consuming action is syncing the disk cache to disk.
> Because the disk cache is very large, it will take a long time to sync all at one time during 'fclose()',
> so need to call 'fdatasync()' periodically to amortize the time.
If you want to speed up this, then get rid of stdio and use a faster
API like io_uring. What you tried can help but using a better API
would make bigger gains.
next prev parent reply other threads:[~2022-08-31 16:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 7:20 Yiding Zhou
2022-08-25 10:09 ` Ferruh Yigit
2022-08-25 11:17 ` Zhou, YidingX
2022-08-25 12:21 ` Ferruh Yigit
2022-08-29 11:50 ` Zhou, YidingX
2022-08-31 16:42 ` Stephen Hemminger [this message]
2022-09-01 7:40 ` Zhou, YidingX
2022-09-06 8:05 ` [PATCH v2] net/pcap: fix timeout of " Yiding Zhou
2022-09-06 14:57 ` Stephen Hemminger
2022-09-06 16:21 ` Zhou, YidingX
2022-09-21 7:14 ` Zhou, YidingX
2022-10-03 15:00 ` Ferruh Yigit
2022-11-22 9:25 ` Zhou, YidingX
2022-11-22 17:28 ` Stephen Hemminger
2022-12-02 10:22 ` Zhou, YidingX
2022-11-29 14:11 ` Ferruh Yigit
2022-12-02 10:13 ` Zhou, YidingX
2022-12-02 11:19 ` Ferruh Yigit
2022-12-05 1:58 ` Zhou, YidingX
-- strict thread matches above, loose matches on Subject: below --
2022-08-25 6:27 [PATCH] net/pcap: reduce time for " Yiding Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220831094219.74f5aa6c@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@xilinx.com \
--cc=qi.z.zhang@intel.com \
--cc=stable@dpdk.org \
--cc=yidingx.zhou@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).