From: Michal Hocko <mhocko@kernel.org>
To: Yang Shi <yang.shi@linux.alibaba.com>
Cc: kirill.shutemov@linux.intel.com, hughd@google.com,
hch@infradead.org, viro@zeniv.linux.org.uk,
akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC v2 PATCH] mm: shmem: make stat.st_blksize return huge page size if THP is on
Date: Tue, 24 Apr 2018 06:43:12 -0600 [thread overview]
Message-ID: <20180424124312.GZ17484@dhcp22.suse.cz> (raw)
In-Reply-To: <aa4b8c48-781a-204c-246a-afa5a54dba99@linux.alibaba.com>
On Mon 23-04-18 21:41:50, Yang Shi wrote:
>
>
> On 4/23/18 9:04 AM, Michal Hocko wrote:
> > On Sun 22-04-18 21:28:59, Yang Shi wrote:
> > >
> > > On 4/22/18 6:47 PM, Michal Hocko wrote:
> > [...]
> > > > will be used on the first aligned address even when the initial/last
> > > > portion of the mapping is not THP aligned.
> > > No, my test shows it is not. And, transhuge_vma_suitable() does check the
> > > virtual address alignment. If it is not huge page size aligned, it will not
> > > set PMD for huge page.
> > It's been quite some time since I've looked at that code but I think you
> > are wrong. It just doesn't make sense to make the THP decision on the
> > VMA alignment much. Kirill, can you clarify please?
>
> Thanks a lot Michal and Kirill to elaborate how tmpfs THP make pmd map.
>
> I did a quick test, THP will be PMD mapped as long as :
> * hint address is huge page aligned if MAP_FIXED
> Or
> * offset is huge page aligned
> And
> * The size is big enough (>= huge page size)
>
> This test does verify what Kirill said. And, I dig into a little further
> qemu code and did strace, qemu does try to mmap the file to non huge page
> aligned address with MAP_FIXED.
Does it make sense to contact Qemu developers and probably fix this?
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2018-04-24 12:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-20 16:33 [RFC v2 PATCH] mm: shmem: make stat.st_blksize return huge page size if THP is on Yang Shi
2018-04-23 0:47 ` Michal Hocko
2018-04-23 3:28 ` Yang Shi
2018-04-23 15:04 ` Michal Hocko
2018-04-23 16:19 ` Yang Shi
2018-04-24 3:41 ` Yang Shi
2018-04-24 12:43 ` Michal Hocko [this message]
2018-04-24 13:08 ` Yang Shi
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=20180424124312.GZ17484@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=hughd@google.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=viro@zeniv.linux.org.uk \
--cc=yang.shi@linux.alibaba.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).