Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5532253ima; Tue, 5 Feb 2019 13:25:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IYILLKro3hH7vPubGIh0WGyeU7trWa0cdPf5/QEcIRmmRgIjDGImrbWQLo807T9Zh7fMsZy X-Received: by 2002:a63:94:: with SMTP id 142mr6395360pga.74.1549401923765; Tue, 05 Feb 2019 13:25:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549401923; cv=none; d=google.com; s=arc-20160816; b=bdH18P8EDFtWviBNqB0s/fh84Lx0v/6rOzl1MzAIWevmYGO71EbAqx1UmVkVxiVYrI 37O5siL9JwqYc2nQMgYTMVcgcthrTDT+siPZGlAQsVXTFUMrD/QmfbcuxcMprAt1lV9d lBAjvcQRlejyHdTLk5p8TbJQqrX4uN3g09kJHOoY4uwq72Kkxox75P90wN9aVMPG8wFY 7bCT4HbphWBpcftRcZLdleCFcan8VBHOMuXW2fM+BkkFTnUHUD19dZZdTzP5TzPmvrn+ pnPYeBCudaDU5M2NT/N6E613nJXBLMyOhxLISanruyqoN5wInCun3CD8d/FN5OBN0wvm DKww== 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=0IxckXpYnXxw5SEMKggH/8U2x/8qvzo4TuVs/03LjhY=; b=VCTsEynz8LKivu/aFkpXDmInGnKwr6SfzkLm/3lOfeiBWXa8KILyn4CFXGV0nGvuDQ 0WDV1C4HbvQJS5JswjdW3EQXuybFRnM3ZEJVWImfTE4Wfq6lM0coWfqo0vzLhQEsjHlk e8YWl/sIyXD5r+vqC3vUj9hbW0jkLsW5dX1qMzIg8Una+a2YAhN/pxFuorYxj8PfWFjW H6Bu7lnvMMrWFSDjJquQvojJsqJYGF6gnriJ0w+lWH7/Lm4+g/bIITm/PmEzjwWo2XIe ihWlWkemvIEymwFrQg1qyyGE5wkqFr13Z5aA57mSAJPM9ZFcragYzmXLjCMUZ3SfLqm6 JJYQ== 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 o12si4087573pgn.145.2019.02.05.13.25.07; Tue, 05 Feb 2019 13:25:23 -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 S1727850AbfBEVXM (ORCPT + 99 others); Tue, 5 Feb 2019 16:23:12 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:37673 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbfBEVXM (ORCPT ); Tue, 5 Feb 2019 16:23:12 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 9E0F1805B6; Tue, 5 Feb 2019 22:23:02 +0100 (CET) Date: Tue, 5 Feb 2019 22:23:08 +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: <20190205212308.GA2816@amd> References: <20190203052007.27392-1-harry.pan@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: <20190203052007.27392-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 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun 2019-02-03 13:20:07, 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. Do we really need this functionality? As you explained, developers can already use next timestamp or ftrace... and this is really not that interesting number. Pavel > Signed-off-by: Harry Pan > --- > kernel/power/suspend.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c > index 0bd595a0b610..f3b7c64f2242 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, end, elapsed; > + unsigned int elapsed_msecs; > =20 > trace_suspend_resume(TPS("suspend_enter"), state, true); > if (state =3D=3D PM_SUSPEND_TO_IDLE) { > @@ -570,9 +572,14 @@ 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_boottime(); > pr_info("Syncing filesystems ... "); > ksys_sync(); > - pr_cont("done.\n"); > + end =3D ktime_get_boottime(); > + elapsed =3D ktime_sub(end, start); > + elapsed_msecs =3D ktime_to_ms(elapsed); > + 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 --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlxZ/rwACgkQMOfwapXb+vKxWQCffU49bj6+FkVTyZL3n0zebj5I 4vQAn2CajxkYlaWHbdifSUUeoQhe0y4+ =gDCM -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh--