linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Miaohe Lin <linmiaohe@huawei.com>, akpm@linux-foundation.org
Cc: jglisse@redhat.com, shy828301@gmail.com, aquini@redhat.com,
	apopple@nvidia.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH v3 1/5] mm/migrate.c: make putback_movable_page() static
Date: Thu, 25 Mar 2021 14:17:15 +0100	[thread overview]
Message-ID: <f1fbfe7e-74ac-e60c-b984-ab4c03445d07@redhat.com> (raw)
In-Reply-To: <20210325131524.48181-2-linmiaohe@huawei.com>

On 25.03.21 14:15, Miaohe Lin wrote:
> The putback_movable_page() is just called by putback_movable_pages() and
> we know the page is locked and both PageMovable() and PageIsolated() is
> checked right before calling putback_movable_page(). So we make it static
> and remove all the 3 VM_BUG_ON_PAGE().
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>   include/linux/migrate.h | 1 -
>   mm/migrate.c            | 7 +------
>   2 files changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/include/linux/migrate.h b/include/linux/migrate.h
> index fdf65f23acec..1d8095069b1c 100644
> --- a/include/linux/migrate.h
> +++ b/include/linux/migrate.h
> @@ -44,7 +44,6 @@ extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
>   		unsigned long private, enum migrate_mode mode, int reason);
>   extern struct page *alloc_migration_target(struct page *page, unsigned long private);
>   extern int isolate_movable_page(struct page *page, isolate_mode_t mode);
> -extern void putback_movable_page(struct page *page);
>   
>   extern void migrate_prep(void);
>   extern void migrate_prep_local(void);
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 47df0df8f21a..61e7f848b554 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -140,15 +140,10 @@ int isolate_movable_page(struct page *page, isolate_mode_t mode)
>   	return -EBUSY;
>   }
>   
> -/* It should be called on page which is PG_movable */
> -void putback_movable_page(struct page *page)
> +static void putback_movable_page(struct page *page)
>   {
>   	struct address_space *mapping;
>   
> -	VM_BUG_ON_PAGE(!PageLocked(page), page);
> -	VM_BUG_ON_PAGE(!PageMovable(page), page);
> -	VM_BUG_ON_PAGE(!PageIsolated(page), page);
> -
>   	mapping = page_mapping(page);
>   	mapping->a_ops->putback_page(page);
>   	__ClearPageIsolated(page);
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2021-03-25 13:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 13:15 [PATCH v3 0/5] Cleanup and fixup for mm/migrate.c Miaohe Lin
2021-03-25 13:15 ` [PATCH v3 1/5] mm/migrate.c: make putback_movable_page() static Miaohe Lin
2021-03-25 13:17   ` David Hildenbrand [this message]
2021-03-25 17:41   ` Yang Shi
2021-03-25 13:15 ` [PATCH v3 2/5] mm/migrate.c: remove unnecessary rc != MIGRATEPAGE_SUCCESS check in 'else' case Miaohe Lin
2021-03-25 13:15 ` [PATCH v3 3/5] mm/migrate.c: fix potential indeterminate pte entry in migrate_vma_insert_page() Miaohe Lin
2021-03-25 13:26   ` David Hildenbrand
2021-03-25 13:15 ` [PATCH v3 4/5] mm/migrate.c: use helper migrate_vma_collect_skip() in migrate_vma_collect_hole() Miaohe Lin
2021-03-25 13:15 ` [PATCH v3 5/5] Revert "mm: migrate: skip shared exec THP for NUMA balancing" Miaohe Lin

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=f1fbfe7e-74ac-e60c-b984-ab4c03445d07@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=aquini@redhat.com \
    --cc=jglisse@redhat.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shy828301@gmail.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