Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1727435 > unrolled thread
| Started by | Nayna Jain <nayna@linux.vnet.ibm.com> |
|---|---|
| First post | 2017-09-06 15:10 +0200 |
| Last post | 2017-09-07 18:20 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2 0/4] additional TPM performance improvements Nayna Jain <nayna@linux.vnet.ibm.com> - 2017-09-06 15:10 +0200
[PATCH v2 4/4] tpm: use tpm_msleep() value as max delay Nayna Jain <nayna@linux.vnet.ibm.com> - 2017-09-06 15:10 +0200
Re: [PATCH v2 0/4] additional TPM performance improvements Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-09-07 18:20 +0200
| From | Nayna Jain <nayna@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-09-06 15:10 +0200 |
| Subject | [PATCH v2 0/4] additional TPM performance improvements |
| Message-ID | <umI5X-1TZ-3@gated-at.bofh.it> |
After further discussions with the Device Driver working group (ddwg), the following changes were made: * Check for burstcount at least once to confirm the TPM is ready to accept the data. Similarly, query for the TPM Expect status as sanity check at the end. * Make the sleep for status check during send() in the loop less than 5msec. * Make the sleep in the loop while querying for burstcount less than 5msec. Below is the list of patches along with the performance improvements seen with a TPM 1.2 with an 8 byte burstcount for 1000 extends: Patch |Improvement(time in sec) tpm: ignore burstcount to improve tpm_tis | ~41 - ~14 send() performance. tpm: define __wait_for_tpm_stat to specify | ~14 - ~10 variable polling sleep time tpm: reduce tpm_msleep() time in | ~10 - ~9 get_burstcount() tpm: modify tpm_msleep() function to have | ~9 - ~8 max range Changelog v2: * Add module parameter to handle ignoring of burst count during tpm tis send() operation. * Add improvements over sleep time to reduce delays. Nayna Jain (4): tpm: ignore burstcount to improve tpm_tis send() performance. tpm: define __wait_for_tpm_stat to specify variable polling sleep time tpm: reduce tpm_msleep() time in get_burstcount() tpm: use tpm_msleep() value as max delay Documentation/admin-guide/kernel-parameters.txt | 8 ++++++ drivers/char/tpm/tpm-interface.c | 15 ++++++++-- drivers/char/tpm/tpm.h | 7 +++-- drivers/char/tpm/tpm_tis_core.c | 37 +++++++++++++++++++------ 4 files changed, 53 insertions(+), 14 deletions(-) -- 2.13.3
[toc] | [next] | [standalone]
| From | Nayna Jain <nayna@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-09-06 15:10 +0200 |
| Subject | [PATCH v2 4/4] tpm: use tpm_msleep() value as max delay |
| Message-ID | <umIfF-2cQ-33@gated-at.bofh.it> |
| In reply to | #1727435 |
Currently, tpm_msleep() uses delay_msec as the minimum value in
usleep_range. However, that is the maximum time we want to wait.
The function is modified to use the delay_msec as the maximum
value, not the minimum value.
After this change, performance on a TPM 1.2 with an 8 byte
burstcount for 1000 extends improved from ~9sec to ~8sec.
Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
---
drivers/char/tpm/tpm.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index eb2f8818eded..ff5a8b7b80b9 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -533,8 +533,8 @@ int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
static inline void tpm_msleep(unsigned int delay_msec)
{
- usleep_range(delay_msec * 1000,
- (delay_msec * 1000) + TPM_TIMEOUT_RANGE_US);
+ usleep_range((delay_msec * 1000) - TPM_TIMEOUT_RANGE_US,
+ delay_msec * 1000);
};
struct tpm_chip *tpm_chip_find_get(int chip_num);
--
2.13.3
[toc] | [prev] | [next] | [standalone]
| From | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
|---|---|
| Date | 2017-09-07 18:20 +0200 |
| Message-ID | <un7H3-2qi-1@gated-at.bofh.it> |
| In reply to | #1727435 |
On Wed, Sep 06, 2017 at 08:56:35AM -0400, Nayna Jain wrote: > After further discussions with the Device Driver working group (ddwg), > the following changes were made: > > * Check for burstcount at least once to confirm the TPM is ready to accept > the data. Similarly, query for the TPM Expect status as sanity check at > the end. > > * Make the sleep for status check during send() in the loop less than > 5msec. > > * Make the sleep in the loop while querying for burstcount less than > 5msec. > > Below is the list of patches along with the performance improvements > seen with a TPM 1.2 with an 8 byte burstcount for 1000 extends: > > Patch |Improvement(time in sec) > > tpm: ignore burstcount to improve tpm_tis | ~41 - ~14 > send() performance. > > tpm: define __wait_for_tpm_stat to specify | ~14 - ~10 > variable polling sleep time > > tpm: reduce tpm_msleep() time in | ~10 - ~9 > get_burstcount() > > tpm: modify tpm_msleep() function to have | ~9 - ~8 > max range > > Changelog v2: > > * Add module parameter to handle ignoring of burst count during > tpm tis send() operation. > * Add improvements over sleep time to reduce delays. > > Nayna Jain (4): > tpm: ignore burstcount to improve tpm_tis send() performance. > tpm: define __wait_for_tpm_stat to specify variable polling sleep time > tpm: reduce tpm_msleep() time in get_burstcount() > tpm: use tpm_msleep() value as max delay > > Documentation/admin-guide/kernel-parameters.txt | 8 ++++++ > drivers/char/tpm/tpm-interface.c | 15 ++++++++-- > drivers/char/tpm/tpm.h | 7 +++-- > drivers/char/tpm/tpm_tis_core.c | 37 +++++++++++++++++++------ > 4 files changed, 53 insertions(+), 14 deletions(-) > > -- > 2.13.3 > I'll look into this after next week. /Jarkko
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web