linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Yeoh <cyeoh@au1.ibm.com>
To: Valdis.Kletnieks@vt.edu
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] Cross Memory Attach
Date: Thu, 16 Sep 2010 11:47:43 +0930	[thread overview]
Message-ID: <20100916114743.5dcd228d@lilo> (raw)
In-Reply-To: <10951.1284566831@localhost>

On Wed, 15 Sep 2010 12:07:11 -0400
Valdis.Kletnieks@vt.edu wrote:
> 
> Interesting, and nice benchmark results.  I have a question though:
> 
> > +	/* Get the pages we're interested in */
> > +	pages_pinned = get_user_pages(task, task->mm, pa,
> > +				      nr_pages_to_copy,
> > +				      copy_to, 0, process_pages,
> > NULL); +
> > +	if (pages_pinned != nr_pages_to_copy)
> > +		goto end;
> 
> ...
> 
> > +end:
> > +	for (i = 0; i < pages_pinned; i++) {
> > +		if (copy_to)
> > +			set_page_dirty_lock(process_pages[i]);
> > +		put_page(process_pages[i]);
> > +	}
> 
> It looks to me like if get_user_pages() fails to pin *all* the pages,
> we treat the target pages as dirty even though we never actually
> touched them?
> 
> Maybe it should be 'if (copy_to && *bytes_copied)'?

Yes that can happen, though the *bytes_copied check doesn't completely
fix it as copy_from_user could fail resulting in some pages being
touched, but not all of them.  I'll add some code to only call
set_page_dirty_lock on pages that really have been touched...

Regards,

Chris
-- 
cyeoh@au.ibm.com

      reply	other threads:[~2010-09-16  2:17 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15  1:18 [RFC][PATCH] Cross Memory Attach Christopher Yeoh
2010-09-15  8:02 ` Ingo Molnar
2010-09-15  8:16   ` Ingo Molnar
2010-09-15 13:23     ` Christopher Yeoh
2010-09-15 13:20   ` Christopher Yeoh
2010-09-15 10:58 ` Avi Kivity
2010-09-15 13:51   ` Ingo Molnar
2010-09-15 16:10     ` Avi Kivity
2010-09-15 14:42   ` Christopher Yeoh
2010-09-15 14:52     ` Linus Torvalds
2010-09-15 15:44       ` Robin Holt
2010-09-16  6:32     ` Brice Goglin
2010-09-16  9:15       ` Brice Goglin
2010-09-16 14:00         ` Christopher Yeoh
2010-09-15 14:46   ` Bryan Donlan
2010-09-15 16:13     ` Avi Kivity
2010-09-15 19:35       ` Eric W. Biederman
2010-09-16  1:18     ` Christopher Yeoh
2010-09-16  9:26       ` Avi Kivity
2010-11-02  3:37         ` Christopher Yeoh
2010-11-02 11:10           ` Avi Kivity
2010-09-16  1:58     ` KOSAKI Motohiro
2010-09-16  8:08       ` Ingo Molnar
2010-09-15 15:11 ` Linus Torvalds
2010-09-15 15:14   ` Linus Torvalds
2010-09-16  2:25     ` Christopher Yeoh
2010-09-16 16:27   ` Peter Zijlstra
2010-09-16 16:54     ` Linus Torvalds
2010-09-16 17:13       ` Peter Zijlstra
2010-09-16 17:34         ` Linus Torvalds
2010-09-16 17:47           ` Peter Zijlstra
2010-09-16 17:54             ` Linus Torvalds
2010-09-16 18:00               ` Linus Torvalds
2010-09-19  4:44                 ` Yuhong Bao
2010-09-19 19:20               ` Yuhong Bao
2010-09-19 21:48                 ` Russell King - ARM Linux
2010-09-19 22:47                   ` Yuhong Bao
2010-09-19  4:55           ` Yuhong Bao
2010-09-15 16:07 ` Valdis.Kletnieks
2010-09-16  2:17   ` Christopher Yeoh [this message]

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=20100916114743.5dcd228d@lilo \
    --to=cyeoh@au1.ibm.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).