lkml.org 
[lkml]   [2006]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Remove softlockup from invalidate_mapping_pages.
"Steinar H. Gunderson" <sgunderson@bigfoot.com> wrote:
>
> I tried this patch against 2.6.17-rc2 (I hoped that it might be fixing my
> kswapd oopses too, as they seem related; see
> http://lkml.org/lkml/2006/4/26/124 and followups), and it simply makes my
> machine hang on bootup -- it seems to make modprobe hang forever on some lock
> or something right after it loads raid6.ko (pulled in by evms_activate) in
> initramfs. Without the patch, the machine boots just fine.

It had a silly bug. Fixed version:


diff -puN mm/truncate.c~remove-softlockup-from-invalidate_mapping_pages mm/truncate.c
--- devel/mm/truncate.c~remove-softlockup-from-invalidate_mapping_pages 2006-04-21 19:45:11.000000000 -0700
+++ devel-akpm/mm/truncate.c 2006-04-21 19:46:14.000000000 -0700
@@ -230,14 +230,24 @@ unsigned long invalidate_mapping_pages(s
pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) {
for (i = 0; i < pagevec_count(&pvec); i++) {
struct page *page = pvec.pages[i];
+ pgoff_t index;
+ int lock_failed;

- if (TestSetPageLocked(page)) {
- next++;
- continue;
- }
- if (page->index > next)
- next = page->index;
+ lock_failed = TestSetPageLocked(page);
+
+ /*
+ * We really shouldn't be looking at the ->index of an
+ * unlocked page. But we're not allowed to lock these
+ * pages. So we rely upon nobody altering the ->index
+ * of this (pinned-by-us) page.
+ */
+ index = page->index;
+ if (index > next)
+ next = index;
next++;
+ if (lock_failed)
+ continue;
+
if (PageDirty(page) || PageWriteback(page))
goto unlock;
if (page_mapped(page))
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-26 22:58    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site