From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id CDDA41A001D for ; Mon, 25 Jan 2016 22:11:03 +1100 (AEDT) Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A1546140321 for ; Mon, 25 Jan 2016 22:11:02 +1100 (AEDT) Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 25 Jan 2016 21:11:02 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 59D232CE8054 for ; Mon, 25 Jan 2016 22:10:57 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0PBAd8X35520560 for ; Mon, 25 Jan 2016 22:10:47 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0PBAOVU015452 for ; Mon, 25 Jan 2016 22:10:24 +1100 Message-ID: <56A6028F.4010504@linux.vnet.ibm.com> Date: Mon, 25 Jan 2016 16:40:07 +0530 From: Anshuman Khandual MIME-Version: 1.0 To: Denis Kirjanov CC: linuxppc-dev@ozlabs.org, aneesh.kumar@linux.vnet.ibm.com Subject: Re: [PATCH V2] selfttest/powerpc: Add memory page migration tests References: <1448344702-14033-1-git-send-email-khandual@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 11/24/2015 01:42 PM, Denis Kirjanov wrote: > On 11/24/15, Anshuman Khandual 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 >> + >> +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.