From: Andrew Morton <akpm@osdl.org>
To: "Steinar H. Gunderson" <sgunderson@bigfoot.com>
Cc: neilb@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove softlockup from invalidate_mapping_pages.
Date: Wed, 26 Apr 2006 13:58:09 -0700 [thread overview]
Message-ID: <20060426135809.10a37ec3.akpm@osdl.org> (raw)
In-Reply-To: <20060426204809.GA15462@uio.no>
"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))
_
next prev parent reply other threads:[~2006-04-26 20:55 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060420160549.7637.patches@notabene>
2006-04-20 6:29 ` NeilBrown
2006-04-20 7:38 ` Andrew Morton
2006-04-20 9:24 ` Neil Brown
2006-04-20 9:30 ` Jens Axboe
2006-04-20 9:50 ` Neil Brown
2006-04-20 9:59 ` Jens Axboe
2006-04-20 10:26 ` Neil Brown
2006-04-20 9:52 ` Andrew Morton
2006-04-20 10:52 ` Jens Axboe
2006-04-26 20:48 ` Steinar H. Gunderson
2006-04-26 20:58 ` Andrew Morton [this message]
2006-04-26 21:26 ` Steinar H. Gunderson
2006-05-01 16:07 ` Steinar H. Gunderson
2006-05-13 13:49 ` [PATCH] Remove softlockup from invalidate_mapping_pages. (might be dm related) Steinar H. Gunderson
2006-05-13 14:33 ` Andrew Morton
2006-05-13 14:43 ` Steinar H. Gunderson
2006-05-13 14:51 ` Andrew Morton
2006-05-13 15:00 ` Steinar H. Gunderson
2006-05-13 15:24 ` Andrew Morton
2006-05-13 15:32 ` Steinar H. Gunderson
2006-05-13 15:43 ` Andrew Morton
2006-05-13 17:14 ` Steinar H. Gunderson
2006-05-13 23:28 ` Steinar H. Gunderson
2006-05-13 22:37 ` [dm-devel] " Alasdair G Kergon
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=20060426135809.10a37ec3.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
--cc=sgunderson@bigfoot.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
Powered by JetHome