Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6837298ybn; Mon, 30 Sep 2019 04:42:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwY/rTUwjt82JE3jVslEzilhWomaSMNXRLlMdM6uOStUtUzcoF/Kxzu5SRkcTUzPHAul04q X-Received: by 2002:a50:a57d:: with SMTP id z58mr19090451edb.115.1569843767891; Mon, 30 Sep 2019 04:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569843767; cv=none; d=google.com; s=arc-20160816; b=BT+mvkqUsDkA0REr6MamAx/7MU3Sky1FuqS6gzR+juz3X3URD/nEaHovADCzbs9jlU iwKfrZEXvICGK0/CtU6rF/w9SXLjfTPK13QCk7xXsjuMA0WRPzsVqeht6nH4Q0O9SXUG TpKGo48+rwJfvwCWEVCtenK2huqTxM6KGnieqpIg9kzHfSwmWtTxNsLobzHqxVBjG8S4 xDUbNmAliMT48o6lRtjRVm20BEybsLBMeq05AKMw54wqRCUxT/XeWwIsO1oKuUP0gr72 FhExad/4irCu+rTTOpaDc82E7ItANQbJmFQjy28JSAA3/gdKxJQ16fh4MxrApC2QyAk9 Aeyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=YZszQKn96b5qZIMF1P1WhVxSY9eYUSa3JygUvIxPnlE=; b=VcfRqUcVvMRzmOuLpQsnHOKB+GNr3CYNCAPHyxMI7fP+3fndXXsFAYoV98I1WMHv/e QsibW4ni4As4nOvMCQHz55fHtKxRpFOGb9rKK7X3LGQtJGn+i0g9qXclTFvDX467Wl7I LSWlgp+deuYHUm0B4d7t3ZE+C3aqkRJeMJsS/5TXBqlVdVm7w0Bf1yLI16tnjiciQyf8 1XEyvIPRCGQUD6JafR0n1rFNLQsHJGsCeNqZdJ4YmvBG78cXLU+DRuYZUgIyOPSg/L2U UuLvryh3AZ7NpGTHVemVfQ6kH9wlaYx8M+zYCtvBqoBUtkzYr7of8y6LpLJBpZUayBG0 nkCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x45si6695795edd.388.2019.09.30.04.42.10; Mon, 30 Sep 2019 04:42:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729676AbfI3L2T (ORCPT + 99 others); Mon, 30 Sep 2019 07:28:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:49452 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725767AbfI3L2T (ORCPT ); Mon, 30 Sep 2019 07:28:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C7A39AEAE; Mon, 30 Sep 2019 11:28:17 +0000 (UTC) Date: Mon, 30 Sep 2019 13:28:17 +0200 From: Michal Hocko To: Linus Torvalds Cc: David Rientjes , Andrea Arcangeli , Andrew Morton , Mel Gorman , Vlastimil Babka , "Kirill A. Shutemov" , Linux Kernel Mailing List , Linux-MM Subject: Re: [patch for-5.3 0/4] revert immediate fallback to remote hugepages Message-ID: <20190930112817.GC15942@dhcp22.suse.cz> References: <20190904205522.GA9871@redhat.com> <20190909193020.GD2063@dhcp22.suse.cz> <20190925070817.GH23050@dhcp22.suse.cz> <20190927074803.GB26848@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 28-09-19 13:59:26, Linus Torvalds wrote: > On Fri, Sep 27, 2019 at 12:48 AM Michal Hocko wrote: > > > > - page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac); > > + if (!order) > > + page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac); > > if (page) > > goto got_pg; > > > > The whole point of handling this in the page allocator directly is to > > have a unified solutions rather than have each specific caller invent > > its own way to achieve higher locality. > > The above just looks hacky. It is and it was meant to help move on when debugging rather than a final solution. > Why would order-0 be special? Ideally it wouldn't be but the current implementation makes it special. Why? Because the whole concept of low wmark fast path attempt is based on kswapd balancing for a high watermark providing some space. Kcompactd doesn't have any notion like that. And I believe that a large part of the problem really is there. If I am wrong here then I would appreciate to be corrected. If __GFP_THISNODE allows for a better THP utilization on a local node then the problem points at kcompactd not being pro-active enough. And that was the first diff aiming at. I also claim that this is not a THP specific problem. You are right that lower orders are less likely to hit the problem because the memory is usually not fragmented that heavily but fundamentally the over eager fallback in the fast path is still there. And that is the reason for me to pushback against __GFP_THIS_NODE && fallback allocation opencoded outside of the allocator. The allocator knows the context can compact so why should we require the caller to be doing that? Do not get me wrong, but we have a quite a long history of fine tuning for THP by adding kludges here and there and they usually turnout to break something else. I really want to get to understand the underlying problem and base a solution on it rather than "__GFP_THISNODE can cause overreclaim so pick up a break out condition and hope for the best". -- Michal Hocko SUSE Labs