From: Michal Hocko <mhocko@kernel.org>
To: Zi Yan <zi.yan@cs.rutgers.edu>
Cc: "Huang, Ying" <ying.huang@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Minchan Kim <minchan@kernel.org>, Shaohua Li <shli@kernel.org>,
jglisse@redhat.com,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [PATCH -mm] mm, madvise, THP: Use THP aligned address in madvise_free_huge_pmd()
Date: Thu, 15 Mar 2018 13:29:44 +0100 [thread overview]
Message-ID: <20180315122944.GH23100@dhcp22.suse.cz> (raw)
In-Reply-To: <869F4AAA-5BBA-40D6-916F-6919E515D271@cs.rutgers.edu>
On Wed 14-03-18 21:39:54, Zi Yan wrote:
> This cannot happen.
>
> Two address parameters are passed: addr and next.
> If a??addra?? is not aligned and a??nexta?? is aligned or the end of madvise range, which might not be aligned,
> either way next - addr < HPAGE_PMD_SIZE.
>
> This means the code in a??if (next - addr != HPAGE_PMD_SIZE)a??, which is above your second hunk,
> will split the THP between a??addra?? and a??nexta?? and get out as long as a??addra?? is not aligned.
> Thus, the code in your second hunk should always get aligned a??addra??.
OK, so what would happen if the above doesn't hold anymore after some
change up the call chain? Is it critical? If yes, do we want VM_BUG_ON
to detect that? Or at least document the asumption?
--
Michal Hocko
SUSE Labs
prev parent reply other threads:[~2018-03-15 12:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 1:18 Huang, Ying
2018-03-15 1:39 ` Zi Yan
2018-03-15 1:47 ` Huang, Ying
2018-03-15 12:29 ` Michal Hocko [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=20180315122944.GH23100@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=jglisse@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=shli@kernel.org \
--cc=ying.huang@intel.com \
--cc=zi.yan@cs.rutgers.edu \
/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