All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang\, Ying" <ying.huang@intel.com>
To: Dave Hansen <dave.hansen@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>, <yang.shi@linux.alibaba.com>,
	<rientjes@google.com>, <dan.j.williams@intel.com>
Subject: Re: [RFC][PATCH 4/9] mm/migrate: make migrate_pages() return nr_succeeded
Date: Thu, 17 Sep 2020 09:25:27 +0800	[thread overview]
Message-ID: <87lfh9ry7s.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <20200818184129.14758DAD@viggo.jf.intel.com> (Dave Hansen's message of "Tue, 18 Aug 2020 11:41:29 -0700")

Dave Hansen <dave.hansen@linux.intel.com> writes:

> diff -puN mm/migrate.c~migrate_pages-add-success-return mm/migrate.c
> --- a/mm/migrate.c~migrate_pages-add-success-return	2020-08-18 11:36:51.284583183 -0700
> +++ b/mm/migrate.c	2020-08-18 11:36:51.295583183 -0700
> @@ -1432,6 +1432,7 @@ out:
>   * @mode:		The migration mode that specifies the constraints for
>   *			page migration, if any.
>   * @reason:		The reason for page migration.
> + * @nr_succeeded:	The number of pages migrated successfully.
>   *
>   * The function returns after 10 attempts or if no pages are movable any more
>   * because the list has become empty or no retryable pages exist any more.
> @@ -1442,11 +1443,10 @@ out:
>   */
>  int migrate_pages(struct list_head *from, new_page_t get_new_page,
>  		free_page_t put_new_page, unsigned long private,
> -		enum migrate_mode mode, int reason)
> +		enum migrate_mode mode, int reason, unsigned int *nr_succeeded)
>  {
>  	int retry = 1;
>  	int nr_failed = 0;
> -	int nr_succeeded = 0;
>  	int pass = 0;
>  	struct page *page;
>  	struct page *page2;
> @@ -1500,7 +1500,7 @@ retry:
>  				retry++;
>  				break;
>  			case MIGRATEPAGE_SUCCESS:
> -				nr_succeeded++;
> +				(*nr_succeeded)++;

I think now we should consider THP in counting now.  Because later
nr_succeeded will be used to counting the number of reclaimed pages,
and THP is respected for that.

Best Regards,
Huang, Ying

>  				break;
>  			default:
>  				/*
> @@ -1517,11 +1517,11 @@ retry:
>  	nr_failed += retry;
>  	rc = nr_failed;
>  out:
> -	if (nr_succeeded)
> -		count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded);
> +	if (*nr_succeeded)
> +		count_vm_events(PGMIGRATE_SUCCESS, *nr_succeeded);
>  	if (nr_failed)
>  		count_vm_events(PGMIGRATE_FAIL, nr_failed);
> -	trace_mm_migrate_pages(nr_succeeded, nr_failed, mode, reason);
> +	trace_mm_migrate_pages(*nr_succeeded, nr_failed, mode, reason);
>  
>  	if (!swapwrite)
>  		current->flags &= ~PF_SWAPWRITE;

  reply	other threads:[~2020-09-17  1:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 18:41 [RFC][PATCH 0/9] [v3] Migrate Pages in lieu of discard Dave Hansen
2020-08-18 18:41 ` [RFC][PATCH 1/9] mm/numa: node demotion data structure and lookup Dave Hansen
2020-08-18 18:41 ` [RFC][PATCH 2/9] mm/numa: automatically generate node migration order Dave Hansen
2020-08-20 21:57   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 3/9] mm/migrate: update migration order during on hotplug events Dave Hansen
2020-08-20 22:07   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 4/9] mm/migrate: make migrate_pages() return nr_succeeded Dave Hansen
2020-09-17  1:25   ` Huang, Ying [this message]
2020-08-18 18:41 ` [RFC][PATCH 5/9] mm/migrate: demote pages during reclaim Dave Hansen
2020-08-20  8:06   ` Huang, Ying
2020-08-20 15:21     ` Dave Hansen
2020-08-20 16:26       ` Yang Shi
2020-08-21  0:57         ` Huang, Ying
2020-08-21 16:17           ` Yang Shi
2020-08-20 22:42   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 6/9] mm/vmscan: add page demotion counter Dave Hansen
2020-08-20 22:26   ` Yang Shi
2020-08-20 23:58     ` Yang Shi
2020-08-20 22:56   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 7/9] mm/vmscan: Consider anonymous pages without swap Dave Hansen
2020-08-18 18:41 ` [RFC][PATCH 8/9] mm/vmscan: never demote for memcg reclaim Dave Hansen
2020-08-20 22:50   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 9/9] mm/migrate: new zone_reclaim_mode to enable reclaim migration Dave Hansen
2020-08-20  0:47 ` [RFC][PATCH 0/9] [v3] Migrate Pages in lieu of discard Yang Shi
2020-08-24 22:36 ` Keith Busch
  -- strict thread matches above, loose matches on Subject: below --
2020-10-07 16:17 [RFC][PATCH 0/9] [v4][RESEND] " Dave Hansen
2020-10-07 16:17 ` [RFC][PATCH 4/9] mm/migrate: make migrate_pages() return nr_succeeded Dave Hansen
2020-10-07 16:17   ` Dave Hansen

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=87lfh9ry7s.fsf@yhuang-dev.intel.com \
    --to=ying.huang@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=yang.shi@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.