linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Robin Holt <holt@sgi.com>, Andrew Morton <akpm@osdl.org>,
	Linus Torvalds <torvalds@osdl.org>, Ingo Molnar <mingo@elte.hu>,
	Roland McGrath <roland@redhat.com>,
	linux-mm@kvack.org, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2.6.13-rc4] fix get_user_pages bug
Date: Mon, 1 Aug 2005 21:03:25 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0508012045050.5373@goblin.wat.veritas.com> (raw)
In-Reply-To: <42EDDB82.1040900@yahoo.com.au>

On Mon, 1 Aug 2005, Nick Piggin wrote:
> 
> This was tested by Robin and appears to solve the problem. Roland
> had a quick look and thought the basic idea was sound. I'd like to
> get a couple more acks before going forward, and in particular
> Robin was contemplating possible efficiency improvements (although
> efficiency can wait on correctness).

I'd much prefer a solution that doesn't invade all the arches, but
I don't think Linus' pte_dirty method will work on s390 (unless we
change s390 in a less obvious way than your patch), so it looks
like we do need something like yours.

Comments:

There are currently 21 architectures,
but so far your patch only updates 14 of them?

Personally (rather like Robin) I'd have preferred a return code more
directed to the issue at hand, than your VM_FAULT_RACE.  Not for
efficiency reasons, I think you're right that's not a real issue,
but more to document the peculiar case we're addressing.  Perhaps a
code that says do_wp_page has gone all the way through, even though
it hasn't set the writable bit.

That would require less change in mm/memory.c, but I've no strong
reason to argue that you change your approach in that way.  Perhaps
others prefer the race case singled out, to gather statistics on that.
Assuming we stick with your VM_FAULT_RACE...

Could we define VM_FAULT_RACE as 3 rather than -2?  I think there's 
some historical reason why VM_FAULT_OOM is -1, but see no cause to
extend the range in that strange direction.

VM_FAULT_RACE is a particular subcase of VM_FAULT_MINOR: throughout
the arches I think they should just be adjacent cases of the switch
statement, both doing the min_flt++.

Your continue in get_user_pages skips page_table_lock as Linus noted.

The do_wp_page call from do_swap_page needs to be adjusted, to return
VM_FAULT_RACE if that's what it returned.

If VM_FAULT_RACE is really recording races, then the bottom return
value from handle_pte_fault ought to be VM_FAULT_RACE rather than
VM_FAULT_MINOR.

Hugh
--
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-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2005-08-01 20:03 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-30 20:53 get_user_pages() with write=1 and force=1 gets read-only pages Robin Holt
2005-07-30 22:13 ` Hugh Dickins
2005-07-31  1:52   ` Nick Piggin
2005-07-31 10:52     ` Robin Holt
2005-07-31 11:07       ` Nick Piggin
2005-07-31 11:30         ` Robin Holt
2005-07-31 11:39           ` Robin Holt
2005-07-31 12:09           ` Robin Holt
2005-07-31 22:27             ` Nick Piggin
2005-08-01  3:22               ` Roland McGrath
2005-08-01  8:21                 ` [patch 2.6.13-rc4] fix get_user_pages bug Nick Piggin
2005-08-01  9:19                   ` Ingo Molnar
2005-08-01  9:27                     ` Nick Piggin
2005-08-01 10:15                       ` Ingo Molnar
2005-08-01 10:57                         ` Nick Piggin
2005-08-01 19:43                           ` Hugh Dickins
2005-08-01 20:08                             ` Linus Torvalds
2005-08-01 21:06                               ` Hugh Dickins
2005-08-01 21:51                                 ` Linus Torvalds
2005-08-01 22:01                                   ` Linus Torvalds
2005-08-02 12:01                                     ` Martin Schwidefsky
2005-08-02 12:26                                       ` Hugh Dickins
2005-08-02 12:28                                         ` Nick Piggin
2005-08-02 15:19                                         ` Martin Schwidefsky
2005-08-02 15:30                                       ` Linus Torvalds
2005-08-02 16:03                                         ` Hugh Dickins
2005-08-02 16:25                                           ` Linus Torvalds
2005-08-02 17:02                                             ` Linus Torvalds
2005-08-02 17:27                                               ` Hugh Dickins
2005-08-02 17:21                                             ` Hugh Dickins
2005-08-02 18:47                                               ` Linus Torvalds
2005-08-02 19:20                                                 ` Hugh Dickins
2005-08-02 19:54                                                   ` Linus Torvalds
2005-08-02 20:55                                                     ` Hugh Dickins
2005-08-03 10:24                                                       ` Nick Piggin
2005-08-03 11:47                                                         ` Hugh Dickins
2005-08-03 12:13                                                           ` Nick Piggin
2005-08-03 16:12                                                         ` Linus Torvalds
2005-08-03 16:39                                                           ` Linus Torvalds
2005-08-03 16:42                                                             ` Linus Torvalds
2005-08-03 17:12                                                           ` Hugh Dickins
2005-08-03 23:03                                                           ` Nick Piggin
2005-08-04 14:14                                                           ` Alexander Nyberg
2005-08-04 14:30                                                             ` Nick Piggin
2005-08-04 15:00                                                               ` Alexander Nyberg
2005-08-04 15:35                                                                 ` Hugh Dickins
2005-08-04 16:32                                                                   ` Russell King
2005-08-04 15:36                                                                 ` Linus Torvalds
2005-08-04 16:29                                                               ` Russell King
2005-08-03 10:24                                                       ` Martin Schwidefsky
2005-08-03 11:57                                                         ` Hugh Dickins
2005-08-02 16:44                                         ` Martin Schwidefsky
2005-08-01 15:42                   ` Linus Torvalds
2005-08-01 18:18                     ` Linus Torvalds
2005-08-03  8:24                       ` Robin Holt
2005-08-03 11:31                         ` Hugh Dickins
2005-08-04 11:48                           ` Robin Holt
2005-08-04 13:04                             ` Hugh Dickins
2005-08-01 19:29                     ` Hugh Dickins
2005-08-01 19:48                       ` Linus Torvalds
2005-08-02  8:07                         ` Martin Schwidefsky
2005-08-01 19:57                       ` Andrew Morton
2005-08-01 20:16                         ` Linus Torvalds
2005-08-02  0:14                     ` Nick Piggin
2005-08-02  1:27                     ` Nick Piggin
2005-08-02  3:45                       ` Linus Torvalds
2005-08-02  4:25                         ` Nick Piggin
2005-08-02  4:35                           ` Linus Torvalds
2005-08-01 20:03                   ` Hugh Dickins [this message]
2005-08-01 20:12                     ` Andrew Morton
2005-08-01 20:26                       ` Linus Torvalds
2005-08-01 20:51                       ` Hugh Dickins
2005-08-02 14:02 Dan Higgins

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.61.0508012045050.5373@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@osdl.org \
    --cc=holt@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=roland@redhat.com \
    --cc=torvalds@osdl.org \
    /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