Skip to contentSkip to conversation

3.8.10-rt6

ANNOUNCE Sebastian Andrzej Siewior 7 participants 19 messages Apr 29, 2013 – May 3, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Dear RT Folks,

I'm pleased to announce the 3.8.10-rt6 release.

changes since v3.8.10-rt5:
- the i915 compiles again after I broke it in the last release. A patch was sent by Carsten Emde.

Known issues:

- SLxB is broken on PowerPC.
- suspend / resume seems to program program the timer wrong and wait ages until it continues.

The delta patch against v3.8.10-rt5 is appended below and can be found here:

https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/incr/patch-3.8.10-rt5-rt6.patch.xz

The RT patch against 3.8.9 can be found here:

https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/patch-3.8.10-rt6.patch.xz

The split quilt queue is available at:

https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/patches-3.8.10-rt6.tar.xz

Sebastian

drivers/gpu/drm/i915/i915_gem_execbuffer.c +3 -1
index 81125de..eabd3dd 100644
@@ -814,6 +814,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 	struct intel_ring_buffer *ring;
 	u32 ctx_id = i915_execbuffer2_get_context_id(*args);
 	u32 exec_start, exec_len;
+	u32 seqno;
 	u32 mask;
 	u32 flags;
 	int ret, mode, i;
@@ -1068,7 +1069,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 			goto err;
 	}
 
-	trace_i915_gem_ring_dispatch(ring, intel_ring_get_seqno(ring), flags);
+	seqno = intel_ring_get_seqno(ring);
+	trace_i915_gem_ring_dispatch(ring, seqno, flags);
 	i915_trace_irq_get(ring, seqno);
 
 	i915_gem_execbuffer_move_to_active(&objects, ring);
localversion-rt +1 -1
index 0efe7ba..8fc605d 100644
@@ -1 +1 @@
--rt5
+-rt6
#1 lore raw
Quoted 3 lines · On Mon, 29 Apr 2013 22:12:02 +0200 Sebastian Andrzej Siewior…

- suspend / resume seems to program program the timer wrong and wait ages until it continues.

It has to be something we're doing when we apply RT to v3.8.x, since v3.8.x suspends/resumes with no issues and I was able to suspend and resume fine with the 3.6-rt series.

I'm looking at a git diff between 3.6.11-rt30 and 3.8.9-rt4, specifically in kernel/time* and arch/x86/kernel but so far I'm not seeing much that's RT specific.

Clark

#17 lore raw
In reply to a message not in the archive
Quoted 8 lines · Bernhard Schiffner
Quoted 5 lines

Known issues:

- SLxB is broken on PowerPC.
- suspend / resume seems to program program the timer wrong and wait ages until it continues.

Yes, it's a annoying problem here too.
How can I help to solve it?

Are you referring to the PowerPC issue or suspend / resume?

Quoted 1 line

Bernhard

Sebastian

#2 lore raw
In reply to Clark Williams
Quoted 9 lines · Clark Williams
Quoted 3 lines · On Mon, 29 Apr 2013 22:12:02 +0200 Sebastian Andrzej Siewior…

- suspend / resume seems to program program the timer wrong and wait ages until it continues.

It has to be something we're doing when we apply RT to v3.8.x, since v3.8.x suspends/resumes with no issues and I was able to suspend and resume fine with the 3.6-rt series.

Our v3.8x series is currently no different than "vanilla" rt. quilt-import on top of v3.8.10, with no RH patches. So, I know you said that just as a polite way to say, "maybe we messed up, but...", however I'm confident we didn't.

Also, that must be a typo, you meant to say that v3.8.x does have issues with suspend / resume right?

Quoted 7 lines

I'm looking at a git diff between 3.6.11-rt30 and 3.8.9-rt4, specifically in kernel/time* and arch/x86/kernel but so far I'm not seeing much that's RT specific.

Clark

#3 lore raw
In reply to Clark Williams
Quoted 9 lines · * Clark Williams | 2013-04-29 16:19:25 [-0500]:
Quoted 3 lines · On Mon, 29 Apr 2013 22:12:02 +0200 Sebastian Andrzej Siewior…

- suspend / resume seems to program program the timer wrong and wait ages until it continues.

It has to be something we're doing when we apply RT to v3.8.x, since v3.8.x suspends/resumes with no issues and I was able to suspend and resume fine with the 3.6-rt series.

Are your problems gone with:

kernel/printk.c +2 -0
index 6d52c34..8783ea5 100644
@@ -1583,6 +1583,8 @@ asmlinkage int vprintk_emit(int facility, int level,
 	 */
 	if (unlikely(forced_early_printk(fmt, args)))
 		return 1;
+	if (in_nmi())
+		return 1;
 
 	boot_delay_msec(level);
 	printk_delay();
Quoted 1 line

Clark

Sebastian

#4 lore raw

Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Clark Williams
Quoted 8 lines · * Clark Williams | 2013-04-29 16:19:25 [-0500]:
Quoted 2 lines · On Mon, 29 Apr 2013 22:12:02 +0200 Sebastian Andrzej Siewior…

- suspend / resume seems to program program the timer wrong and wait ages until it continues.

It has to be something we're doing when we apply RT to v3.8.x, since v3.8.x suspends/resumes with no issues and I was able to suspend and resume fine with the 3.6-rt series.

I think I figured out what is going on or atleast I think I did.

This log snippet is from the resume path (from suspend to mem):

[   15.052115] Enabling non-boot CPUs ...
[   15.052115] smpboot: Booting Node 0 Processor 1 APIC 0x1
[   14.841378] Initializing CPU#1
[   42.840017] [sched_delayed] sched: RT throttling activated
[   42.842144] CPU1 is up
[   42.842536] smpboot: Booting Node 0 Processor 2 APIC 0x2

Two things happen here:
- the time goes backwards from 15.X to 14.X. This is okay because the 14.X is the timestamp from the secondary CPU not - yet synchronized with the bootcpu
- the printk with "CPU1 is up" is comming from the boot CPU and according to the timestamp about 28secs passed by. But this did not really happen as the whole procedure took less time.

The next thing that happens is that RCU assumes nobody is doing any progress (for almost 28secs) and triggers NMIs & printks to get some attention. I have a trace where
- CPU0: arch_trigger_all_cpu_backtrace_handler() => printk() has "lock" and is spinning for logbuf_lock

- CPU1: print_cpu_stall() => printk() (spinning for the lock) => NMI => arch_trigger_all_cpu_backtrace_handler()
it may have logbuf_lock and is spinning for "lock"

I can't tell if CPU1 got the logbuf_lock at this time but it seemed that it made no progress until I ended it.
This NMI releated deadlock is a problem which should also trigger mainline, right?

Now, the time jump on the other hand is the real issue here and is RT-only. It looks like we get a big number of timer updates via tick_do_update_jiffies64() because according to ktime_get() that much time really passed by.

The sollution seems as simple as

Quoted 1 line

From c27eb2e0ab0b5acd96a4b62288976f1b72789b3e Mon Sep 17 00:00:00 2001

From: Sebastian Andrzej Siewior <[email protected]>
Date: Tue, 30 Apr 2013 18:53:55 +0200
Subject: [PATCH] time/timekeeping: shadow tk->cycle_last together with
clock->cycle_last

Commit ("timekeeping: Store cycle_last value in timekeeper struct as well") introduced a tk-> based cycle_last values which needs to be reset on resume path as well or else ktime_get() will think that time increased a lot.

---
 kernel/time/timekeeping.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/timekeeping.c +1 -0
index 99f943b..688817f 100644
@@ -777,6 +777,7 @@ static void timekeeping_resume(void)
 	}
 	/* re-base the last cycle value */
 	tk->clock->cycle_last = tk->clock->read(tk->clock);
+	tk->cycle_last = tk->clock->cycle_last;
 	tk->ntp_error = 0;
 	timekeeping_suspended = 0;
 	timekeeping_update(tk, false, true);
Signature · 3 lines
1.7.10.4

So Clark, does this patch fix your problem?
Quoted 1 line

Clark

Sebastian

#5 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

Quoted 6 lines · Sebastian Andrzej Siewior

The next thing that happens is that RCU assumes nobody is doing any progress (for almost 28secs) and triggers NMIs & printks to get some attention. I have a trace where
- CPU0: arch_trigger_all_cpu_backtrace_handler() => printk() has "lock" and is spinning for logbuf_lock

Quoted 8 lines

- CPU1: print_cpu_stall() => printk() (spinning for the lock) => NMI => arch_trigger_all_cpu_backtrace_handler()
it may have logbuf_lock and is spinning for "lock"

I can't tell if CPU1 got the logbuf_lock at this time but it seemed that it made no progress until I ended it.
This NMI releated deadlock is a problem which should also trigger mainline, right?

Well, yeah, as sending out a NMI stack dump is sorta the last resort, and is dangerous to do printks from NMI context.

Quoted 5 lines

Now, the time jump on the other hand is the real issue here and is RT-only. It looks like we get a big number of timer updates via tick_do_update_jiffies64() because according to ktime_get() that much time really passed by.

As the NMI dump only happens because of the time jump, which as you said, is -rt only, I wouldn't say that the NMI deadlock is a mainline bug.

-- Steve

#8 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Sebastian Andrzej Siewior
Quoted 85 lines · On Tue, 30 Apr 2013 19:09:48 +0200 Sebastian Andrzej Siewior…
Quoted 8 lines · * Clark Williams | 2013-04-29 16:19:25 [-0500]:
Quoted 2 lines · On Mon, 29 Apr 2013 22:12:02 +0200 Sebastian Andrzej Siewior…

- suspend / resume seems to program program the timer wrong and wait ages until it continues.

It has to be something we're doing when we apply RT to v3.8.x, since v3.8.x suspends/resumes with no issues and I was able to suspend and resume fine with the 3.6-rt series.

I think I figured out what is going on or atleast I think I did.

This log snippet is from the resume path (from suspend to mem):

[   15.052115] Enabling non-boot CPUs ...
[   15.052115] smpboot: Booting Node 0 Processor 1 APIC 0x1
[   14.841378] Initializing CPU#1
[   42.840017] [sched_delayed] sched: RT throttling activated
[   42.842144] CPU1 is up
[   42.842536] smpboot: Booting Node 0 Processor 2 APIC 0x2

Two things happen here:
- the time goes backwards from 15.X to 14.X. This is okay because the 14.X is the timestamp from the secondary CPU not - yet synchronized with the bootcpu
- the printk with "CPU1 is up" is comming from the boot CPU and according to the timestamp about 28secs passed by. But this did not really happen as the whole procedure took less time.

The next thing that happens is that RCU assumes nobody is doing any progress (for almost 28secs) and triggers NMIs & printks to get some attention. I have a trace where
- CPU0: arch_trigger_all_cpu_backtrace_handler() => printk() has "lock" and is spinning for logbuf_lock

- CPU1: print_cpu_stall() => printk() (spinning for the lock) => NMI => arch_trigger_all_cpu_backtrace_handler()
it may have logbuf_lock and is spinning for "lock"

I can't tell if CPU1 got the logbuf_lock at this time but it seemed that it made no progress until I ended it.
This NMI releated deadlock is a problem which should also trigger mainline, right?

Now, the time jump on the other hand is the real issue here and is RT-only. It looks like we get a big number of timer updates via tick_do_update_jiffies64() because according to ktime_get() that much time really passed by.

The sollution seems as simple as

From c27eb2e0ab0b5acd96a4b62288976f1b72789b3e Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <[email protected]>
Date: Tue, 30 Apr 2013 18:53:55 +0200
Subject: [PATCH] time/timekeeping: shadow tk->cycle_last together with
clock->cycle_last

Commit ("timekeeping: Store cycle_last value in timekeeper struct as well") introduced a tk-> based cycle_last values which needs to be reset on resume path as well or else ktime_get() will think that time increased a lot.

---
 kernel/time/timekeeping.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/timekeeping.c +1 -0
index 99f943b..688817f 100644
@@ -777,6 +777,7 @@ static void timekeeping_resume(void)
 	}
 	/* re-base the last cycle value */
 	tk->clock->cycle_last = tk->clock->read(tk->clock);
+	tk->cycle_last = tk->clock->cycle_last;
 	tk->ntp_error = 0;
 	timekeeping_suspended = 0;
 	timekeeping_update(tk, false, true);
Signature · 3 lines
1.7.10.4

So Clark, does this patch fix your problem?

It does seem to! I've got both patches applied right now (your patch to vprintk_emit() and the above patch) and it fixes the long delay on my lab box. When I get done today (or have a break in the action) I'll try it on my laptop to verify.

Thanks Sebastian,
Clark

#9 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

Quoted 94 lines · On Tue, 30 Apr 2013 14:18:24 -0500 Clark Williams <[email protected]> wrote:
Quoted 85 lines · On Tue, 30 Apr 2013 19:09:48 +0200 Sebastian Andrzej Siewior…
Quoted 8 lines · * Clark Williams | 2013-04-29 16:19:25 [-0500]:
Quoted 2 lines · On Mon, 29 Apr 2013 22:12:02 +0200 Sebastian Andrzej Siewior…

- suspend / resume seems to program program the timer wrong and wait ages until it continues.

It has to be something we're doing when we apply RT to v3.8.x, since v3.8.x suspends/resumes with no issues and I was able to suspend and resume fine with the 3.6-rt series.

I think I figured out what is going on or atleast I think I did.

This log snippet is from the resume path (from suspend to mem):

[   15.052115] Enabling non-boot CPUs ...
[   15.052115] smpboot: Booting Node 0 Processor 1 APIC 0x1
[   14.841378] Initializing CPU#1
[   42.840017] [sched_delayed] sched: RT throttling activated
[   42.842144] CPU1 is up
[   42.842536] smpboot: Booting Node 0 Processor 2 APIC 0x2

Two things happen here:
- the time goes backwards from 15.X to 14.X. This is okay because the 14.X is the timestamp from the secondary CPU not - yet synchronized with the bootcpu
- the printk with "CPU1 is up" is comming from the boot CPU and according to the timestamp about 28secs passed by. But this did not really happen as the whole procedure took less time.

The next thing that happens is that RCU assumes nobody is doing any progress (for almost 28secs) and triggers NMIs & printks to get some attention. I have a trace where
- CPU0: arch_trigger_all_cpu_backtrace_handler() => printk() has "lock" and is spinning for logbuf_lock

- CPU1: print_cpu_stall() => printk() (spinning for the lock) => NMI => arch_trigger_all_cpu_backtrace_handler()
it may have logbuf_lock and is spinning for "lock"

I can't tell if CPU1 got the logbuf_lock at this time but it seemed that it made no progress until I ended it.
This NMI releated deadlock is a problem which should also trigger mainline, right?

Now, the time jump on the other hand is the real issue here and is RT-only. It looks like we get a big number of timer updates via tick_do_update_jiffies64() because according to ktime_get() that much time really passed by.

The sollution seems as simple as

From c27eb2e0ab0b5acd96a4b62288976f1b72789b3e Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <[email protected]>
Date: Tue, 30 Apr 2013 18:53:55 +0200
Subject: [PATCH] time/timekeeping: shadow tk->cycle_last together with
clock->cycle_last

Commit ("timekeeping: Store cycle_last value in timekeeper struct as well") introduced a tk-> based cycle_last values which needs to be reset on resume path as well or else ktime_get() will think that time increased a lot.

---
 kernel/time/timekeeping.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/timekeeping.c +1 -0
index 99f943b..688817f 100644
@@ -777,6 +777,7 @@ static void timekeeping_resume(void)
 	}
 	/* re-base the last cycle value */
 	tk->clock->cycle_last = tk->clock->read(tk->clock);
+	tk->cycle_last = tk->clock->cycle_last;
 	tk->ntp_error = 0;
 	timekeeping_suspended = 0;
 	timekeeping_update(tk, false, true);
Signature · 3 lines
1.7.10.4

So Clark, does this patch fix your problem?

It does seem to! I've got both patches applied right now (your patch to vprintk_emit() and the above patch) and it fixes the long delay on my lab box. When I get done today (or have a break in the action) I'll try it on my laptop to verify.

Quoted 2 lines

Thanks Sebastian,
Clark

Tested on my laptop which now resumes.

Many thanks.

Clark

#10 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Sebastian Andrzej Siewior
Quoted 28 lines · Sebastian Andrzej Siewior

Now, the time jump on the other hand is the real issue here and is RT-only. It looks like we get a big number of timer updates via tick_do_update_jiffies64() because according to ktime_get() that much time really passed by.

The sollution seems as simple as

From c27eb2e0ab0b5acd96a4b62288976f1b72789b3e Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <[email protected]>
Date: Tue, 30 Apr 2013 18:53:55 +0200
Subject: [PATCH] time/timekeeping: shadow tk->cycle_last together with
clock->cycle_last

Commit ("timekeeping: Store cycle_last value in timekeeper struct as well") introduced a tk-> based cycle_last values which needs to be reset on resume path as well or else ktime_get() will think that time increased a lot.

---
 kernel/time/timekeeping.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/timekeeping.c +0 -0
index 99f943b..688817f 100644

kernel/time/timekeeping.c static void timekeeping_resume(void) · line 783

Quoted 7 lines
kernel/time/timekeeping.c +1 -0
@@ -777,6 +777,7 @@ static void timekeeping_resume(void)
 	}
 	/* re-base the last cycle value */
 	tk->clock->cycle_last = tk->clock->read(tk->clock);
+	tk->cycle_last = tk->clock->cycle_last;
 	tk->ntp_error = 0;
 	timekeeping_suspended = 0;
 	timekeeping_update(tk, false, true);

Didn't tlgx fix a similar issue upstream already?

77c675ba18836.

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#12 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Sebastian Andrzej Siewior

Am Dienstag, 30. April 2013, 19:09:48 schrieb Sebastian Andrzej Siewior:

Quoted 82 lines · * Clark Williams | 2013-04-29 16:19:25 [-0500]:
Quoted 10 lines

On Mon, 29 Apr 2013 22:12:02 +0200

Quoted 3 lines · Sebastian Andrzej Siewior

- suspend / resume seems to program program the timer wrong and wait

ages until it continues.

It has to be something we're doing when we apply RT to v3.8.x, since v3.8.x suspends/resumes with no issues and I was able to suspend and resume fine with the 3.6-rt series.

I think I figured out what is going on or atleast I think I did.

This log snippet is from the resume path (from suspend to mem):

[   15.052115] Enabling non-boot CPUs ...
[   15.052115] smpboot: Booting Node 0 Processor 1 APIC 0x1
[   14.841378] Initializing CPU#1
[   42.840017] [sched_delayed] sched: RT throttling activated
[   42.842144] CPU1 is up
[   42.842536] smpboot: Booting Node 0 Processor 2 APIC 0x2

Two things happen here:
- the time goes backwards from 15.X to 14.X. This is okay because the 14.X is the timestamp from the secondary CPU not - yet synchronized with the bootcpu
- the printk with "CPU1 is up" is comming from the boot CPU and according to the timestamp about 28secs passed by. But this did not really happen as the whole procedure took less time.

The next thing that happens is that RCU assumes nobody is doing any progress (for almost 28secs) and triggers NMIs & printks to get some attention. I have a trace where
- CPU0: arch_trigger_all_cpu_backtrace_handler() => printk() has "lock" and is spinning for logbuf_lock

- CPU1: print_cpu_stall() => printk() (spinning for the lock) => NMI => arch_trigger_all_cpu_backtrace_handler()
it may have logbuf_lock and is spinning for "lock"

I can't tell if CPU1 got the logbuf_lock at this time but it seemed that it made no progress until I ended it.
This NMI releated deadlock is a problem which should also trigger mainline, right?

Now, the time jump on the other hand is the real issue here and is RT-only. It looks like we get a big number of timer updates via tick_do_update_jiffies64() because according to ktime_get() that much time really passed by.

The sollution seems as simple as

From c27eb2e0ab0b5acd96a4b62288976f1b72789b3e Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <[email protected]>
Date: Tue, 30 Apr 2013 18:53:55 +0200
Subject: [PATCH] time/timekeeping: shadow tk->cycle_last together with
clock->cycle_last

Commit ("timekeeping: Store cycle_last value in timekeeper struct as well") introduced a tk-> based cycle_last values which needs to be reset on resume path as well or else ktime_get() will think that time increased a lot.

---
 kernel/time/timekeeping.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/timekeeping.c +1 -0
index 99f943b..688817f 100644
@@ -777,6 +777,7 @@ static void timekeeping_resume(void)
 	}
 	/* re-base the last cycle value */
 	tk->clock->cycle_last = tk->clock->read(tk->clock);
+	tk->cycle_last = tk->clock->cycle_last;
 	tk->ntp_error = 0;
 	timekeeping_suspended = 0;
 	timekeeping_update(tk, false, true);
Quoted 4 lines
Quoted 1 line

Clark

Sebastian
--

This patch together with the in_nmi() patch solves the resume problem for me. Architecture X64, patched against 3.8.10-rt6.

THANKS!

Bernhard

#13 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Sebastian Andrzej Siewior

Am Dienstag, 30. April 2013, 19:09:48 schrieb Sebastian Andrzej Siewior:

Quoted 82 lines · * Clark Williams | 2013-04-29 16:19:25 [-0500]:
Quoted 10 lines

On Mon, 29 Apr 2013 22:12:02 +0200

Quoted 3 lines · Sebastian Andrzej Siewior

- suspend / resume seems to program program the timer wrong and wait

ages until it continues.

It has to be something we're doing when we apply RT to v3.8.x, since v3.8.x suspends/resumes with no issues and I was able to suspend and resume fine with the 3.6-rt series.

I think I figured out what is going on or atleast I think I did.

This log snippet is from the resume path (from suspend to mem):

[   15.052115] Enabling non-boot CPUs ...
[   15.052115] smpboot: Booting Node 0 Processor 1 APIC 0x1
[   14.841378] Initializing CPU#1
[   42.840017] [sched_delayed] sched: RT throttling activated
[   42.842144] CPU1 is up
[   42.842536] smpboot: Booting Node 0 Processor 2 APIC 0x2

Two things happen here:
- the time goes backwards from 15.X to 14.X. This is okay because the 14.X is the timestamp from the secondary CPU not - yet synchronized with the bootcpu
- the printk with "CPU1 is up" is comming from the boot CPU and according to the timestamp about 28secs passed by. But this did not really happen as the whole procedure took less time.

The next thing that happens is that RCU assumes nobody is doing any progress (for almost 28secs) and triggers NMIs & printks to get some attention. I have a trace where
- CPU0: arch_trigger_all_cpu_backtrace_handler() => printk() has "lock" and is spinning for logbuf_lock

- CPU1: print_cpu_stall() => printk() (spinning for the lock) => NMI => arch_trigger_all_cpu_backtrace_handler()
it may have logbuf_lock and is spinning for "lock"

I can't tell if CPU1 got the logbuf_lock at this time but it seemed that it made no progress until I ended it.
This NMI releated deadlock is a problem which should also trigger mainline, right?

Now, the time jump on the other hand is the real issue here and is RT-only. It looks like we get a big number of timer updates via tick_do_update_jiffies64() because according to ktime_get() that much time really passed by.

The sollution seems as simple as

From c27eb2e0ab0b5acd96a4b62288976f1b72789b3e Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <[email protected]>
Date: Tue, 30 Apr 2013 18:53:55 +0200
Subject: [PATCH] time/timekeeping: shadow tk->cycle_last together with
clock->cycle_last

Commit ("timekeeping: Store cycle_last value in timekeeper struct as well") introduced a tk-> based cycle_last values which needs to be reset on resume path as well or else ktime_get() will think that time increased a lot.

---
 kernel/time/timekeeping.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/timekeeping.c +1 -0
index 99f943b..688817f 100644
@@ -777,6 +777,7 @@ static void timekeeping_resume(void)
 	}
 	/* re-base the last cycle value */
 	tk->clock->cycle_last = tk->clock->read(tk->clock);
+	tk->cycle_last = tk->clock->cycle_last;
 	tk->ntp_error = 0;
 	timekeeping_suspended = 0;
 	timekeeping_update(tk, false, true);
Quoted 4 lines
Quoted 1 line

Clark

Sebastian
--

This patch together with the in_nmi() patch solves the resume problem for me. Architecture X64, patched against 3.8.10-rt6.

THANKS!

Bernhard

#18 lore raw
In reply to Sebastian Andrzej Siewior

Hello Sebastian,

It is mentioned below that SLxB is broken.
I assume it means bit SLUB and SLAB is broken?
Can you please share the error-details/logs/scenario/steps-to-reproduce.

Regards
Priyanka

Quoted 76 lines

-----Original Message-----
From: [email protected] [mailto:linux-rt-users- [email protected]] On Behalf Of Sebastian Andrzej Siewior
Sent: Tuesday, April 30, 2013 1:42 AM
To: linux-rt-users
Cc: LKML; Thomas Gleixner; [email protected]
Subject: [ANNOUNCE] 3.8.10-rt6

Dear RT Folks,

I'm pleased to announce the 3.8.10-rt6 release.

changes since v3.8.10-rt5:
- the i915 compiles again after I broke it in the last release. A patch was sent by Carsten Emde.

Known issues:

- SLxB is broken on PowerPC.
- suspend / resume seems to program program the timer wrong and wait ages until it continues.

The delta patch against v3.8.10-rt5 is appended below and can be found here:

https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/incr/patch-
3.8.10-rt5-rt6.patch.xz

The RT patch against 3.8.9 can be found here:

https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/patch-3.8.10-
rt6.patch.xz

The split quilt queue is available at:

https://www.kernel.org/pub/linux/kernel/projects/rt/3.8/patches-3.8.10-
rt6.tar.xz

Sebastian

drivers/gpu/drm/i915/i915_gem_execbuffer.c +1 -0
index 81125de..eabd3dd 100644
@@ -814,6 +814,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void
 *data,
 	struct intel_ring_buffer *ring;
 	u32 ctx_id = i915_execbuffer2_get_context_id(*args);
 	u32 exec_start, exec_len;
+	u32 seqno;
 	u32 mask;
 	u32 flags;
drivers/gpu/drm/i915/i915_gem_execbuffer.c +2 -1
 	int ret, mode, i;
@@ -1068,7 +1069,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void
 *data,
 			goto err;
 	}
 
-	trace_i915_gem_ring_dispatch(ring, intel_ring_get_seqno(ring),
 flags);
+	seqno = intel_ring_get_seqno(ring);
+	trace_i915_gem_ring_dispatch(ring, seqno, flags);
 	i915_trace_irq_get(ring, seqno);

i915_gem_execbuffer_move_to_active(&objects, ring); diff --git
a/localversion-rt b/localversion-rt index 0efe7ba..8fc605d 100644

localversion-rt +1 -2
@@ -1 +1 @@
--rt5
+-rt6
--

To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#19 lore raw
Quoted 1 line · * Jain Priyanka-B32167 | 2013-05-03 04:40:33 [+0000]:

Hello Sebastian,

Hello Jain,

Quoted 2 lines

It is mentioned below that SLxB is broken.
I assume it means bit SLUB and SLAB is broken?

Yes. It looks like that this is limited to Book-E / e500. I have here a MPC8572DS which shows this:

|[27173.423355] ------------[ cut here ]------------
|[27173.423360] kernel BUG at mm/slab.c:3227!
|[27173.423364] Oops: Exception in kernel mode, sig: 5 [#1]
|[27173.423367] PREEMPT SMP NR_CPUS=2 MPC8572 DS
|[27173.423370] NIP: 800b236c LR: 800b2290 CTR: 802bd168
|[27173.423373] REGS: ba557b90 TRAP: 0700   Not tainted  (3.8.9-rt4-dirty)
|[27173.423378] MSR: 00029000 <CE,EE,ME>  CR: 24002444  XER: 00000000
|[27173.423402] TASK = ba101290[31018] 'hackbench' THREAD: ba556000 CPU: 0
|[27173.423402] GPR00: 800b2bb8 ba557c40 ba101290 b7374200 000106d0 00000000 00000000 00000200
|[27173.423402] GPR08: 00000001 00000008 00000008 b7a0fc60 24002462 1001a810 00000000 803c0000
|[27173.423402] GPR16: 00000001 bf002490 bf002488 803c0000 00100100 00200200 bf002480 803c32f0
|[27173.423402] GPR24: 00000000 bf0024a4 000106d0 ba556000 bf000540 bf00f200 00000003 81eb5ae0
|[27173.423412] NIP [800b236c] cache_alloc_refill+0x16c/0x7e8
|[27173.423414] LR [800b2290] cache_alloc_refill+0x90/0x7e8
|[27173.423415] Call Trace:
|[27173.423422] [ba557c40] [802d0c54] rt_spin_lock_slowlock+0x58/0x288 (unreliable)
|[27173.423426] [ba557c90] [800b2bb8] __kmalloc+0x1d0/0x204
|[27173.423432] [ba557cc0] [80236ee4] __kmalloc_reserve+0x28/0x84
|[27173.423435] [ba557ce0] [80236fc4] __alloc_skb+0x84/0x18c
|[27173.423439] [ba557d20] [802338ec] sock_alloc_send_pskb+0x1d8/0x36c
|[27173.423444] [ba557d80] [802bd414] unix_stream_sendmsg+0x2ac/0x3ec
|[27173.423453] [ba557de0] [8022e4c4] sock_aio_write+0x110/0x148
|[27173.423458] [ba557e40] [800b7030] do_sync_write+0x94/0x108
|[27173.423462] [ba557ef0] [800b7204] vfs_write+0x160/0x170
|[27173.423465] [ba557f10] [800b7308] sys_write+0x4c/0xa8
|[27173.423471] [ba557f40] [8000d3c0] ret_from_syscall+0x0/0x3c
|[27173.423473] --- Exception: c01 at 0xffad0ec
|[27173.423473]     LR = 0x100011c8
|[27173.423474] Instruction dump:
|[27173.423480] 3de0803c 62940100 62b50200 3a560008 83f60000 7f16f800 419a019c 813f0010
|[27173.423486] 815c0018 7d0a4810 39000000 7d084114 <0f080000> 7f0a4840 40990084 3bdeffff
|[27173.604492] ---[ end trace 0000000000000002 ]---

after (according to the timestamp) 7:32 hours runtime. It run was running in one shell
| cyclictest -m -n -S -p 80 -d 0 -i 500
and the other
|while ((1)); do hackbench; done

This was done with SLAB, the backtrace is different with SLUB. I tried with one CPU but it is same thing.

I tried MPC5200b based board and it did not do anything stupid for over two days while doing exact the same thing.
The obvious difference is the different MMU implementation of those two. The other difference is ~400Mhz CPU vs 1.5Ghz.

Quoted 1 line

Can you please share the error-details/logs/scenario/steps-to-reproduce.

As I wrote above, cyclictest + hackbench. My MPC8572 boots from hard disk into a e500 based root file system (that means it uses its FPU for floating point instead SW-emulation).

Quoted 2 lines

Regards
Priyanka

Sebastian

#6 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Steven Rostedt
Quoted 5 lines · Steven Rostedt
Quoted 2 lines

This NMI releated deadlock is a problem which should also trigger mainline, right?

Well, yeah, as sending out a NMI stack dump is sorta the last resort, and is dangerous to do printks from NMI context.

So we did bad and we upgrade to bad and dangerous.

Quoted 9 lines
Quoted 5 lines

Now, the time jump on the other hand is the real issue here and is RT-only. It looks like we get a big number of timer updates via tick_do_update_jiffies64() because according to ktime_get() that much time really passed by.

As the NMI dump only happens because of the time jump, which as you said, is -rt only, I wouldn't say that the NMI deadlock is a mainline bug.

The reason for the NMI was a bug in the -RT tree but if something else triggers that NMI we have a good chance to deadlock.

What about a try_lock() and leave after 50 usecs of trying and not getting it in the in_nmi() case?

Quoted 1 line

-- Steve

Sebastian

#14 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Bernhard Schiffner
Quoted 2 lines · * Bernhard Schiffner | 2013-05-01 10:32:43 [+0200]:

This patch together with the in_nmi() patch solves the resume problem for me. Architecture X64, patched against 3.8.10-rt6.

You should be able to drop the in_nmi() patch have it still working.

Quoted 3 lines

THANKS!

Bernhard

Sebastian

#7 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Sebastian Andrzej Siewior
Quoted 7 lines · Sebastian Andrzej Siewior
Quoted 4 lines

As the NMI dump only happens because of the time jump, which as you said, is -rt only, I wouldn't say that the NMI deadlock is a mainline bug.

The reason for the NMI was a bug in the -RT tree but if something else triggers that NMI we have a good chance to deadlock.

But only if the NMI does a printk(). The only reason NMIs do printks is when a bug is detected. But usually oops_in_progress() is called and also zap_locks() is suppose to help prevent these problems. But that doesn't always work.

Quoted 3 lines

What about a try_lock() and leave after 50 usecs of trying and not getting it in the in_nmi() case?

I wouldn't try too hard to fix printks for NMIs. There's many things that can go wrong with NMIs doing a printk while another printk is active.

-- Steve

#15 lore raw

Re: Suspend resume problem (WAS Re: [ANNOUNCE] 3.8.10-rt6)

In reply to Sebastian Andrzej Siewior

Am Freitag, 3. Mai 2013, 12:27:03 schrieb Sebastian Andrzej Siewior:

Quoted 5 lines · * Bernhard Schiffner | 2013-05-01 10:32:43 [+0200]:
Quoted 2 lines

This patch together with the in_nmi() patch solves the resume problem for me. Architecture X64, patched against 3.8.10-rt6.

You should be able to drop the in_nmi() patch have it still working.

Confirmed.
(oops kernel is 3.8.11-rt6 now, but working)

Quoted 6 lines
Quoted 4 lines

THANKS!

Bernhard

Sebastian