Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2052305imm; Wed, 16 May 2018 07:11:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqLZTLim8l9YMhDZ70Z8qh+mWmP5gkiT1ZW+sAjlK/Xw4pAiZqvoNXC3faNy+6fveO8y37 X-Received: by 2002:a62:230b:: with SMTP id j11-v6mr1122290pfj.177.1526479904187; Wed, 16 May 2018 07:11:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526479904; cv=none; d=google.com; s=arc-20160816; b=n1om4n1bibhsU4cfs0J0F6RsaGfMec3KFG/E6YKXF5iHZU1Nr+w+ZGpe+K0n1K6N+A VzAaEgaYQhO6omBlkOOm5p7v5860dlfMNWIs1dXkg609WGfxUpvjTkVgPQgKem0hqOaW hhlPrNpmIF5djaEQyd20idUtMwL1QNnmwZWzVx2p0QT0fXEada37AXdrduK/SyCkPV4C XiA2gcE0/FD3pa74DBmaoqghMl/15klSQcLabYMQhW3zLzlvRppFGastCnO6ySITLxXd VAjkWmXwB0LlsJGKKCYLA2VIHrGHWc4h8M/Xx9j7nLHKDlAqY1YFu7BStgVkQRRp/ILP ZxTQ== 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=vDsxgAl92Znq38a1+Z2qJeyo3MjI86sUE00PMtIljsU=; b=0CvePP9POPDU8DIVSbieBqpYik8yPqNJSWipyOJG92dFYGZFhrRyzUiJ0eGm3dn2nu EkZtdCwzBRKjcHtoeZeCTBx+PIjyK3UdyP+F5OJy16pdu6uYyTWxHq3j+Pbi2qmzJpM2 CVOtK/hsvxtps6p9DtF8FbaTXexAiuPGkDi8Y+wqWqCrJ28yzuBtxka6ZLZj66QWM9Wa HtCMfNWlu7BgMwdh7ViLKxnCyy2aN3kXEKt6NgMKXp5UZXzPnLZ7sHz5f4FOvIsvZsqD runO64VTmwVMp9BaR+aKZK/DLRw8JJJdXBmLSJQK7tYj8+cJngcDNSKjzH0D6TPGXfrk v8Og== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23-v6si2129424pgv.360.2018.05.16.07.11.29; Wed, 16 May 2018 07:11:44 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752498AbeEPOKo (ORCPT + 99 others); Wed, 16 May 2018 10:10:44 -0400 Received: from mga05.intel.com ([192.55.52.43]:16201 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbeEPOKm (ORCPT ); Wed, 16 May 2018 10:10:42 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2018 07:10:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,406,1520924400"; d="scan'208";a="54872490" Received: from xuefengt-mobl.ccr.corp.intel.com (HELO localhost) ([10.249.254.127]) by fmsmga004.fm.intel.com with ESMTP; 16 May 2018 07:10:36 -0700 Date: Wed, 16 May 2018 17:10:35 +0300 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: [PATCH v4 1/2] tpm: reduce poll sleep time in tpm_transmit() Message-ID: <20180516141035.GA10304@linux.intel.com> References: <20180516055125.5685-1-nayna@linux.vnet.ibm.com> <20180516055125.5685-2-nayna@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180516055125.5685-2-nayna@linux.vnet.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 16, 2018 at 01:51:24AM -0400, Nayna Jain wrote: > tpm_try_transmit currently checks TPM status every 5 msecs between > send and recv. It does so in a loop for the maximum timeout as defined > in the TPM Interface Specification. However, the TPM may return before > 5 msecs. Thus the polling interval for each iteration can be reduced, > which improves overall performance. This patch changes the polling sleep > time from 5 msecs to 1 msec. > > Additionally, this patch renames TPM_POLL_SLEEP to TPM_TIMEOUT_POLL and > moves it to tpm.h as an enum value. > > After this change, performance on a system[1] with a TPM 1.2 with an 8 byte > burstcount for 1000 extends improved from ~14 sec to ~10.7 sec. > > [1] All tests are performed on an x86 based, locked down, single purpose > closed system. It has Infineon TPM 1.2 using LPC Bus. Already applied previous version of this. /Jarkko