From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D97AA034C for ; Wed, 31 Aug 2022 18:42:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 317D14114B; Wed, 31 Aug 2022 18:42:23 +0200 (CEST) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id D3FB140395 for ; Wed, 31 Aug 2022 18:42:21 +0200 (CEST) Received: by mail-pj1-f43.google.com with SMTP id q3so11427087pjg.3 for ; Wed, 31 Aug 2022 09:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc; bh=YoMmWa637ibUWbH9QM7mc6K7OlHcVKEqfT1zvY+VRe4=; b=0GJo+l4TsUfI6Wcs8H5KJU9NliGtswf8/F/dPsNeQqw901ClqIgH/uQbac7UvWCrd1 qyEJEuezp+hdAR/NMk2NqVnlwNYp9dkIDyrt7JKlosbZLoVpWtIArag6CNW8wr/5gZhD seAdOIQhaU9ZfvhQOqoO/efmguzJWcwgQP3+PiL39Lqd0/kT6ukt61z1H94UtdxdCx/F pxEwYeIp0RYsr8ccCJfDuC5NwM4gJ8Ea3aDA7BmlKs11cLlbAO2XCjUsphKqGZHmR44h 2mO6/J2olLnPdPRP0/RjltHIb/X8OIdFH2DE1m0oTFaEjO9VXETY8zwb6SukZMgn4xHO Q5Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=YoMmWa637ibUWbH9QM7mc6K7OlHcVKEqfT1zvY+VRe4=; b=K8uVbA/AbMUU5zbmk5EhulHgmYWkyoheOOdPs9/S4f926ADRG2/y2PEAFtwjDeAGnA VT2605rmMKjNi2l8niL7vyKsDK9l/U8X+frUBebjVQY0TaDsXWmJ36C9L+5W/nbzQGKO KsyS7yPAaRkfwya5WQC9WRhtExrY7b2R6OW2JRnUQJ6IiX5GIPg7Ufnyot0NUA5MjsE4 C00inJPlxydqRL3VOHX3mRM9E35dizjKfuTGk/emH/S2kvPa5UnqexH/bWzG2ijoNokZ im7dER/F7KeBedBJMWUnqxakH2+xvDUbnxKoQzoKp8K7QDVw2tf7KumjwK98J+Xn/kS3 PRDA== X-Gm-Message-State: ACgBeo0/s2qp/qikhf1PrwGBvlEWGYuc0Sgr+VBZbch3Jj6mtaNmLtAI skgjHbyrb1Cjmw69BrMqiPZUHg== X-Google-Smtp-Source: AA6agR6pLTTU310S3nqtgzaUEiElT11gCpfvqyS1uQGxNSgImfljeQezDWfRomv8VxI/iCRIKB1u2g== X-Received: by 2002:a17:90b:4b89:b0:1f5:68b:b14e with SMTP id lr9-20020a17090b4b8900b001f5068bb14emr4286572pjb.30.1661964140807; Wed, 31 Aug 2022 09:42:20 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id 199-20020a6300d0000000b00419ab8f8d2csm3550212pga.20.2022.08.31.09.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 09:42:20 -0700 (PDT) Date: Wed, 31 Aug 2022 09:42:19 -0700 From: Stephen Hemminger To: "Zhou, YidingX" Cc: Ferruh Yigit , "dev@dpdk.org" , "Zhang, Qi Z" , "stable@dpdk.org" Subject: Re: [PATCH] net/pcap: reduce time for stopping device Message-ID: <20220831094219.74f5aa6c@hermes.local> In-Reply-To: References: <20220825072041.10768-1-yidingx.zhou@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Mon, 29 Aug 2022 11:50:29 +0000 "Zhou, YidingX" 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.