[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200629185434.GI25523@casper.infradead.org>
Date: Mon, 29 Jun 2020 19:54:34 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Mike Kravetz <mike.kravetz@...cle.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Michal Hocko <mhocko@...nel.org>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>, stable@...nel.org
Subject: Re: [PATCH] hugetlb: fix pages per hugetlb calculation
On Mon, Jun 29, 2020 at 11:50:03AM -0700, Mike Kravetz wrote:
> The routine hpage_nr_pages() was incorrectly used to calculate the
> number of base pages in a hugetlb page. hpage_nr_pages is designed
> to be called for THP pages and will return HPAGE_PMD_NR for hugetlb
> pages of any size.
>
> Due to the context in which hpage_nr_pages was called, it is unlikely
> to produce a user visible error. The routine with the incorrect call
> is only exercised in the case of hugetlb memory error or migration.
> In addition, this would need to be on an architecture which supports
> huge page sizes less than PMD_SIZE. And, the vma containing the huge
> page would also need to smaller than PMD_SIZE.
>
> Fixes: c0d0381ade79 ("hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization")
> Cc: stable@...nel.org
> Signed-off-by: Mike Kravetz <mike.kravetz@...cle.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Inadvertently-Reported-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Powered by blists - more mailing lists