From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by kanga.kvack.org (Postfix) with ESMTP id 906086B0038 for ; Wed, 30 Sep 2015 04:51:17 -0400 (EDT) Received: by wicgb1 with SMTP id gb1so184406951wic.1 for ; Wed, 30 Sep 2015 01:51:16 -0700 (PDT) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com. [2a00:1450:400c:c05::22d]) by mx.google.com with ESMTPS id pn1si18948wjb.153.2015.09.30.01.51.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2015 01:51:16 -0700 (PDT) Received: by wiclk2 with SMTP id lk2so50925618wic.1 for ; Wed, 30 Sep 2015 01:51:15 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150909123901.GA12432@techsingularity.net> References: <1440418191-10894-1-git-send-email-mgorman@techsingularity.net> <20150824123015.GJ12432@techsingularity.net> <20150909123901.GA12432@techsingularity.net> Date: Wed, 30 Sep 2015 10:51:15 +0200 Message-ID: Subject: Re: [PATCH 12/12] mm, page_alloc: Only enforce watermarks for order-0 allocations From: Vitaly Wool Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Joonsoo Kim , Andrew Morton , Johannes Weiner , Rik van Riel , Vlastimil Babka , David Rientjes , Joonsoo Kim , Michal Hocko , Linux-MM , LKML On Wed, Sep 9, 2015 at 2:39 PM, Mel Gorman wrote: > On Tue, Sep 08, 2015 at 05:26:13PM +0900, Joonsoo Kim wrote: >> 2015-08-24 21:30 GMT+09:00 Mel Gorman : >> > The primary purpose of watermarks is to ensure that reclaim can always >> > make forward progress in PF_MEMALLOC context (kswapd and direct reclaim). >> > These assume that order-0 allocations are all that is necessary for >> > forward progress. >> > >> > High-order watermarks serve a different purpose. Kswapd had no high-order >> > awareness before they were introduced (https://lkml.org/lkml/2004/9/5/9). >> > This was particularly important when there were high-order atomic requests. >> > The watermarks both gave kswapd awareness and made a reserve for those >> > atomic requests. >> > >> > There are two important side-effects of this. The most important is that >> > a non-atomic high-order request can fail even though free pages are available >> > and the order-0 watermarks are ok. The second is that high-order watermark >> > checks are expensive as the free list counts up to the requested order must >> > be examined. >> > >> > With the introduction of MIGRATE_HIGHATOMIC it is no longer necessary to >> > have high-order watermarks. Kswapd and compaction still need high-order >> > awareness which is handled by checking that at least one suitable high-order >> > page is free. >> >> I still don't think that this one suitable high-order page is enough. >> If fragmentation happens, there would be no order-2 freepage. If kswapd >> prepares only 1 order-2 freepage, one of two successive process forks >> (AFAIK, fork in x86 and ARM require order 2 page) must go to direct reclaim >> to make order-2 freepage. Kswapd cannot make order-2 freepage in that >> short time. It causes latency to many high-order freepage requestor >> in fragmented situation. >> > > So what do you suggest instead? A fixed number, some other heuristic? > You have pushed several times now for the series to focus on the latency > of standard high-order allocations but again I will say that it is outside > the scope of this series. If you want to take steps to reduce the latency > of ordinary high-order allocation requests that can sleep then it should > be a separate series. I do believe https://lkml.org/lkml/2015/9/9/313 does a better job here. I have to admit the patch header is a bit misleading here since we don't actually exclude CMA pages, we just _fix_ the calculation in the loop which is utterly wrong otherwise. ~vitaly -- 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