From: Jerome Glisse <jglisse@redhat.com>
To: Reza Arbab <arbab@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Balbir Singh <bsingharora@gmail.com>,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
Minchan Kim <minchan@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/migrate: Fix early increment of migrate->npages
Date: Mon, 2 Oct 2017 17:48:23 -0400 [thread overview]
Message-ID: <20171002214823.GB5184@redhat.com> (raw)
In-Reply-To: <1506980642-16541-1-git-send-email-arbab@linux.vnet.ibm.com>
On Mon, Oct 02, 2017 at 04:44:02PM -0500, Reza Arbab wrote:
> The intention here is to set the same array element in src and dst.
> Switch the order of these lines so that migrate->npages is only
> incremented after we've used it.
I already posted a fix for this today from Mark. Either version is
fine i think Andrew already pulled version i posted earlier.
>
> Fixes: 8315ada7f095 ("mm/migrate: allow migrate_vma() to alloc new page on empty entry")
> Cc: Jerome Glisse <jglisse@redhat.com>
> Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
> ---
> mm/migrate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index dea0ceb..c4546cc 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -2146,8 +2146,8 @@ static int migrate_vma_collect_hole(unsigned long start,
> unsigned long addr;
>
> for (addr = start & PAGE_MASK; addr < end; addr += PAGE_SIZE) {
> - migrate->src[migrate->npages++] = MIGRATE_PFN_MIGRATE;
> migrate->dst[migrate->npages] = 0;
> + migrate->src[migrate->npages++] = MIGRATE_PFN_MIGRATE;
> migrate->cpages++;
> }
>
> --
> 1.8.3.1
>
--
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>
prev parent reply other threads:[~2017-10-02 21:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 21:44 [PATCH] mm/migrate: Fix early increment of migrate->npages Reza Arbab
2017-10-02 21:48 ` Jerome Glisse [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=20171002214823.GB5184@redhat.com \
--to=jglisse@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arbab@linux.vnet.ibm.com \
--cc=bsingharora@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=n-horiguchi@ah.jp.nec.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;
as well as URLs for NNTP newsgroup(s).