From: Andrea Arcangeli <andrea@suse.de>
To: "Juan J. Quintela" <quintela@fi.udc.es>
Cc: linux-mm@kvack.org, linux-kernel@vger.rutgers.edu,
trond.myklebust@fys.uio.no
Subject: Re: classzone-VM + mapped pages out of lru_cache
Date: Thu, 4 May 2000 17:19:03 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.21.0005041702560.2512-100000@alpha.random> (raw)
In-Reply-To: <yttu2gel6p3.fsf@vexeta.dc.fi.udc.es>
On 4 May 2000, Juan J. Quintela wrote:
>suited to the memory of my system (Uniprocessor 96MB)
Do you have also an SMP to try it out too? On IA32-SMP and alpha-SMP I
definitely can't reproduce the pico lockup reported to me a few hours ago.
>The results are very good for your patch:
>
>Vanilla pre7-3 pre7-3+classzone-18
>real 3m29.926s real 2m10.210s
>user 0m15.280s real 2m10.210s
>sys 0m20.500s real 2m10.210s
;)
>That is the description of the situation. Andrea, why do you reverse
>the patch of filemap.c:truncate_inode_pages() of using TryLockPage()?
Because it's not necessary as far I can tell. Only one
truncate_inode_pages() can run at once and none read or write can run
under truncate_inode_pages(). This should be enforced by the VFS, and if
that doesn't happen the truncate_inode_pages changes that gone into pre6
(and following) hides the real bug.
>That change was proposed by Rik due to an Oops that I get here. It
Can I see the Oops?
>was one of the non-easily reproducible ones that I get.
Maybe you can try to write/read under a truncate or something like
that. I've not yet checked if there are still races in the VFS between
read/write/truncate.
BTW, maybe if you was using NFS you got in troubles with
invalidate_inode_pages. New invalidate_inode_pages in classzone patch
won't race with the old truncate_inode_page. Also without classzone-VM-18
invalidate_inode_pages can crash the kerne because _nobody_ can unlink a
mapped page-cache from the cache without first clearing the pte (and
flushing the page to disk if the pte happened to be dirty). So if
invalidate_inode_pages() runs under an inode map-shared in memory you'll
get a lockup as soon as you try to sync the page to disk. I didn't tried
to reproduce but I only read the code. However if I am right about this
reproducing should be easy. You have to MAP_SHARED on the client a file,
touch the shared mapping so that some pte become dirty, now overwrite the
file on the server and then push the client low on memory so that swap_out
will try to unmap the page -> crash. This is a security issue also for
2.2.x, fix is in classzone-VM-18 where I don't unmap the page if the page
count is > 1 (so if the page have no chance to be mapped). Effect of the
fix is that you can't MAP_SHARED and change the file from more than one
client or you have to expect inchoerency between the cache copies.
This untested patch should fix the problem also in 2.2.15 (the same way I
fixed it in classzone patch):
--- 2.2.15/mm/filemap.c Thu May 4 13:00:40 2000
+++ /tmp/filemap.c Thu May 4 17:11:18 2000
@@ -68,7 +68,7 @@
p = &inode->i_pages;
while ((page = *p) != NULL) {
- if (PageLocked(page)) {
+ if (PageLocked(page) || atomic_read(&page->count) > 1) {
p = &page->next;
continue;
}
Trond, what do you think about it?
Andrea
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
next prev parent reply other threads:[~2000-05-04 15:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-03 16:26 Andrea Arcangeli
2000-05-04 0:42 ` David S. Miller
2000-05-04 10:00 ` Andrea Arcangeli
2000-05-04 14:40 ` Juan J. Quintela
2000-05-04 15:19 ` Andrea Arcangeli [this message]
2000-05-04 15:23 ` Andrea Arcangeli
2000-05-04 15:38 ` Rik van Riel
2000-05-04 17:59 ` Andrea Arcangeli
2000-05-04 19:24 ` Rik van Riel
2000-05-04 16:34 ` Manfred Spraul, Andrea Arcangeli
2000-05-04 16:48 ` Trond Myklebust
2000-05-04 18:43 ` Andrea Arcangeli
2000-05-04 19:32 ` Trond Myklebust
2000-05-04 20:15 ` Andrea Arcangeli
2000-05-05 7:01 ` Trond Myklebust
2000-05-04 16:34 ` Juan J. Quintela
2000-05-04 18:27 ` Chris Evans
[not found] <3911ECCD.BA1BB24E@arcormail.de>
2000-05-04 23:44 ` Andrea Arcangeli
2000-05-05 0:03 ` Jens Axboe
2000-05-05 3:04 ` David S. Miller
2000-05-05 8:43 ` Russell King
2000-05-05 14:56 ` Andrea Arcangeli
2000-05-06 13:37 ` Andrea Arcangeli
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=Pine.LNX.4.21.0005041702560.2512-100000@alpha.random \
--to=andrea@suse.de \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=quintela@fi.udc.es \
--cc=trond.myklebust@fys.uio.no \
/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