Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp727698ima; Wed, 6 Feb 2019 07:25:18 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia4ohqtSARU2qfpBpMlNE38m7GEZsF3G7IgAFPvthgYUzmdrTyI4W4m5acr2EPETPuezQnE X-Received: by 2002:a63:1f4e:: with SMTP id q14mr9753409pgm.88.1549466718016; Wed, 06 Feb 2019 07:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549466718; cv=none; d=google.com; s=arc-20160816; b=IG9nIGdW3EUEm87DEoZXvXl0ZLy6uX3fGImCfRuuLLE+z2uGuA8yGh+iBFeaAFc5DC spDtuuc1CzzmONeYYEnNr1QiiChdHzGwWbUw+LsIYdk0o/f+614BfKf0+Qxz2Cr1iFYf yaVigU/JE2knMpGt2OWNmdwZ5M/oTM4Nw+gsxIOgB+P6niPAdCHfybM6ynMuE/2InoTn 0VTkqMRPYQvHorhah4qlJOhBhxk2Hi2Uk9Q6qOf7t43cfK2EO0ngWjbWZPkBvpIsnBFF 4AwYAeVelCdeeYl+fjxcnh3BUy/MpIY6Ysum8Rw0RZtlVDza6q/Q60GT3sU3or3eh/Kq KEww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=D3GDwuhj8ENbumB+wOJ7nGzpeZNP0inFcnqhEgjtfB0=; b=pm8b1q+PXf1aaPGTQww3onP66DtXItMi2pGTYwNRNfLUjWsK9Qkmji+cNqjVAfk+Bn adHjzkFv1i4J13k8qVaMOFpou4MfG4krEcHNqR8A0A6v2WFPET8leQ15zXZRSt6H1eTm Vpv8jfxeVNmNbN2UosvjtelIIDRL7fCs/jyD9kmnkIIlBv0er0IRtnN3+NG0bC2UwuIA 1ULfI+AYXXnG0UmFNNfPYmBbopJnjIWJrSHtg+iHqukZ9AdZS6YN649QRb1XxNs/OwMp PjFlMO50LAviTZYPdyeCIvOzpWaoSkeUrrDu7whZHJ+diI6pSQ9Wf8BGdKt06E3Kkqtv Z5/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si6777247pls.84.2019.02.06.07.25.01; Wed, 06 Feb 2019 07:25:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730677AbfBFOxZ (ORCPT + 99 others); Wed, 6 Feb 2019 09:53:25 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:40283 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728323AbfBFOxZ (ORCPT ); Wed, 6 Feb 2019 09:53:25 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 8F0648033F; Wed, 6 Feb 2019 15:53:16 +0100 (CET) Date: Wed, 6 Feb 2019 15:53:22 +0100 From: Pavel Machek To: Harry Pan Cc: LKML , gs0622@gmail.com, rjw@rjwysocki.net, len.brown@intel.com, linux-pm@vger.kernel.org Subject: Re: [PATCH] PM / suspend: measure the time of filesystem syncing Message-ID: <20190206145322.GA31815@amd> References: <20190203052007.27392-1-harry.pan@intel.com> <20190206144257.21464-1-harry.pan@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <20190206144257.21464-1-harry.pan@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2019-02-06 22:42:57, Harry Pan wrote: > This patch gives the reader an intuitive metric of the time cost by > the kernel issuing a filesystem sync during suspend; although developer > can guess by the timestamp of next log or enable the ftrace power event > for manual calculation, this manner is easier to read and benefits the > automatic script. >=20 > v2: simplify the variables, apply the simplest form of ktime API. >=20 > Signed-off-by: Harry Pan NAK. Pavel =09 > --- > kernel/power/suspend.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c > index 0bd595a0b610..87c0073f0c9d 100644 > --- a/kernel/power/suspend.c > +++ b/kernel/power/suspend.c > @@ -550,6 +550,8 @@ static void suspend_finish(void) > static int enter_state(suspend_state_t state) > { > int error; > + ktime_t start; > + unsigned int elapsed_msecs; > =20 > trace_suspend_resume(TPS("suspend_enter"), state, true); > if (state =3D=3D PM_SUSPEND_TO_IDLE) { > @@ -570,9 +572,12 @@ static int enter_state(suspend_state_t state) > =20 > #ifndef CONFIG_SUSPEND_SKIP_SYNC > trace_suspend_resume(TPS("sync_filesystems"), 0, true); > + start =3D ktime_get(); > pr_info("Syncing filesystems ... "); > ksys_sync(); > - pr_cont("done.\n"); > + elapsed_msecs =3D ktime_to_ms(ktime_sub(ktime_get(), start)); > + pr_cont("(elapsed %d.%03d seconds) done.\n", elapsed_msecs / 1000, > + elapsed_msecs % 1000); > trace_suspend_resume(TPS("sync_filesystems"), 0, false); > #endif > =20 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlxa9OIACgkQMOfwapXb+vK41wCfUiP4kyXwCFDr3IyBSoRpYFAs qTYAn32HBKY2Z4CbT1r7Yjw5qII8hYAc =meE1 -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7--