All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] fix xenfb_update_screen bogus rect
@ 2009-01-27  2:58 Akio Takebe
  2009-01-27  8:16 ` Jan Beulich
  0 siblings, 1 reply; 14+ messages in thread
From: Akio Takebe @ 2009-01-27  2:58 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1324 bytes --]

Hi,

When I tested pvfb, I got the following warnings.
It seems to be caused by checking/setting info->dirty without dirty_lock.
We need to check/set info->dirty safely.

xenfb_update_screen bogus rect 2147483647 0 2147483647 0
 BUG: warning at /root/linux-2.6.18-xen.hg/drivers/xen/fbfront/xenfb.c:240/xenfb_update_screen()

 Call Trace:
  [<ffffffff8036920e>] xenfb_thread+0x19b/0x2be
  [<ffffffff8022730a>] try_to_wake_up+0x33b/0x34c
  [<ffffffff80225c3d>] __wake_up_common+0x3e/0x68
  [<ffffffff80241e20>] autoremove_wake_function+0x0/0x2e
  [<ffffffff80241a75>] keventd_create_kthread+0x0/0x61
  [<ffffffff80369073>] xenfb_thread+0x0/0x2be
  [<ffffffff80241a75>] keventd_create_kthread+0x0/0x61
  [<ffffffff80241ceb>] kthread+0xd4/0x109
  [<ffffffff8020afe0>] child_rip+0xa/0x12
  [<ffffffff80241a75>] keventd_create_kthread+0x0/0x61
  [<ffffffff8021477f>] xen_send_IPI_mask+0x0/0xf5
  [<ffffffff80241c17>] kthread+0x0/0x109
  [<ffffffff8020afd6>] child_rip+0x0/0x12


FYI, when I tested it, I used the following shell scripts on PV guest.
The above warnings occurred in /var/log/messages.
=======================
#!/bin/bash

while true
do
    date
done
=======================

The attached patch fixed this warnings.
How about it?

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

Best Regards,

Akio Takebe

[-- Attachment #2: fix_pvfb_dirty_lock.patch --]
[-- Type: text/x-diff, Size: 1152 bytes --]

diff -r 83b71f4b5cb2 drivers/xen/fbfront/xenfb.c
--- a/drivers/xen/fbfront/xenfb.c	Tue Jan 20 13:28:35 2009 +0000
+++ b/drivers/xen/fbfront/xenfb.c	Tue Jan 27 20:09:58 2009 +0900
@@ -255,19 +255,36 @@
 	}
 	spin_unlock_irqrestore(&info->resize_lock, flags);
 }
+static int check_is_dirty(struct xenfb_info *info)
+{
+	int is_dirty;
+	unsigned long flags;
+	spin_lock_irqsave(&info->dirty_lock, flags);
+	is_dirty = info->dirty;
+	spin_unlock_irqrestore(&info->dirty_lock, flags);
+
+	return is_dirty;
+}
 
 static int xenfb_thread(void *data)
 {
 	struct xenfb_info *info = data;
+	unsigned long flags;
+	int is_dirty;
 
 	while (!kthread_should_stop()) {
 		xenfb_handle_resize_dpy(info);
-		if (info->dirty) {
+		spin_lock_irqsave(&info->dirty_lock, flags);
+		is_dirty = info->dirty;
+		if (is_dirty) {
 			info->dirty = 0;
+			spin_unlock_irqrestore(&info->dirty_lock, flags);
 			xenfb_update_screen(info);
+		} else {
+			spin_unlock_irqrestore(&info->dirty_lock, flags);
 		}
 		wait_event_interruptible(info->wq,
-			kthread_should_stop() || info->dirty);
+			kthread_should_stop() || check_is_dirty(info));
 		try_to_freeze();
 	}
 	return 0;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-02-02 23:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-27  2:58 [Patch] fix xenfb_update_screen bogus rect Akio Takebe
2009-01-27  8:16 ` Jan Beulich
2009-01-28  7:31   ` Akio Takebe
2009-01-28  9:06     ` Jan Beulich
2009-01-28 14:33       ` Markus Armbruster
2009-01-29  9:12         ` Akio Takebe
2009-01-29 14:29           ` Markus Armbruster
2009-01-28 14:31     ` Markus Armbruster
2009-01-29 12:54       ` Akio Takebe
2009-01-29 14:44         ` Markus Armbruster
2009-01-30  2:02           ` Akio Takebe
2009-01-30  7:38             ` Markus Armbruster
2009-02-02  9:17     ` [PATCH] fbfront: Improve diagnostics when kthread_run() fails Markus Armbruster
2009-02-02 23:48       ` [PATCH] fbfront: Improve diagnostics when kthread_run()fails Akio Takebe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.