linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Zi Yan <ziy@nvidia.com>,  Yang Shi <shy828301@gmail.com>,
	 Baolin Wang <baolin.wang@linux.alibaba.com>,
	Oscar Salvador <osalvador@suse.de>
Subject: Re: [RFC 2/2] migrate: convert migrate_pages() to use folios
Date: Wed, 02 Nov 2022 10:10:37 +0800	[thread overview]
Message-ID: <8735b2cdia.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <Y2EY9zK0phgfQYE1@casper.infradead.org> (Matthew Wilcox's message of "Tue, 1 Nov 2022 13:02:47 +0000")

Matthew Wilcox <willy@infradead.org> writes:

> On Tue, Nov 01, 2022 at 02:21:37PM +0800, Huang Ying wrote:
>> -			is_thp = PageTransHuge(page) && !PageHuge(page);
>> -			nr_subpages = compound_nr(page);
>> +			is_large = folio_test_large(folio) && !PageHuge(&folio->page);
>
> We have folio_test_hugetlb() to replace PageHuge().

Thanks!  Will change this in the next version.

>>  	count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded);
>>  	count_vm_events(PGMIGRATE_FAIL, nr_failed_pages);
>> -	count_vm_events(THP_MIGRATION_SUCCESS, nr_thp_succeeded);
>> -	count_vm_events(THP_MIGRATION_FAIL, nr_thp_failed);
>> -	count_vm_events(THP_MIGRATION_SPLIT, nr_thp_split);
>> -	trace_mm_migrate_pages(nr_succeeded, nr_failed_pages, nr_thp_succeeded,
>> -			       nr_thp_failed, nr_thp_split, mode, reason);
>> +	count_vm_events(THP_MIGRATION_SUCCESS, nr_large_succeeded);
>> +	count_vm_events(THP_MIGRATION_FAIL, nr_large_failed);
>> +	count_vm_events(THP_MIGRATION_SPLIT, nr_split);
>> +	trace_mm_migrate_pages(nr_succeeded, nr_failed_pages, nr_large_succeeded,
>> +			       nr_large_failed, nr_split, mode, reason);
>
> I think this is the biggest question with this patch -- how (or whether)
> to account folios in size between PMD and PTE size.  Since it's
> _called_ THP, I've tended to make the statistics conditional on
> folio_test_pmd_mappable() rather than simply being folio_test_large().

Yes.  This is my biggest concern during development too.  In the next
version, I will distinguish THP and other large folios (between PMD and
PTE size) and do statistics accordingly.

Best Regards,
Huang, Ying


      reply	other threads:[~2022-11-02  2:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01  6:21 [RFC 0/2] migrate: convert migrate_pages()/unmap_and_move() " Huang Ying
2022-11-01  6:21 ` [RFC 1/2] migrate: convert unmap_and_move() " Huang Ying
2022-11-01 14:54   ` Zi Yan
2022-11-02  2:11     ` Huang, Ying
2022-11-01  6:21 ` [RFC 2/2] migrate: convert migrate_pages() " Huang Ying
2022-11-01 13:02   ` Matthew Wilcox
2022-11-02  2:10     ` Huang, Ying [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=8735b2cdia.fsf@yhuang6-desk2.ccr.corp.intel.com \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=shy828301@gmail.com \
    --cc=willy@infradead.org \
    --cc=ziy@nvidia.com \
    /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