Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1601509 > unrolled thread

Re: [PATCH v1 1/2] tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver

Started byJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
First post2017-03-15 17:00 +0100
Last post2017-03-15 19:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v1 1/2] tpm: msleep() delays - replace with  usleep_range() in i2c nuvoton driver Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-03-15 17:00 +0100
    Re: [PATCH v1 1/2] tpm: msleep() delays - replace with usleep_range()  in i2c nuvoton driver Nayna <nayna@linux.vnet.ibm.com> - 2017-03-15 17:30 +0100
      Re: [PATCH v1 1/2] tpm: msleep() delays - replace with  usleep_range() in i2c nuvoton driver Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-03-15 19:00 +0100

#1601509 — Re: [PATCH v1 1/2] tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2017-03-15 17:00 +0100
SubjectRe: [PATCH v1 1/2] tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver
Message-ID<tljvc-1eE-19@gated-at.bofh.it>
On Fri, Mar 10, 2017 at 01:45:53PM -0500, Nayna Jain wrote:
> Commit 500462a9de65 "timers: Switch to a non-cascading wheel" replaced
> the 'classic' timer wheel, which aimed for near 'exact' expiry of the
> timers.  Their analysis was that the vast majority of timeout timers
> are used as safeguards, not as real timers, and are cancelled or
> rearmed before expiration.  The only exception noted to this were
> networking timers with a small expiry time.
> 
> Not included in the analysis was the TPM polling timer, which resulted
> in a longer normal delay and, every so often, a very long delay.  The
> non-cascading wheel delay is based on CONFIG_HZ.  For a description of
> the different rings and their delays, refer to the comments in
> kernel/time/timer.c.
> 
> Below are the delays given for rings 0 - 2, which explains the longer
> "normal" delays and the very, long delays as seen on systems with
> CONFIG_HZ 250.
> 
> * HZ 1000 steps
>  * Level Offset  Granularity            Range
>  *  0      0         1 ms                0 ms - 63 ms
>  *  1     64         8 ms               64 ms - 511 ms
>  *  2    128        64 ms              512 ms - 4095 ms (512ms - ~4s)
> 
> * HZ  250
>  * Level Offset  Granularity            Range
>  *  0      0         4 ms                0 ms - 255 ms
>  *  1     64        32 ms              256 ms - 2047 ms (256ms - ~2s)
>  *  2    128       256 ms             2048 ms - 16383 ms (~2s - ~16s)
> 
> Below is a comparison of extending the TPM with 1000 measurements,
> using msleep() vs. usleep_delay() when configured for 1000 hz vs. 250
> hz, before and after commit 500462a9de65.
> 
> linux-4.7 | msleep() usleep_range()
> 1000 hz: 0m44.628s | 1m34.497s 29.243s
> 250 hz: 1m28.510s | 4m49.269s 32.386s
> 
> linux-4.7  | min-max (msleep)  min-max (usleep_range)
> 1000 hz: 0:017 - 2:760s | 0:015 - 3:967s    0:014 - 0:418s
> 250 hz: 0:028 - 1:954s | 0:040 - 4:096s    0:016 - 0:816s
> 
> This patch replaces the msleep() with usleep_range() calls in the
> i2c nuvoton driver with a consistent max range value.
> 
> Signed-of-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
> Cc: stable@vger.kernel.org (linux-4.8)
> Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
> ---
> Changelog v1:
> 
> - Included Jason's feedbacks related to #defines.

What was changed?

/Jarkko

[toc] | [next] | [standalone]


#1601527 — Re: [PATCH v1 1/2] tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver

FromNayna <nayna@linux.vnet.ibm.com>
Date2017-03-15 17:30 +0100
SubjectRe: [PATCH v1 1/2] tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver
Message-ID<tljYd-1Jv-19@gated-at.bofh.it>
In reply to#1601509

On 03/15/2017 09:22 PM, Jarkko Sakkinen wrote:
> On Fri, Mar 10, 2017 at 01:45:53PM -0500, Nayna Jain wrote:
>> Commit 500462a9de65 "timers: Switch to a non-cascading wheel" replaced
>> the 'classic' timer wheel, which aimed for near 'exact' expiry of the
>> timers.  Their analysis was that the vast majority of timeout timers
>> are used as safeguards, not as real timers, and are cancelled or
>> rearmed before expiration.  The only exception noted to this were
>> networking timers with a small expiry time.
>>
>> Not included in the analysis was the TPM polling timer, which resulted
>> in a longer normal delay and, every so often, a very long delay.  The
>> non-cascading wheel delay is based on CONFIG_HZ.  For a description of
>> the different rings and their delays, refer to the comments in
>> kernel/time/timer.c.
>>
>> Below are the delays given for rings 0 - 2, which explains the longer
>> "normal" delays and the very, long delays as seen on systems with
>> CONFIG_HZ 250.
>>
>> * HZ 1000 steps
>>   * Level Offset  Granularity            Range
>>   *  0      0         1 ms                0 ms - 63 ms
>>   *  1     64         8 ms               64 ms - 511 ms
>>   *  2    128        64 ms              512 ms - 4095 ms (512ms - ~4s)
>>
>> * HZ  250
>>   * Level Offset  Granularity            Range
>>   *  0      0         4 ms                0 ms - 255 ms
>>   *  1     64        32 ms              256 ms - 2047 ms (256ms - ~2s)
>>   *  2    128       256 ms             2048 ms - 16383 ms (~2s - ~16s)
>>
>> Below is a comparison of extending the TPM with 1000 measurements,
>> using msleep() vs. usleep_delay() when configured for 1000 hz vs. 250
>> hz, before and after commit 500462a9de65.
>>
>> linux-4.7 | msleep() usleep_range()
>> 1000 hz: 0m44.628s | 1m34.497s 29.243s
>> 250 hz: 1m28.510s | 4m49.269s 32.386s
>>
>> linux-4.7  | min-max (msleep)  min-max (usleep_range)
>> 1000 hz: 0:017 - 2:760s | 0:015 - 3:967s    0:014 - 0:418s
>> 250 hz: 0:028 - 1:954s | 0:040 - 4:096s    0:016 - 0:816s
>>
>> This patch replaces the msleep() with usleep_range() calls in the
>> i2c nuvoton driver with a consistent max range value.
>>
>> Signed-of-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
>> Cc: stable@vger.kernel.org (linux-4.8)
>> Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
>> ---
>> Changelog v1:
>>
>> - Included Jason's feedbacks related to #defines.
>
> What was changed?
>

Changelog v1:
 >>
 >> - Included Jason's feedbacks related to #defines.

Based on Jason's review:
- Added () in #define
- Replaced hardcoded maximum range value with defined name.

Hmm.. could have included exact details.

Thanks & Regards,
- Nayna

> /Jarkko
>

[toc] | [prev] | [next] | [standalone]


#1601604

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2017-03-15 19:00 +0100
Message-ID<tllnk-2AP-23@gated-at.bofh.it>
In reply to#1601527
On Wed, Mar 15, 2017 at 09:51:47PM +0530, Nayna wrote:
> 
> 
> On 03/15/2017 09:22 PM, Jarkko Sakkinen wrote:
> > On Fri, Mar 10, 2017 at 01:45:53PM -0500, Nayna Jain wrote:
> > > Commit 500462a9de65 "timers: Switch to a non-cascading wheel" replaced
> > > the 'classic' timer wheel, which aimed for near 'exact' expiry of the
> > > timers.  Their analysis was that the vast majority of timeout timers
> > > are used as safeguards, not as real timers, and are cancelled or
> > > rearmed before expiration.  The only exception noted to this were
> > > networking timers with a small expiry time.
> > > 
> > > Not included in the analysis was the TPM polling timer, which resulted
> > > in a longer normal delay and, every so often, a very long delay.  The
> > > non-cascading wheel delay is based on CONFIG_HZ.  For a description of
> > > the different rings and their delays, refer to the comments in
> > > kernel/time/timer.c.
> > > 
> > > Below are the delays given for rings 0 - 2, which explains the longer
> > > "normal" delays and the very, long delays as seen on systems with
> > > CONFIG_HZ 250.
> > > 
> > > * HZ 1000 steps
> > >   * Level Offset  Granularity            Range
> > >   *  0      0         1 ms                0 ms - 63 ms
> > >   *  1     64         8 ms               64 ms - 511 ms
> > >   *  2    128        64 ms              512 ms - 4095 ms (512ms - ~4s)
> > > 
> > > * HZ  250
> > >   * Level Offset  Granularity            Range
> > >   *  0      0         4 ms                0 ms - 255 ms
> > >   *  1     64        32 ms              256 ms - 2047 ms (256ms - ~2s)
> > >   *  2    128       256 ms             2048 ms - 16383 ms (~2s - ~16s)
> > > 
> > > Below is a comparison of extending the TPM with 1000 measurements,
> > > using msleep() vs. usleep_delay() when configured for 1000 hz vs. 250
> > > hz, before and after commit 500462a9de65.
> > > 
> > > linux-4.7 | msleep() usleep_range()
> > > 1000 hz: 0m44.628s | 1m34.497s 29.243s
> > > 250 hz: 1m28.510s | 4m49.269s 32.386s
> > > 
> > > linux-4.7  | min-max (msleep)  min-max (usleep_range)
> > > 1000 hz: 0:017 - 2:760s | 0:015 - 3:967s    0:014 - 0:418s
> > > 250 hz: 0:028 - 1:954s | 0:040 - 4:096s    0:016 - 0:816s
> > > 
> > > This patch replaces the msleep() with usleep_range() calls in the
> > > i2c nuvoton driver with a consistent max range value.
> > > 
> > > Signed-of-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
> > > Cc: stable@vger.kernel.org (linux-4.8)
> > > Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
> > > ---
> > > Changelog v1:
> > > 
> > > - Included Jason's feedbacks related to #defines.
> > 
> > What was changed?
> > 
> 
> Changelog v1:
> >>
> >> - Included Jason's feedbacks related to #defines.
> 
> Based on Jason's review:
> - Added () in #define
> - Replaced hardcoded maximum range value with defined name.
> 
> Hmm.. could have included exact details.
> 
> Thanks & Regards,
> - Nayna
> 
> > /Jarkko
> > 

OK, I'll replace the original patch with this. Thanks.

/Jarkko

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web