linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: Denis Kirjanov <kda@linux-powerpc.org>
Cc: linuxppc-dev@ozlabs.org, aneesh.kumar@linux.vnet.ibm.com
Subject: Re: [PATCH V2] selfttest/powerpc: Add memory page migration tests
Date: Mon, 25 Jan 2016 16:40:07 +0530	[thread overview]
Message-ID: <56A6028F.4010504@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAOJe8K2L5JKzQpt2tV6Z_72NatKBfvH3b1J2Orm+NM6NK23snA@mail.gmail.com>

On 11/24/2015 01:42 PM, Denis Kirjanov wrote:
> On 11/24/15, Anshuman Khandual <khandual@linux.vnet.ibm.com> wrote:
>> This adds two tests for memory page migration. One for normal page
>> migration which works for both 4K or 64K base page size kernel and
>> the other one is for 16MB huge page migration which will work both
>> 4K or 64K base page sized 16MB huge pages as and when we support
>> huge page migration.
>>
>> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>


>> +
>> +static unsigned long get_npages(unsigned long length, unsigned long size)
>> +{
>> +	unsigned int tmp1 = length, tmp2 = size;
> I think we want unsigned long here but this is very minor nit

Its been some time now, remember using some tricks to get the
division right. Now that Aneesh's new PTE changes are merged,
will try the Hugetlb migration again and enable the self tests
for them.

>> +
>> +int test_migration(unsigned long length)
>> +{
>> +	unsigned long failed;
>> +	void *addr;
>> +	int ret;
>> +
>> +	addr = mmap(MMAP_ADDR, length, MMAP_PROT, MMAP_FLAGS, -1, 0);
>> +	if (addr == MAP_FAILED) {
>> +		perror("mmap() failed");
>> +		exit(-1);
>> +	}
>> +
>> +	write_buffer(addr, length);
>> +	soft_offline_pages(HPAGE_OFF, addr, length/getpagesize(), &failed);
> You've defined get_npages() so I assume it has to be used or not used at all

>> +	npages = get_npages(length, PAGE_SIZE_HUGE);

Its used here.

      reply	other threads:[~2016-01-25 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24  5:58 [PATCH V2] selfttest/powerpc: Add memory page migration tests Anshuman Khandual
2015-11-24  8:12 ` Denis Kirjanov
2016-01-25 11:10   ` Anshuman Khandual [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=56A6028F.4010504@linux.vnet.ibm.com \
    --to=khandual@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=kda@linux-powerpc.org \
    --cc=linuxppc-dev@ozlabs.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).