From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f199.google.com (mail-io0-f199.google.com [209.85.223.199]) by kanga.kvack.org (Postfix) with ESMTP id 9F3096B0253 for ; Fri, 22 Jul 2016 04:57:16 -0400 (EDT) Received: by mail-io0-f199.google.com with SMTP id r71so219874431ioi.3 for ; Fri, 22 Jul 2016 01:57:16 -0700 (PDT) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com. [58.251.152.64]) by mx.google.com with ESMTPS id n204si6009019oih.182.2016.07.22.01.57.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jul 2016 01:57:15 -0700 (PDT) Message-ID: <5791DFD4.5080207@huawei.com> Date: Fri, 22 Jul 2016 16:56:52 +0800 From: Xishi Qiu MIME-Version: 1.0 Subject: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "mel@csn.ul.ie" , 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f69.google.com (mail-lf0-f69.google.com [209.85.215.69]) by kanga.kvack.org (Postfix) with ESMTP id 1F44A6B0253 for ; Fri, 22 Jul 2016 05:04:24 -0400 (EDT) Received: by mail-lf0-f69.google.com with SMTP id p41so68538106lfi.0 for ; Fri, 22 Jul 2016 02:04:24 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id g6si8935244lfd.337.2016.07.22.02.04.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jul 2016 02:04:22 -0700 (PDT) Subject: Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? References: <5791DFD4.5080207@huawei.com> From: Vlastimil Babka Message-ID: <0b580155-d99a-f4a4-ef76-6166b41180aa@suse.cz> Date: Fri, 22 Jul 2016 11:04:20 +0200 MIME-Version: 1.0 In-Reply-To: <5791DFD4.5080207@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Xishi Qiu , "mel@csn.ul.ie" , 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f70.google.com (mail-wm0-f70.google.com [74.125.82.70]) by kanga.kvack.org (Postfix) with ESMTP id 40F186B0005 for ; Fri, 22 Jul 2016 05:30:15 -0400 (EDT) Received: by mail-wm0-f70.google.com with SMTP id o80so30157626wme.1 for ; Fri, 22 Jul 2016 02:30:15 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id b22si9211938wmb.32.2016.07.22.02.30.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jul 2016 02:30:14 -0700 (PDT) Subject: Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? References: <5791DFD4.5080207@huawei.com> <0b580155-d99a-f4a4-ef76-6166b41180aa@suse.cz> <5791E5B1.8060503@huawei.com> From: Vlastimil Babka Message-ID: <90c27726-945f-be2c-4df8-3e7162838583@suse.cz> Date: Fri, 22 Jul 2016 11:30:12 +0200 MIME-Version: 1.0 In-Reply-To: <5791E5B1.8060503@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Xishi Qiu Cc: "mel@csn.ul.ie" , 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id A7A656B0253 for ; Fri, 22 Jul 2016 05:33:44 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id h186so218781585pfg.3 for ; Fri, 22 Jul 2016 02:33:44 -0700 (PDT) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com. [119.145.14.66]) by mx.google.com with ESMTPS id 23si15005529pfq.32.2016.07.22.02.33.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jul 2016 02:33:43 -0700 (PDT) Message-ID: <5791E5B1.8060503@huawei.com> Date: Fri, 22 Jul 2016 17:21:53 +0800 From: Xishi Qiu MIME-Version: 1.0 Subject: Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? References: <5791DFD4.5080207@huawei.com> <0b580155-d99a-f4a4-ef76-6166b41180aa@suse.cz> In-Reply-To: <0b580155-d99a-f4a4-ef76-6166b41180aa@suse.cz> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka Cc: "mel@csn.ul.ie" , 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753292AbcGVJCW (ORCPT ); Fri, 22 Jul 2016 05:02:22 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:36525 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752976AbcGVJCT (ORCPT ); Fri, 22 Jul 2016 05:02:19 -0400 Message-ID: <5791DFD4.5080207@huawei.com> Date: Fri, 22 Jul 2016 16:56:52 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: "mel@csn.ul.ie" , Vlastimil Babka , "David Rientjes" , Joonsoo Kim , Mel Gorman CC: Linux MM , LKML Subject: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.5791DFE5.004F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 822a293debfbc271f07871ea61ed584f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752934AbcGVJEZ (ORCPT ); Fri, 22 Jul 2016 05:04:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:34440 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751905AbcGVJEX (ORCPT ); Fri, 22 Jul 2016 05:04:23 -0400 Subject: Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? To: Xishi Qiu , "mel@csn.ul.ie" , David Rientjes , Joonsoo Kim , Mel Gorman References: <5791DFD4.5080207@huawei.com> Cc: Linux MM , LKML From: Vlastimil Babka Message-ID: <0b580155-d99a-f4a4-ef76-6166b41180aa@suse.cz> Date: Fri, 22 Jul 2016 11:04:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <5791DFD4.5080207@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbcGVJaT (ORCPT ); Fri, 22 Jul 2016 05:30:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:35894 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753287AbcGVJaP (ORCPT ); Fri, 22 Jul 2016 05:30:15 -0400 Subject: Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? To: Xishi Qiu References: <5791DFD4.5080207@huawei.com> <0b580155-d99a-f4a4-ef76-6166b41180aa@suse.cz> <5791E5B1.8060503@huawei.com> Cc: "mel@csn.ul.ie" , David Rientjes , Joonsoo Kim , Mel Gorman , Linux MM , LKML From: Vlastimil Babka Message-ID: <90c27726-945f-be2c-4df8-3e7162838583@suse.cz> Date: Fri, 22 Jul 2016 11:30:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <5791E5B1.8060503@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>> >> >> >> . >> > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753629AbcGVJdw (ORCPT ); Fri, 22 Jul 2016 05:33:52 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:54225 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbcGVJdu (ORCPT ); Fri, 22 Jul 2016 05:33:50 -0400 Message-ID: <5791E5B1.8060503@huawei.com> Date: Fri, 22 Jul 2016 17:21:53 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Vlastimil Babka CC: "mel@csn.ul.ie" , David Rientjes , Joonsoo Kim , Mel Gorman , Linux MM , LKML Subject: Re: mm/compact: why use low watermark to determine whether compact is finished instead of use high watermark? References: <5791DFD4.5080207@huawei.com> <0b580155-d99a-f4a4-ef76-6166b41180aa@suse.cz> In-Reply-To: <0b580155-d99a-f4a4-ef76-6166b41180aa@suse.cz> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5791E870.0031,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 1ab6abf818c49011137ed47df858b3fb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> > > > . >