linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark?
@ 2016-07-22  8:56 Xishi Qiu
  2016-07-22  9:04 ` Vlastimil Babka
  0 siblings, 1 reply; 4+ messages in thread
From: Xishi Qiu @ 2016-07-22  8:56 UTC (permalink / raw)
  To: mel, Vlastimil Babka, David Rientjes, Joonsoo Kim, Mel Gorman
  Cc: Linux MM, LKML

Hi,

I find all the watermarks in mm/compaction.c are low_wmark_pages(),
so why not use high watermark to determine whether compact is finished?

e.g. 
__alloc_pages_nodemask()
	get_page_from_freelist()
	this is fast path, use use low_wmark_pages() in __zone_watermark_ok()

	__alloc_pages_slowpath()
	this is slow path, usually use min_wmark_pages()

kswapd
	balance_pgdat()
	use high_wmark_pages() to determine whether zone is balanced

Thanks,
Xishi Qiu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark?
  2016-07-22  8:56 mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? Xishi Qiu
@ 2016-07-22  9:04 ` Vlastimil Babka
  2016-07-22  9:21   ` Xishi Qiu
  0 siblings, 1 reply; 4+ messages in thread
From: Vlastimil Babka @ 2016-07-22  9:04 UTC (permalink / raw)
  To: Xishi Qiu, mel, David Rientjes, Joonsoo Kim, Mel Gorman; +Cc: Linux MM, LKML

On 07/22/2016 10:56 AM, Xishi Qiu wrote:
> Hi,
>
> I find all the watermarks in mm/compaction.c are low_wmark_pages(),
> so why not use high watermark to determine whether compact is finished?

Why would you use high watermark? Quite the opposite, I want to move 
towards min watermark (precisely, the one in alloc_flags which is 
usually min) in this series:

https://lkml.org/lkml/2016/6/24/222

especially:

https://lkml.org/lkml/2016/6/24/214

> e.g.
> __alloc_pages_nodemask()
> 	get_page_from_freelist()
> 	this is fast path, use use low_wmark_pages() in __zone_watermark_ok()
>
> 	__alloc_pages_slowpath()
> 	this is slow path, usually use min_wmark_pages()

Yes, and compaction should be finished when allocation can succeed, so 
match __alloc_pages_slowpath().

>
> kswapd
> 	balance_pgdat()
> 	use high_wmark_pages() to determine whether zone is balanced
>
> Thanks,
> Xishi Qiu
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark?
  2016-07-22  9:04 ` Vlastimil Babka
@ 2016-07-22  9:21   ` Xishi Qiu
  2016-07-22  9:30     ` Vlastimil Babka
  0 siblings, 1 reply; 4+ messages in thread
From: Xishi Qiu @ 2016-07-22  9:21 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: mel, David Rientjes, Joonsoo Kim, Mel Gorman, Linux MM, LKML

On 2016/7/22 17:04, Vlastimil Babka wrote:

> On 07/22/2016 10:56 AM, Xishi Qiu wrote:
>> Hi,
>>
>> I find all the watermarks in mm/compaction.c are low_wmark_pages(),
>> so why not use high watermark to determine whether compact is finished?
> 
> Why would you use high watermark? Quite the opposite, I want to move towards min watermark (precisely, the one in alloc_flags which is usually min) in this series:
> 
> https://lkml.org/lkml/2016/6/24/222
> 
> especially:
> 
> https://lkml.org/lkml/2016/6/24/214
> 
>> e.g.
>> __alloc_pages_nodemask()
>>     get_page_from_freelist()
>>     this is fast path, use use low_wmark_pages() in __zone_watermark_ok()
>>
>>     __alloc_pages_slowpath()
>>     this is slow path, usually use min_wmark_pages()
> 
> Yes, and compaction should be finished when allocation can succeed, so match __alloc_pages_slowpath().
> 

Sounds reasonable, but now we have kcompactd which called from kswapd,
so still use low wmark?

Thanks,
Xishi Qiu

>>
>> kswapd
>>     balance_pgdat()
>>     use high_wmark_pages() to determine whether zone is balanced
>>
>> Thanks,
>> Xishi Qiu
>>
> 
> 
> .
> 



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark?
  2016-07-22  9:21   ` Xishi Qiu
@ 2016-07-22  9:30     ` Vlastimil Babka
  0 siblings, 0 replies; 4+ messages in thread
From: Vlastimil Babka @ 2016-07-22  9:30 UTC (permalink / raw)
  To: Xishi Qiu; +Cc: mel, David Rientjes, Joonsoo Kim, Mel Gorman, Linux MM, LKML

On 07/22/2016 11:21 AM, Xishi Qiu wrote:
> On 2016/7/22 17:04, Vlastimil Babka wrote:
>
>> On 07/22/2016 10:56 AM, Xishi Qiu wrote:
>>> Hi,
>>>
>>> I find all the watermarks in mm/compaction.c are low_wmark_pages(),
>>> so why not use high watermark to determine whether compact is finished?
>>
>> Why would you use high watermark? Quite the opposite, I want to move towards min watermark (precisely, the one in alloc_flags which is usually min) in this series:
>>
>> https://lkml.org/lkml/2016/6/24/222
>>
>> especially:
>>
>> https://lkml.org/lkml/2016/6/24/214
>>
>>> e.g.
>>> __alloc_pages_nodemask()
>>>     get_page_from_freelist()
>>>     this is fast path, use use low_wmark_pages() in __zone_watermark_ok()
>>>
>>>     __alloc_pages_slowpath()
>>>     this is slow path, usually use min_wmark_pages()
>>
>> Yes, and compaction should be finished when allocation can succeed, so match __alloc_pages_slowpath().
>>
>
> Sounds reasonable, but now we have kcompactd which called from kswapd,
> so still use low wmark?

kswapd uses high watermark (order-0) to make a buffer of free pages for 
both direct allocators and kcompactd. kcompactd will use min watermark 
for now. There used to be difference between min/low/high watermarks 
when checking high-orders, but now watermark only affects the check if 
there's enough total base pages, and high-order check then succeeds if 
there's at least one high(er)-order page.

> Thanks,
> Xishi Qiu
>
>>>
>>> kswapd
>>>     balance_pgdat()
>>>     use high_wmark_pages() to determine whether zone is balanced
>>>
>>> Thanks,
>>> Xishi Qiu
>>>
>>
>>
>> .
>>
>
>
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2016-07-22  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-22  8:56 mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? Xishi Qiu
2016-07-22  9:04 ` Vlastimil Babka
2016-07-22  9:21   ` Xishi Qiu
2016-07-22  9:30     ` Vlastimil Babka

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