LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
@ 2011-02-10 8:50 Jan Beulich
0 siblings, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2011-02-10 8:50 UTC (permalink / raw)
To: akpm, Linus Torvalds
Cc: Tim Deegan, Jeremy Fitzhardinge, stable, Jiri Slaby, linux-kernel
From: Tim Deegan <Tim.Deegan@citrix.com>
Fixes a hang when booting as dom0 under Xen, when jiffies can be
quite large by the time the kernel init gets this far.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
[jbeulich@novell.com: !time_after() -> time_before_eq() as suggested by Jiri Slaby]
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: stable@kernel.org
---
init/calibrate.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- 2.6.38-rc4/init/calibrate.c
+++ 2.6.38-rc4-calibrate-jiffy-overflow/init/calibrate.c
@@ -66,7 +66,7 @@ static unsigned long __cpuinit calibrate
pre_start = 0;
read_current_timer(&start);
start_jiffies = jiffies;
- while (jiffies <= (start_jiffies + 1)) {
+ while (time_before_eq(jiffies, start_jiffies + 1)) {
pre_start = start;
read_current_timer(&start);
}
@@ -74,8 +74,8 @@ static unsigned long __cpuinit calibrate
pre_end = 0;
end = post_start;
- while (jiffies <=
- (start_jiffies + 1 + DELAY_CALIBRATION_TICKS)) {
+ while (time_before_eq(jiffies, start_jiffies + 1 +
+ DELAY_CALIBRATION_TICKS)) {
pre_end = end;
read_current_timer(&end);
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
2011-02-09 20:54 ` Linus Torvalds
@ 2011-02-10 8:48 ` Jan Beulich
0 siblings, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2011-02-10 8:48 UTC (permalink / raw)
To: Linus Torvalds
Cc: Tim Deegan, Jeremy Fitzhardinge, akpm, Jiri Slaby, linux-kernel
>>> On 09.02.11 at 21:54, Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Wed, Feb 9, 2011 at 12:31 AM, Jan Beulich <JBeulich@novell.com> wrote:
>> Fixes a hang when booting as dom0 under Xen, when jiffies can be
>> quite large by the time the kernel init gets this far.
>>
>> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
>>
>> !time_after() -> time_before_eq() as per suggestion from Jiri Slaby.
>>
>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>> Cc: Jiri Slaby <jslaby@suse.cz>
>> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
>
> So I have nothing against the patch, but the changelog is broken.
>
> Is Tim the original author? If so, why wasn't that noted? I'm just
> guessing from that random signed-off line in the middle of the thing.
Indeed, I forgot to add the From: line. I'm sorry about that; I'll
resubmit.
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
2011-02-09 8:31 Jan Beulich
2011-02-09 9:21 ` Jiri Slaby
@ 2011-02-09 20:54 ` Linus Torvalds
2011-02-10 8:48 ` Jan Beulich
1 sibling, 1 reply; 9+ messages in thread
From: Linus Torvalds @ 2011-02-09 20:54 UTC (permalink / raw)
To: Jan Beulich
Cc: akpm, Tim Deegan, Jeremy Fitzhardinge, Jiri Slaby, linux-kernel
On Wed, Feb 9, 2011 at 12:31 AM, Jan Beulich <JBeulich@novell.com> wrote:
> Fixes a hang when booting as dom0 under Xen, when jiffies can be
> quite large by the time the kernel init gets this far.
>
> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
>
> !time_after() -> time_before_eq() as per suggestion from Jiri Slaby.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Jiri Slaby <jslaby@suse.cz>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
So I have nothing against the patch, but the changelog is broken.
Is Tim the original author? If so, why wasn't that noted? I'm just
guessing from that random signed-off line in the middle of the thing.
Please guys, don't drop authorship attributions, or alternatively
don't confuse me with odd random sign-off lines in the middle of the
message.
Linus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
2011-02-09 13:18 ` Jan Beulich
@ 2011-02-09 18:48 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 9+ messages in thread
From: Jeremy Fitzhardinge @ 2011-02-09 18:48 UTC (permalink / raw)
To: Jan Beulich; +Cc: Jiri Slaby, Tim Deegan, akpm, Linus Torvalds, linux-kernel
On 02/09/2011 05:18 AM, Jan Beulich wrote:
>>>> On 09.02.11 at 10:53, Jiri Slaby <jslaby@suse.cz> wrote:
>> On 02/09/2011 10:44 AM, Jan Beulich wrote:
>>>>>> On 09.02.11 at 10:21, Jiri Slaby <jslaby@suse.cz> wrote:
>>>> On 02/09/2011 09:31 AM, Jan Beulich wrote:
>>>>> Fixes a hang when booting as dom0 under Xen, when jiffies can be
>>>>> quite large by the time the kernel init gets this far.
>>>> As I wrote this might happen if the boot till this point takes ~ 5
>>>> minutes because we start at -5 minutes.
>>>>
>>>> That said, is this a candidate for stable? (If so, please CC stable.)
>>> Honestly, I'm not certain (given that mainline Xen Dom0 support
>>> is still only in its beginnings).
>> What about other VMs? If I run few non-kvm qemu VMs (kvm presets lpj) on
>> a busy dual-core machine, this will be a problem too, right?
> Yes, quite possible indeed.
Seems like stable material since it 1) has fixed a real bug, and 2) is
the right way to do things anyway. It just hasn't been seen to fix a
bug in a stable kernel, so perhaps not. If it were any more complex
then wouldn't push it.
J
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
2011-02-09 9:53 ` Jiri Slaby
@ 2011-02-09 13:18 ` Jan Beulich
2011-02-09 18:48 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2011-02-09 13:18 UTC (permalink / raw)
To: Jiri Slaby
Cc: Tim Deegan, Jeremy Fitzhardinge, akpm, Linus Torvalds, linux-kernel
>>> On 09.02.11 at 10:53, Jiri Slaby <jslaby@suse.cz> wrote:
> On 02/09/2011 10:44 AM, Jan Beulich wrote:
>>>>> On 09.02.11 at 10:21, Jiri Slaby <jslaby@suse.cz> wrote:
>>> On 02/09/2011 09:31 AM, Jan Beulich wrote:
>>>> Fixes a hang when booting as dom0 under Xen, when jiffies can be
>>>> quite large by the time the kernel init gets this far.
>>>
>>> As I wrote this might happen if the boot till this point takes ~ 5
>>> minutes because we start at -5 minutes.
>>>
>>> That said, is this a candidate for stable? (If so, please CC stable.)
>>
>> Honestly, I'm not certain (given that mainline Xen Dom0 support
>> is still only in its beginnings).
>
> What about other VMs? If I run few non-kvm qemu VMs (kvm presets lpj) on
> a busy dual-core machine, this will be a problem too, right?
Yes, quite possible indeed.
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
2011-02-09 9:44 ` Jan Beulich
@ 2011-02-09 9:53 ` Jiri Slaby
2011-02-09 13:18 ` Jan Beulich
0 siblings, 1 reply; 9+ messages in thread
From: Jiri Slaby @ 2011-02-09 9:53 UTC (permalink / raw)
To: Jan Beulich
Cc: Tim Deegan, Jeremy Fitzhardinge, akpm, Linus Torvalds, linux-kernel
On 02/09/2011 10:44 AM, Jan Beulich wrote:
>>>> On 09.02.11 at 10:21, Jiri Slaby <jslaby@suse.cz> wrote:
>> On 02/09/2011 09:31 AM, Jan Beulich wrote:
>>> Fixes a hang when booting as dom0 under Xen, when jiffies can be
>>> quite large by the time the kernel init gets this far.
>>
>> As I wrote this might happen if the boot till this point takes ~ 5
>> minutes because we start at -5 minutes.
>>
>> That said, is this a candidate for stable? (If so, please CC stable.)
>
> Honestly, I'm not certain (given that mainline Xen Dom0 support
> is still only in its beginnings).
What about other VMs? If I run few non-kvm qemu VMs (kvm presets lpj) on
a busy dual-core machine, this will be a problem too, right?
regards,
--
js
suse labs
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
2011-02-09 9:21 ` Jiri Slaby
@ 2011-02-09 9:44 ` Jan Beulich
2011-02-09 9:53 ` Jiri Slaby
0 siblings, 1 reply; 9+ messages in thread
From: Jan Beulich @ 2011-02-09 9:44 UTC (permalink / raw)
To: Jiri Slaby
Cc: Tim Deegan, Jeremy Fitzhardinge, akpm, Linus Torvalds, linux-kernel
>>> On 09.02.11 at 10:21, Jiri Slaby <jslaby@suse.cz> wrote:
> On 02/09/2011 09:31 AM, Jan Beulich wrote:
>> Fixes a hang when booting as dom0 under Xen, when jiffies can be
>> quite large by the time the kernel init gets this far.
>
> As I wrote this might happen if the boot till this point takes ~ 5
> minutes because we start at -5 minutes.
>
> That said, is this a candidate for stable? (If so, please CC stable.)
Honestly, I'm not certain (given that mainline Xen Dom0 support
is still only in its beginnings).
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
2011-02-09 8:31 Jan Beulich
@ 2011-02-09 9:21 ` Jiri Slaby
2011-02-09 9:44 ` Jan Beulich
2011-02-09 20:54 ` Linus Torvalds
1 sibling, 1 reply; 9+ messages in thread
From: Jiri Slaby @ 2011-02-09 9:21 UTC (permalink / raw)
To: Jan Beulich
Cc: akpm, Linus Torvalds, Tim Deegan, Jeremy Fitzhardinge, linux-kernel
On 02/09/2011 09:31 AM, Jan Beulich wrote:
> Fixes a hang when booting as dom0 under Xen, when jiffies can be
> quite large by the time the kernel init gets this far.
As I wrote this might happen if the boot till this point takes ~ 5
minutes because we start at -5 minutes.
That said, is this a candidate for stable? (If so, please CC stable.)
> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
>
> !time_after() -> time_before_eq() as per suggestion from Jiri Slaby.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Jiri Slaby <jslaby@suse.cz>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
>
> ---
> init/calibrate.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> --- 2.6.38-rc4/init/calibrate.c
> +++ 2.6.38-rc4-calibrate-jiffy-overflow/init/calibrate.c
> @@ -66,7 +66,7 @@ static unsigned long __cpuinit calibrate
> pre_start = 0;
> read_current_timer(&start);
> start_jiffies = jiffies;
> - while (jiffies <= (start_jiffies + 1)) {
> + while (time_before_eq(jiffies, start_jiffies + 1)) {
> pre_start = start;
> read_current_timer(&start);
> }
> @@ -74,8 +74,8 @@ static unsigned long __cpuinit calibrate
>
> pre_end = 0;
> end = post_start;
> - while (jiffies <=
> - (start_jiffies + 1 + DELAY_CALIBRATION_TICKS)) {
> + while (time_before_eq(jiffies, start_jiffies + 1 +
> + DELAY_CALIBRATION_TICKS)) {
> pre_end = end;
> read_current_timer(&end);
> }
thanks,
--
js
suse labs
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow
@ 2011-02-09 8:31 Jan Beulich
2011-02-09 9:21 ` Jiri Slaby
2011-02-09 20:54 ` Linus Torvalds
0 siblings, 2 replies; 9+ messages in thread
From: Jan Beulich @ 2011-02-09 8:31 UTC (permalink / raw)
To: akpm, Linus Torvalds
Cc: Tim Deegan, Jeremy Fitzhardinge, Jiri Slaby, linux-kernel
Fixes a hang when booting as dom0 under Xen, when jiffies can be
quite large by the time the kernel init gets this far.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
!time_after() -> time_before_eq() as per suggestion from Jiri Slaby.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
---
init/calibrate.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- 2.6.38-rc4/init/calibrate.c
+++ 2.6.38-rc4-calibrate-jiffy-overflow/init/calibrate.c
@@ -66,7 +66,7 @@ static unsigned long __cpuinit calibrate
pre_start = 0;
read_current_timer(&start);
start_jiffies = jiffies;
- while (jiffies <= (start_jiffies + 1)) {
+ while (time_before_eq(jiffies, start_jiffies + 1)) {
pre_start = start;
read_current_timer(&start);
}
@@ -74,8 +74,8 @@ static unsigned long __cpuinit calibrate
pre_end = 0;
end = post_start;
- while (jiffies <=
- (start_jiffies + 1 + DELAY_CALIBRATION_TICKS)) {
+ while (time_before_eq(jiffies, start_jiffies + 1 +
+ DELAY_CALIBRATION_TICKS)) {
pre_end = end;
read_current_timer(&end);
}
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-02-10 8:50 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-10 8:50 [PATCH] fix jiffy calculations in calibrate_delay_direct to handle overflow Jan Beulich
-- strict thread matches above, loose matches on Subject: below --
2011-02-09 8:31 Jan Beulich
2011-02-09 9:21 ` Jiri Slaby
2011-02-09 9:44 ` Jan Beulich
2011-02-09 9:53 ` Jiri Slaby
2011-02-09 13:18 ` Jan Beulich
2011-02-09 18:48 ` Jeremy Fitzhardinge
2011-02-09 20:54 ` Linus Torvalds
2011-02-10 8:48 ` Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).