[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZLgnbMet0jgxbak/@casper.infradead.org>
Date: Wed, 19 Jul 2023 19:11:56 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Sidhartha Kumar <sidhartha.kumar@...cle.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, songmuchun@...edance.com,
mike.kravetz@...cle.com
Subject: Re: [PATCH] mm/hugetlb: get rid of page_hstate()
On Wed, Jul 19, 2023 at 10:59:44AM -0700, Sidhartha Kumar wrote:
> - skip_pages = compound_nr(head) - (page - head);
> + skip_pages = folio_nr_pages(folio) - (page - &folio->page);
It turns out that you can't do (page - head) under all configs. It
works on all common ones, but the safe way to do what you want here is:
skip_pages = folio_nr_pages(folio) -
folio_page_idx(folio, page);
Powered by blists - more mailing lists