From: Andrea Arcangeli <andrea@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kiobuf/rawio fixes for 2.4.0-test10-pre6
Date: Tue, 31 Oct 2000 03:08:38 +0100 [thread overview]
Message-ID: <20001031030838.A30461@athlon.random> (raw)
In-Reply-To: <20001027222143.A8059@caldera.de> <200010272123.OAA21478@penguin.transmeta.com> <20001030124513.A28667@caldera.de>
In-Reply-To: <20001030124513.A28667@caldera.de>; from hch@caldera.de on Mon, Oct 30, 2000 at 12:45:13PM +0100
On Mon, Oct 30, 2000 at 12:45:13PM +0100, Christoph Hellwig wrote:
> @@ -393,10 +396,15 @@
> pmd = pmd_offset(pgd, address);
> if (pmd) {
> pte_t * pte = pte_offset(pmd, address);
> - if (pte && pte_present(*pte))
> + if (pte && pte_present(*pte)) {
> + if (writeacc && !pte_write(*pte))
> + goto retry;
> return pte_page(*pte);
> + }
> }
It should also make sure the pte is dirty before starting the read-from-disk
I/O and then things will currently break in the swapout because the page is not
locked (see discussion of last week). The fix for that problem proposed by SCT
and Linus is that the page (not pte) will be marked dirty during swapout and
written back to disk _only_ once reference count is 1 (btw I now noticed
invalidate_inode_pages+MAP_SHARED will mess with that fix and it will trigger a
BUG() in free_pages).
> +
> +faultin:
> if (handle_mm_fault(current->mm, vma, ptr, datain) <= 0)
> goto out_unlock;
> spin_lock(&mm->page_table_lock);
> - map = follow_page(ptr);
> - if (!map) {
> + map = follow_page(ptr, datain, &failed);
> + if (failed) {
> + /*
> + * Page got stolen before we could lock it down.
> + * Retry.
> + */
> spin_unlock(&mm->page_table_lock);
> - dprintk (KERN_ERR "Missing page in map_user_kiobuf\n");
> - goto out_unlock;
> + goto faultin;
This is suboptimal (walks the pagetables twice if the page is just mapped). It
should be a follow page first and handle_mm_fault only if follow page failed.
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-10-31 2:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-27 20:21 [PATCH] kiobuf/rawio fixes for 2.4.0-test10-pre6 Christoph Hellwig
[not found] ` <200010272123.OAA21478@penguin.transmeta.com>
2000-10-30 11:45 ` Christoph Hellwig
2000-10-30 17:19 ` Jeff Garzik
2000-10-30 18:17 ` Christoph Hellwig
2000-10-30 18:56 ` Jeff Garzik
2000-10-30 19:44 ` Christoph Hellwig
2000-10-30 20:08 ` Jeff Garzik
2000-10-30 20:32 ` Christoph Hellwig
2000-10-30 21:51 ` Jeff Garzik
2000-11-01 13:32 ` Stephen C. Tweedie
2000-10-31 2:08 ` Andrea Arcangeli [this message]
2000-11-01 11:16 ` Christoph Hellwig
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=20001031030838.A30461@athlon.random \
--to=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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