linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Muchun Song <muchun.song@linux.dev>
To: Donet Tom <donettom@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kselftest@vger.kernel.org,
	Aneesh Kumar <aneesh.kumar@linux.ibm.com>,
	Linux-MM <linux-mm@kvack.org>,
	linuxppc-dev@lists.ozlabs.org,
	LKML <linux-kernel@vger.kernel.org>,
	Geetika Moolchandani <geetika@linux.ibm.com>
Subject: Re: [PATCH 1/1] selftests: mm: hugepage-vmemmap fails on 64K page size systems.
Date: Thu, 11 Jan 2024 10:07:58 +0800	[thread overview]
Message-ID: <C3CE35A3-7663-4B8E-9E85-8F0C3CD7D9EC@linux.dev> (raw)
In-Reply-To: <20240110075351.f4b6f43e31629ddcb96503cc@linux-foundation.org>



> On Jan 10, 2024, at 23:53, Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> (cc Muchun)
> On Wed, 10 Jan 2024 14:03:35 +0530 Donet Tom <donettom@linux.vnet.ibm.com> wrote:
> 
>> The kernel sefltest mm/hugepage-vmemmap fails on architectures
>> which has different page size other than 4K. In hugepage-vmemmap
>> page size used is 4k so the pfn calculation will go wrong on systems
>> which has different page size .The length of MAP_HUGETLB memory must
>> be hugepage aligned but in hugepage-vmemmap map length is 2M so this
>> will not get aligned if the system has differnet hugepage size.
>> 
>> Added  psize() to get the page size and default_huge_page_size() to
>> get the default hugepage size at run time, hugepage-vmemmap test pass
>> on powerpc with 64K page size and x86 with 4K page size.
>> 
>> Result on powerpc without patch (page size 64K)
>> *# ./hugepage-vmemmap
>> Returned address is 0x7effff000000 whose pfn is 0
>> Head page flags (100000000) is invalid
>> check_page_flags: Invalid argument
>> *#
>> 
>> Result on powerpc with patch (page size 64K)
>> *# ./hugepage-vmemmap
>> Returned address is 0x7effff000000 whose pfn is 600
>> *#
>> 
>> Result on x86 with patch (page size 4K)
>> *# ./hugepage-vmemmap
>> Returned address is 0x7fc7c2c00000 whose pfn is 1dac00
>> *#
>> 
>> Signed-off-by: Donet Tom <donettom@linux.vnet.ibm.com>
>> Reported-by : Geetika Moolchandani (geetika@linux.ibm.com)
>> Tested-by : Geetika Moolchandani (geetika@linux.ibm.com)

Acked-by: Muchun Song <muchun.song@linux.dev>

> 
> I'll add 
> 
> Fixes: b147c89cd429 ("selftests: vm: add a hugetlb test case")
> Cc: <stable@vger.kernel.org>

Yes. It should be a real bug fix.

Thanks.



      parent reply	other threads:[~2024-01-11  2:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10  8:33 Donet Tom
     [not found] ` <20240110075351.f4b6f43e31629ddcb96503cc@linux-foundation.org>
2024-01-11  2:07   ` Muchun Song [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=C3CE35A3-7663-4B8E-9E85-8F0C3CD7D9EC@linux.dev \
    --to=muchun.song@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=donettom@linux.vnet.ibm.com \
    --cc=geetika@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.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