[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180315122944.GH23100@dhcp22.suse.cz>
Date: Thu, 15 Mar 2018 13:29:44 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Zi Yan <zi.yan@...rutgers.edu>
Cc: "Huang, Ying" <ying.huang@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Minchan Kim <minchan@...nel.org>, Shaohua Li <shli@...nel.org>,
jglisse@...hat.com,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: Re: [PATCH -mm] mm, madvise, THP: Use THP aligned address in
madvise_free_huge_pmd()
On Wed 14-03-18 21:39:54, Zi Yan wrote:
> This cannot happen.
>
> Two address parameters are passed: addr and next.
> If “addr” is not aligned and “next” 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 “if (next - addr != HPAGE_PMD_SIZE)”, which is above your second hunk,
> will split the THP between “addr” and “next” and get out as long as “addr“ is not aligned.
> Thus, the code in your second hunk should always get aligned “addr”.
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
Powered by blists - more mailing lists