public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jakub W. Jozwicki" <jozwicki@aster.pl>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@timesys.com
Subject: Re: [PATCH 2.6.25.10 1/2] libata: fix locking for kmap_atomic
Date: Sun, 13 Jul 2008 20:53:29 +0200	[thread overview]
Message-ID: <200807132053.30849.jozwicki@aster.pl> (raw)
In-Reply-To: <487A3F75.5010405@goop.org>

Sunday, 13 of July 2008 19:46:29 Jeremy Fitzhardinge napisał(a):
> Jakub W. Jozwicki wrote:
> > Sorry, this was for -rt only.
> >
> > [   17.012011] BUG: sleeping function called from invalid context
> > IRQ-14(5732) at arch/x86/mm/highmem_32.c:8
> > [   17.012011] in_atomic():0 [00000000], irqs_disabled():1
> > [   17.012011] Pid: 5732, comm: IRQ-14 Not tainted 2.6.25.10-rtXXX #11
> > [   17.012011]  [<c0120fc4>] __might_sleep+0xf1/0xf8
> > [   17.012011]  [<c011c035>] kmap+0x47/0x5a
>
> The subject says kmap_atomic, but this is kmap.  It definitely makes no
> sense to call kmap in an IRQ, regardless of the locking.  There seems to
> be a larger structural problem here.
>

--- linux-2.6.25.8-rt7.orig/include/asm-x86/highmem.h   2008-06-23 
19:12:47.000000000 -0400
+++ linux-2.6.25.8-rt7/include/asm-x86/highmem.h        2008-06-23 
19:13:58.000000000 -0400


+/*
+ * on PREEMPT_RT kmap_atomic() is a wrapper that uses kmap():
+ */
+#ifdef CONFIG_PREEMPT_RT
+# define kmap_atomic_prot(page, type, prot)    ({ pagefault_disable(); 
kmap(page); })
+# define kmap_atomic(page, type)       ({ pagefault_disable(); kmap(page); })
+# define kmap_atomic_pfn(pfn, type)    kmap(pfn_to_page(pfn))
+# define kunmap_atomic(kvaddr, type)   do { pagefault_enable(); 
kunmap_virt(kvaddr); } while(0)
+# define kmap_atomic_to_page(kvaddr)   kmap_to_page(kvaddr)
+#else
+# define kmap_atomic_prot(page, type, prot)    __kmap_atomic_prot(page, type, 
prot)
+# define kmap_atomic(page, type)       __kmap_atomic(page, type)
+# define kmap_atomic_pfn(pfn, type)    __kmap_atomic_pfn(pfn, type)
+# define kunmap_atomic(kvaddr, type)   __kunmap_atomic(kvaddr, type)
+# define kmap_atomic_to_page(kvaddr)   __kmap_atomic_to_page(kvaddr)
+#endif
+

  reply	other threads:[~2008-07-13 18:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-12 23:27 [PATCH 2.6.25.10 1/2] libata: fix locking for kmap_atomic Jakub W. Jozwicki
2008-07-13  8:26 ` Andrew Morton
2008-07-13 13:17   ` Jakub W. Jozwicki
2008-07-13 17:46     ` Jeremy Fitzhardinge
2008-07-13 18:53       ` Jakub W. Jozwicki [this message]
2008-07-13 21:32         ` Jeremy Fitzhardinge
2008-07-13 10:25 ` Alan Cox
2008-07-13 13:30   ` Jakub W. Jozwicki
2008-07-13 14:15     ` Alan Cox

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=200807132053.30849.jozwicki@aster.pl \
    --to=jozwicki@aster.pl \
    --cc=akpm@linux-foundation.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@timesys.com \
    /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