Re: [PATCH 2/6] mm: memory_hotplug: use more folio in do_migrate_range()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 27, 2024 at 10:45:42AM -0400, Zi Yan wrote:
> >  	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
> > -		struct folio *folio;
> > +		struct page *page, *head;
> 
> You could get rid of head too. It is only used to calculate next pfn,
> so pfn = folio_to_pfn(folio) + folio_nr_pages(folio) - 1 would work.
> 
> And the PageHuge(page) and PageTransHuge(page) can be simplified, since
> their pfn calculations are the same. Something like:
> 
> if (folio_test_large(folio)) {
> 	pfn = folio_to_pfn(folio) + folio_nr_pages(folio) - 1;
> 	if (folio_test_hugetlb(folio)) {
> 		isolate_hugetlb(folio, &source);
> 		continue;
> 	}
> }

How much of this is safe without a refcount on the folio?






[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux