Re: [RFC][PATCH] Cross Memory Attach

From: Valdis . Kletnieks
Date: Wed Sep 15 2010 - 12:07:27 EST


On Wed, 15 Sep 2010 10:48:55 +0930, Christopher Yeoh said:

> The basic idea behind cross memory attach is to allow MPI programs doing
> intra-node communication to do a single copy of the message rather than
> a double copy of the message via shared memory.

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)'?

Attachment: pgp00000.pgp
Description: PGP signature