From: Robin Holt <holt@sgi.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Robin Holt <holt@sgi.com>, Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jack Steiner <steiner@sgi.com>,
linux-mm@kvack.org
Subject: Re: [RFP-V2 0/3] Make mmu_notifier_invalidate_range_start able to sleep.
Date: Tue, 2 Feb 2010 07:51:41 -0600 [thread overview]
Message-ID: <20100202135141.GH6616@sgi.com> (raw)
In-Reply-To: <20100202134047.GJ4135@random.random>
On Tue, Feb 02, 2010 at 02:40:47PM +0100, Andrea Arcangeli wrote:
> On Tue, Feb 02, 2010 at 07:29:20AM -0600, Robin Holt wrote:
> > The atomic==1 case is only for the truncate case, correct? XPMEM is
>
> Correct.
>
> > holding reference counts on the pages it exports (get_user_pages) so
> > they are not freed even when the zap_page_range has completed. What I
> > think we are dealing with is an inconsistent appearance to userland.
> > The one task would SIG_BUS if it touches the memory. The other would
> > be able to read/write it just fine until the ascynchronous zap of the
> > attachment completed.
>
> Ok, thanks to the page pin it won't randomly corrupt memory, but it
> can still screw the runtime of an unmodified unaware program. I think
> you've to figure out how important it is that you won't deadlock if
> luser modifies userland because this isn't a complete approach and as
> much as I care about your workload that is ok with this, I cannot
> exclude it might materialize an usage in the future where sigbus while
> other thread still access the remote pages is not ok and may screw
> userland in a more subtle way than a visible kernel deadlock. Now we
> can do this now and undo it later, nothing very problematic, but
> considering this isn't a full transparent solution, I don't see the
> big deal in just scheduling in atomic if user does what it can't do
> (there will be unexpected behavior to his app anyway if he does that).
I am sorry. I slipped implementations. I had worked late into the
evening on an alternative to this patch which did not require the unlock
of the i_mmap_lock, _inv_range_start, lock, return -EINTR. That approach
would have had the caveats as above.
The approach we are discussing here does not have any difference in
userland behavior. When called with atomic==1, XPMEM will detect that
we have exported pages in that address range and return !0 indicating we
need to sleep to satisfy this call. The i_mmap_lock would be released
and _inv_range_start would be called again with atomic==0. This time, the
pages would be cleared from the attachments, the unmap_mapping_range_vma
would then retry. Hopefully the call this time with atomic==1 would
return 0 indicating it did not need to sleep.
> I don't see a problem in applying srcu and the tlb gather patch in
> distro kernels, those won't even prevent the upstream modules to build
> against those kernels and there will be no change of API. In general
> making the methods sleepable doesn't need to alter the API at
> all... reason of this change of API is because we're not actually
> making them sleepable but only a few.
I don't see the change in API with this method either.
Robin
--
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>
next prev parent reply other threads:[~2010-02-02 13:51 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100202040145.555474000@alcatraz.americas.sgi.com>
2010-02-02 4:01 ` [RFP-V2 1/3] Have mmu_notifiers use SRCU so they may safely schedule Robin Holt
2010-02-02 4:01 ` [RFP-V2 2/3] Fix unmap_vma() bug related to mmu_notifiers Robin Holt
2010-02-02 4:01 ` [RFP-V2 3/3] Make mmu_notifier_invalidate_range_start able to sleep Robin Holt
2010-02-02 8:09 ` [RFP-V2 0/3] " Christoph Hellwig
2010-02-02 12:59 ` Andrea Arcangeli
2010-02-02 13:13 ` Andrea Arcangeli
2010-02-02 13:29 ` Robin Holt
2010-02-02 13:40 ` Andrea Arcangeli
2010-02-02 13:51 ` Robin Holt [this message]
2010-02-02 14:10 ` Andrea Arcangeli
2010-02-02 14:21 ` Robin Holt
2010-02-02 14:59 ` Andrea Arcangeli
2010-02-02 15:21 ` Robin Holt
2010-02-02 16:01 ` Andrea Arcangeli
2010-02-02 16:39 ` Robin Holt
2010-02-02 16:52 ` Andrea Arcangeli
2010-02-02 16:59 ` Robin Holt
2010-02-02 17:31 ` Robin Holt
2010-02-02 20:27 ` Andrea Arcangeli
2010-02-02 20:17 ` Andrea Arcangeli
2010-02-03 0:48 ` Robin Holt
2010-02-03 17:14 ` Andrea Arcangeli
2010-02-03 17:18 ` Andrea Arcangeli
2010-02-03 19:54 ` Robin Holt
2010-02-02 13:23 ` Robin Holt
2010-02-02 13:35 ` Robin Holt
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=20100202135141.GH6616@sgi.com \
--to=holt@sgi.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-mm@kvack.org \
--cc=steiner@sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.