From: Andrew Morton <akpm@zip.com.au>
To: Mark J Roberts <mjr@znex.org>
Cc: linux-kernel@vger.kernel.org,
Linux Frame Buffer Device Development
<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: Framebuffer, mmap(), hanging in D state, root FS unmount failure.
Date: Fri, 28 Dec 2001 16:23:47 -0800 [thread overview]
Message-ID: <3C2D0D13.CB1C5683@zip.com.au> (raw)
In-Reply-To: <20011227195037.GA229@znex>
Mark J Roberts wrote:
>
> #include <assert.h>
> #include <sys/mman.h>
> #include <fcntl.h>
> int main(void)
> {
> char *p;
> assert((p = mmap(0, 1, PROT_READ|PROT_WRITE, MAP_SHARED, open("/dev/fb/0", O_RDWR), 0)) != MAP_FAILED);
> p[4096] = 0; /* this hangs */
> return 0;
> }
>
> When I run this on my 2.4.17rc2aa2 kernel with a Voodoo3000
> framebuffer, the process hangs forever in D state. ps and top will
> then hang the same way when they read the /proc/pid files for the
> hung process. And my root filesystem won't unmount.
>
OK, the framebuffer driver is failing to mark the mmapped vma as
VM_IO, so the kernel is trying to dump the framebuffer device
to the core file, takes a recursive fault and deadlocks.
Simplest possible fix is to mark the framebuffer as not dumpable
for x86.
--- linux-2.4.18-pre1/drivers/video/fbmem.c Fri Dec 21 11:19:14 2001
+++ linux-akpm/drivers/video/fbmem.c Fri Dec 28 16:18:05 2001
@@ -600,6 +600,7 @@ fb_mmap(struct file *file, struct vm_are
#elif defined(__alpha__)
/* Caching is off in the I/O space quadrant by design. */
#elif defined(__i386__) || defined(__x86_64__)
+ vma->vm_flags |= VM_IO;
if (boot_cpu_data.x86 > 3)
pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
#elif defined(__mips__)
However I don't see why _any_ architecture wants framebuffer contents
to be included in core files. It sounds risky.
So the setting of VM_IO could be simply hoisted outside the forest
of ifdefs. Comments, anyone?
-
next prev parent reply other threads:[~2001-12-29 0:27 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-27 19:50 Framebuffer, mmap(), hanging in D state, root FS unmount failure Mark J Roberts
2001-12-29 0:23 ` Andrew Morton [this message]
2001-12-30 8:34 ` [patch] " Andrew Morton
2001-12-30 21:13 ` [patch] Re: Framebuffer...Why oh Why??? Timothy Covell
[not found] ` <3C2F8727.5D4AAE21@zip.com.au>
2001-12-30 22:27 ` Timothy Covell
2001-12-31 1:51 ` James Simmons
2001-12-31 2:49 ` Andrew Morton
2001-12-31 3:23 ` James Simmons
2001-12-31 12:07 ` Geert Uytterhoeven
2001-12-31 13:18 ` Alan Cox
2001-12-31 21:53 ` Oliver Xymoron
2001-12-31 0:19 ` Linus Torvalds
2001-12-31 1:54 ` [Linux-fbdev-devel] " James Simmons
2001-12-31 8:03 ` gmack
2001-12-31 9:05 ` Benjamin Herrenschmidt
2001-12-31 21:41 ` Rob Landley
2002-01-01 7:00 ` Werner Puschitz
2002-01-03 22:26 ` Marco Ermini
2002-01-04 13:27 ` [OT] " Tommi Kyntola
2002-01-04 14:04 ` Marco Ermini
2002-01-01 7:00 ` Timothy Covell
2002-01-01 10:42 ` Alan Cox
2002-01-01 20:36 ` Rob Landley
2002-01-02 11:36 ` Daniel Phillips
2002-01-01 14:31 ` Marius Gedminas
2001-12-31 21:42 ` Scott McDermott
2001-12-31 21:56 ` Arnaldo Carvalho de Melo
2001-12-31 22:26 ` James Simmons
2001-12-31 22:31 ` Arnaldo Carvalho de Melo
2002-01-01 2:43 ` Bill Nottingham
2002-01-01 6:15 ` Arnaldo Carvalho de Melo
2002-01-01 18:42 ` Joachim Steiger
2002-01-01 10:21 ` Alan Cox
2002-01-01 0:23 ` Ken Moffat
2002-01-01 7:03 ` Timothy Covell
2001-12-31 12:10 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C2D0D13.CB1C5683@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mjr@znex.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox