Received: by 10.223.185.116 with SMTP id b49csp7230730wrg; Thu, 1 Mar 2018 02:00:21 -0800 (PST) X-Google-Smtp-Source: AG47ELtqjk1g13hhlxisYb5bk93nykycBTDxzxcX2ULx8Ku311a0y4xXGTVaH1E0SCAdg2zyIkM3 X-Received: by 10.98.56.131 with SMTP id f125mr1362915pfa.190.1519898421529; Thu, 01 Mar 2018 02:00:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519898421; cv=none; d=google.com; s=arc-20160816; b=eMmPMJ0j3EgoHnVheYyIr5T7c/eyJadubDyF9+qXMZCyZ5iXeVJ29GOP9taNsANLtz r5wlnvcEEae4pNFQA2mPIWWGmkoxLKVQfI9qTXti4N2xBk1VpPGj4y4HMto+nMbMErEW 6L3Kue+SuTLwPrky6jXnXq7K21mExgkrVQVYg+J+2oMKuNYOJNSWZscP2+ZgTnUhk5QW OHygA/YhGHjOisWnOwOwmT2DEHoctMOeRChvwdctq5YO5GT9s2Frpp6mFvdqd09SfngN uWMM5u/RU0Fa8p0YCUIlH82ZKqluq6dTTrN0wXu3UZ2njw5bF1yPnIE6Vvtlm3T0nNH+ Wi8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=rMqXPOmtPIj9pJKE5lv//L5cj3Y1aime8H2EsPIAfPs=; b=JKqBEPaFyJ/e/gb4+a+VHmYqqu3L6Z15df+bT9QPt8O0Y5H700m44kriCr2rGurvVO fOC3yZ4ALPCTuXGNpXKTCeIPbH0noAXHBFMSn+niXbeHKE56HB2wOmptfcVI+o2R2GTf YncE+4TuknDGHKXXb2Y06zqKpsE0p2wUneHptAsnQiovbxBIMSuQRY+3rxpvEVbSZ+/J 2YLTYr2Gk3GA4tK2GZWICoURZkS/dyVW3SIl+uUs71vmtK77BQeCToqkr4/j6jJpPGo+ jdi4bfbk8tmOisHVwQBLqx0x/MPQKHLqt2ItmPaOotsJcJyhDsBkWdSwQhR6akYOVIXp Totg== 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 59-v6si2808484pld.299.2018.03.01.02.00.06; Thu, 01 Mar 2018 02:00:21 -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 S967328AbeCAJ6u (ORCPT + 99 others); Thu, 1 Mar 2018 04:58:50 -0500 Received: from mga18.intel.com ([134.134.136.126]:56222 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967141AbeCAJ6r (ORCPT ); Thu, 1 Mar 2018 04:58:47 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 01:58:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,407,1515484800"; d="scan'208";a="22027074" Received: from pericsso-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.51]) by orsmga006.jf.intel.com with ESMTP; 01 Mar 2018 01:58:41 -0800 Date: Thu, 1 Mar 2018 11:58:40 +0200 From: Jarkko Sakkinen To: Nayna Jain Cc: linux-integrity@vger.kernel.org, zohar@linux.vnet.ibm.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, peterhuewe@gmx.de, tpmdd@selhorst.net, jgunthorpe@obsidianresearch.com, patrickc@us.ibm.com Subject: Re: [RFC PATCH 3/3] tpm: tpm_msleep() with finer granularity improves performance Message-ID: <20180301095840.GD29420@linux.intel.com> References: <20180228191828.20056-1-nayna@linux.vnet.ibm.com> <20180228191828.20056-3-nayna@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180228191828.20056-3-nayna@linux.vnet.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 28, 2018 at 02:18:28PM -0500, Nayna Jain wrote: > When 'commit 9f3fc7bcddcb ("tpm: replace msleep() with usleep_range() > in TPM 1.2/2.0 generic drivers")' was upstreamed, it replaced the "was upstreamed" is redundant information. If you speak about commit ID, it is expected to be in the mainline. Why there is "'" before the word 'commit'? Just write In commit 9f3fc7bcddcb ("tpm: replace msleep() with usleep_range() in TPM 1.2/2.0 generic drivers")' msleep() was replaced with usleep_range(). > msleep() calls with usleep_range(), but did not change the > granularity of the calls. They're still defined in terms of msec. > Test results show that refining the granularity further improves > the performance. We're posting this patch as an RFC to show that there > needs to be another function which allows finer granularity. > > After this change, performance on a TPM 1.2 with an 8 byte > burstcount for 1000 extends improved from ~10.7sec to ~6.9sec. Environment where this result was achieved would be mandatory. > Signed-off-by: Nayna Jain > --- > drivers/char/tpm/tpm.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h > index 7e797377e1eb..8cad6bfc5f46 100644 > --- a/drivers/char/tpm/tpm.h > +++ b/drivers/char/tpm/tpm.h > @@ -522,8 +522,7 @@ int tpm_pm_resume(struct device *dev); > > static inline void tpm_msleep(unsigned int delay_msec) > { > - usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US, > - delay_msec * 1000); > + usleep_range((delay_msec * 1000) / 10, (delay_msec * 1000) / 2); Shouldn't the max be 'delay_msec * 1000'? Where do these numbers come from? /Jarkko