Received: by 10.223.185.116 with SMTP id b49csp2875883wrg; Mon, 5 Mar 2018 10:04:27 -0800 (PST) X-Google-Smtp-Source: AG47ELu/IuoidgQUbCI+v9+/B6vJTyrSgJGdJNH9U7qMg4IHWxkt3JPbh1aIC+mvih5Dfoo0O09s X-Received: by 2002:a17:902:b28b:: with SMTP id u11-v6mr13856314plr.146.1520273067472; Mon, 05 Mar 2018 10:04:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520273067; cv=none; d=google.com; s=arc-20160816; b=w7gvu7mPxTb95ubsyMbV6DvXhOwfdtDsaZgmAAcg7t3OdoDe3bMnYY5ic2lAiAM+J0 Sc/SbQJlB2vL1wT+gH95GLDUyw3ENSsx7Nozf8nIrLWwX1u4y8QrQQ87hPUaTBAiylX2 Pbre78p6VampjnkjhRHLC0KAju3RaOXCanU2cc2trS2CgbhmkWslv2EARBE1O76M5nct eq0Fi0RvsYV1ZVrgiPP9Huf16UbS1dFDvKxLakzQOyCVZgB1xdwCVzre+GeEREMmyfZG qeuhaiDI77zMEe371fCiuqQ46TFKBmCMwn0efHpjVllVvQX3bsKiGeAstcvKVkxXfCOk EkRA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=pkVaxYMWWHmV97L+kUW9QcZklIl0vzLg0MNrl2tQwb8=; b=USjX3I21eSmVteCLW/w08EWegqvvHTuRr9hP4Upi3KxQz+3rLUn+fSGOwYfR57FSo9 20km9sDYz/pwW9sVFBApd8O2/YgWw/YrL8uBWTY3mmS450VVYattCgcfUy3rGk1YF12E 12DuJES3zmwHIdNTYgG1Hx9HkE28A7K7iXmXIVGMRLThu0GB6Kn5AVlZns6fvxV50FDg ms1k1rdD+awdKNcWBe9kMwNOhHW7yQvRCSQgBqstNT0DxACbmFm0+2+ZEMswaZSh6uOQ /mfNOJ9Cq/qdaXtLOPbIH3Pu7dm5ORI7eGKwP84BOIvSbb3RcUO1TRVNEz9qdpex4rAu cyCA== 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 m22si8580867pgv.643.2018.03.05.10.04.09; Mon, 05 Mar 2018 10:04:27 -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 S1752686AbeCESBw (ORCPT + 99 others); Mon, 5 Mar 2018 13:01:52 -0500 Received: from mga14.intel.com ([192.55.52.115]:12891 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751852AbeCESBv (ORCPT ); Mon, 5 Mar 2018 13:01:51 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 10:01:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,427,1515484800"; d="scan'208";a="25355339" Received: from bmaguire-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.153]) by fmsmga002.fm.intel.com with ESMTP; 05 Mar 2018 10:01:46 -0800 Date: Mon, 5 Mar 2018 20:01:44 +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: [PATCH 2/3] tpm: reduce poll sleep time between send() and recv() in tpm_transmit() Message-ID: <20180305180144.GE5791@linux.intel.com> References: <20180228191828.20056-1-nayna@linux.vnet.ibm.com> <20180228191828.20056-2-nayna@linux.vnet.ibm.com> <20180301092222.GC29420@linux.intel.com> <6ef601be-5627-6746-bd4a-4f391aba8b04@linux.vnet.ibm.com> <20180305105633.GE25377@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180305105633.GE25377@linux.intel.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 Mon, Mar 05, 2018 at 12:56:33PM +0200, Jarkko Sakkinen wrote: > On Fri, Mar 02, 2018 at 12:26:35AM +0530, Nayna Jain wrote: > > > > > > On 03/01/2018 02:52 PM, Jarkko Sakkinen wrote: > > > On Wed, Feb 28, 2018 at 02:18:27PM -0500, Nayna Jain wrote: > > > > In tpm_transmit, after send(), the code checks for status in a loop > > > Maybe cutting hairs now but please just use the actual function name > > > instead of send(). Just makes the commit log more useful asset. > > Sure, will do. > > > > > > > - tpm_msleep(TPM_TIMEOUT); > > > > + tpm_msleep(TPM_TIMEOUT_POLL); > > > What about just calling schedule()? > > I'm not sure what you mean by "schedule()".? Are you suggesting instead of > > using usleep_range(),? using something with an even finer grain construct? > > > > Thanks & Regards, > > ???? - Nayna > > kernel/sched/core.c The question I'm trying ask to is: is it better to sleep such a short time or just ask scheduler to schedule something else after each iteration? /Jarkko