linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: wonder_rock@126.com
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Deyan Wang <wonder_rock@126.com>
Subject: [PATCH 1/1] mm/page_alloc: merge two get_pfnblock_migratetype() into one
Date: Wed, 23 Nov 2022 21:40:43 +0800	[thread overview]
Message-ID: <20221123134043.33896-1-wonder_rock@126.com> (raw)

From: Deyan Wang <wonder_rock@126.com>

It is safe to get_pfnblock_migratetype() in critical section,
so just call get_pfnblock_migratetype() once.

Signed-off-by: Deyan Wang <wonder_rock@126.com>
---
 mm/page_alloc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6652df1f5cc8..c7ba9d65d1c0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1704,13 +1704,8 @@ static void __free_pages_ok(struct page *page, unsigned int order,
 	if (!free_pages_prepare(page, order, true, fpi_flags))
 		return;
 
-	migratetype = get_pfnblock_migratetype(page, pfn);
-
 	spin_lock_irqsave(&zone->lock, flags);
-	if (unlikely(has_isolate_pageblock(zone) ||
-		is_migrate_isolate(migratetype))) {
-		migratetype = get_pfnblock_migratetype(page, pfn);
-	}
+	migratetype = get_pfnblock_migratetype(page, pfn);
 	__free_one_page(page, pfn, zone, order, migratetype, fpi_flags);
 	spin_unlock_irqrestore(&zone->lock, flags);
 
-- 
2.25.1



             reply	other threads:[~2022-11-23 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 13:40 wonder_rock [this message]
2022-11-23 15:45 ` Matthew Wilcox

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=20221123134043.33896-1-wonder_rock@126.com \
    --to=wonder_rock@126.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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