mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm/vmscan: Use folio_migratetype() instead of get_pageblock_migratetype()
@ 2023-08-25  4:08 Vern Hao
  2023-08-25  7:12 ` David Hildenbrand
  0 siblings, 1 reply; 6+ messages in thread
From: Vern Hao @ 2023-08-25  4:08 UTC (permalink / raw)
  To: akpm; +Cc: zhaoyang.huang, david, linux-mm, linux-kernel, haoxing990, Vern Hao

From: Vern Hao <vernhao@tencent.com>

In skip_cma(), we can use folio_migratetype() to replace get_pageblock_migratetype().

Fixes: 5da226dbfce3 ("mm: skip CMA pages when they are not available")
Signed-off-by: Vern Hao <vernhao@tencent.com>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 42e3893de2a7..d9e974b96144 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2271,7 +2271,7 @@ static bool skip_cma(struct folio *folio, struct scan_control *sc)
 {
 	return !current_is_kswapd() &&
 			gfp_migratetype(sc->gfp_mask) != MIGRATE_MOVABLE &&
-			get_pageblock_migratetype(&folio->page) == MIGRATE_CMA;
+			folio_migratetype(folio) == MIGRATE_CMA;
 }
 #else
 static bool skip_cma(struct folio *folio, struct scan_control *sc)
-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/vmscan: Use folio_migratetype() instead of get_pageblock_migratetype()
  2023-08-25  4:08 [PATCH] mm/vmscan: Use folio_migratetype() instead of get_pageblock_migratetype() Vern Hao
@ 2023-08-25  7:12 ` David Hildenbrand
  2023-08-25  7:31   ` Vern Hao
  0 siblings, 1 reply; 6+ messages in thread
From: David Hildenbrand @ 2023-08-25  7:12 UTC (permalink / raw)
  To: Vern Hao, akpm; +Cc: zhaoyang.huang, linux-mm, linux-kernel, Vern Hao

On 25.08.23 06:08, Vern Hao wrote:
> From: Vern Hao <vernhao@tencent.com>
> 
> In skip_cma(), we can use folio_migratetype() to replace get_pageblock_migratetype().
> 
> Fixes: 5da226dbfce3 ("mm: skip CMA pages when they are not available")

Why did you think "Fixes" was a good idea?

-- 
Cheers,

David / dhildenb


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/vmscan: Use folio_migratetype() instead of get_pageblock_migratetype()
  2023-08-25  7:12 ` David Hildenbrand
@ 2023-08-25  7:31   ` Vern Hao
  2023-08-25  7:34     ` David Hildenbrand
  0 siblings, 1 reply; 6+ messages in thread
From: Vern Hao @ 2023-08-25  7:31 UTC (permalink / raw)
  To: David Hildenbrand, akpm; +Cc: zhaoyang.huang, linux-mm, linux-kernel, Vern Hao


在 2023/8/25 15:12, David Hildenbrand 写道:
> On 25.08.23 06:08, Vern Hao wrote:
>> From: Vern Hao <vernhao@tencent.com>
>>
>> In skip_cma(), we can use folio_migratetype() to replace 
>> get_pageblock_migratetype().
>>
>> Fixes: 5da226dbfce3 ("mm: skip CMA pages when they are not available")
>
> Why did you think "Fixes" was a good idea?
>
The skip_cma() contains the folio argument, and the folio_migratetype()  
is already implemented in the kernel, so I think it's fine to keep it 
consistent.


Thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/vmscan: Use folio_migratetype() instead of get_pageblock_migratetype()
  2023-08-25  7:31   ` Vern Hao
@ 2023-08-25  7:34     ` David Hildenbrand
  2023-08-25  7:36       ` Vern Hao
  0 siblings, 1 reply; 6+ messages in thread
From: David Hildenbrand @ 2023-08-25  7:34 UTC (permalink / raw)
  To: Vern Hao, akpm; +Cc: zhaoyang.huang, linux-mm, linux-kernel, Vern Hao

On 25.08.23 09:31, Vern Hao wrote:
> 
> 在 2023/8/25 15:12, David Hildenbrand 写道:
>> On 25.08.23 06:08, Vern Hao wrote:
>>> From: Vern Hao <vernhao@tencent.com>
>>>
>>> In skip_cma(), we can use folio_migratetype() to replace
>>> get_pageblock_migratetype().
>>>
>>> Fixes: 5da226dbfce3 ("mm: skip CMA pages when they are not available")
>>
>> Why did you think "Fixes" was a good idea?
>>
> The skip_cma() contains the folio argument, and the folio_migratetype()
> is already implemented in the kernel, so I think it's fine to keep it
> consistent.

If this doesn't actually *fix a bug*, then please don't add fixes and 
confuse people looking for actual bugfixes.

See Documentation/process/submitting-patches.rst

-- 
Cheers,

David / dhildenb


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/vmscan: Use folio_migratetype() instead of get_pageblock_migratetype()
  2023-08-25  7:34     ` David Hildenbrand
@ 2023-08-25  7:36       ` Vern Hao
  2023-08-25  7:37         ` David Hildenbrand
  0 siblings, 1 reply; 6+ messages in thread
From: Vern Hao @ 2023-08-25  7:36 UTC (permalink / raw)
  To: David Hildenbrand, akpm; +Cc: zhaoyang.huang, linux-mm, linux-kernel, Vern Hao


在 2023/8/25 15:34, David Hildenbrand 写道:
> On 25.08.23 09:31, Vern Hao wrote:
>>
>> 在 2023/8/25 15:12, David Hildenbrand 写道:
>>> On 25.08.23 06:08, Vern Hao wrote:
>>>> From: Vern Hao <vernhao@tencent.com>
>>>>
>>>> In skip_cma(), we can use folio_migratetype() to replace
>>>> get_pageblock_migratetype().
>>>>
>>>> Fixes: 5da226dbfce3 ("mm: skip CMA pages when they are not available")
>>>
>>> Why did you think "Fixes" was a good idea?
>>>
>> The skip_cma() contains the folio argument, and the folio_migratetype()
>> is already implemented in the kernel, so I think it's fine to keep it
>> consistent.
>
> If this doesn't actually *fix a bug*, then please don't add fixes and 
> confuse people looking for actual bugfixes.
>
> See Documentation/process/submitting-patches.rst
OK, my bad, i will remove it, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/vmscan: Use folio_migratetype() instead of get_pageblock_migratetype()
  2023-08-25  7:36       ` Vern Hao
@ 2023-08-25  7:37         ` David Hildenbrand
  0 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2023-08-25  7:37 UTC (permalink / raw)
  To: Vern Hao, akpm; +Cc: zhaoyang.huang, linux-mm, linux-kernel, Vern Hao

On 25.08.23 09:36, Vern Hao wrote:
> 
> 在 2023/8/25 15:34, David Hildenbrand 写道:
>> On 25.08.23 09:31, Vern Hao wrote:
>>>
>>> 在 2023/8/25 15:12, David Hildenbrand 写道:
>>>> On 25.08.23 06:08, Vern Hao wrote:
>>>>> From: Vern Hao <vernhao@tencent.com>
>>>>>
>>>>> In skip_cma(), we can use folio_migratetype() to replace
>>>>> get_pageblock_migratetype().
>>>>>
>>>>> Fixes: 5da226dbfce3 ("mm: skip CMA pages when they are not available")
>>>>
>>>> Why did you think "Fixes" was a good idea?
>>>>
>>> The skip_cma() contains the folio argument, and the folio_migratetype()
>>> is already implemented in the kernel, so I think it's fine to keep it
>>> consistent.
>>
>> If this doesn't actually *fix a bug*, then please don't add fixes and
>> confuse people looking for actual bugfixes.
>>
>> See Documentation/process/submitting-patches.rst
> OK, my bad, i will remove it, thanks.
> 

No need to resend. Andrew can drop that tag when applying.

-- 
Cheers,

David / dhildenb


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-25  7:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25  4:08 [PATCH] mm/vmscan: Use folio_migratetype() instead of get_pageblock_migratetype() Vern Hao
2023-08-25  7:12 ` David Hildenbrand
2023-08-25  7:31   ` Vern Hao
2023-08-25  7:34     ` David Hildenbrand
2023-08-25  7:36       ` Vern Hao
2023-08-25  7:37         ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®