Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3102423ybn; Fri, 27 Sep 2019 00:49:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGihfvcC8vzLhqYJl+Sa8gsqcQERQlRm8y5gw8XvTojHa6fwGKGM1nwV1IelCK3YSLPAMb X-Received: by 2002:a17:906:b283:: with SMTP id q3mr6758208ejz.7.1569570546633; Fri, 27 Sep 2019 00:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569570546; cv=none; d=google.com; s=arc-20160816; b=atOrcFPA2R4wCq5TdLme8XVQDcOsjZwK/GObFZPiThVghzV3DtOnx0grNGsS/b97X4 1T4zabRz6MFS3ANpEEyiFpJAW/MpZGTBGuVf7P6pvxHYPh331zbTMK2TYF9PYTQxwUH3 E6FE4Bf1tJLOfRpQC3PsONckYjX25PGPY/GNRsNr5VpdwV2C7Rkvqve71+/+CncP/uYj Kse+Yf9Hs+HR8wnbUS5K5vAkDRjTKJXyAwbOAj4Af7aBS6jgyu1polOQA3IJQl6Dufhj 9AALHApn6V2hBNy+QMUzFAMDq3iG95TqNoH6DzvZJk1BzryGJc4rCHRJTcnBBEoSLPZe RiDw== 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=Dy6kc1XZZen9QpzGVFZbPRkMiPy/9F1tb8L0VPPqkwo=; b=K1ejPuR1m9IXjadbKUtXdK45ZfqOQvtZrVhiRf9Cahyg4IBvjKYBtQGxj3dvxt4F6o bAhCbUuB87zxvG0kM27hF/vGI0Rj9fsvSCgTU4zbnOxtvRBPDovCM5bh29VKRo9K3dQs uuQyQHgcossEC9qkxfR4LbR9gj/31THEG9es5mbWLQ173S/RRfC0V9Mkw5O+MN2eW7JR yv+Tq3VUiEYjyqZhkQoH3AQZySUxkaNkKzpo4smBs4jpyZsR4L/7Kb7FiljYZA/V+rS7 RexW6BCyOAdDtAGPpjU4kEqcydLhRmjiWtxrPJQgEWbnnc+tAhV/v7yeJvMvzkOqOCer X4Rw== 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 h42si1063622eda.90.2019.09.27.00.48.41; Fri, 27 Sep 2019 00:49:06 -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 S1726177AbfI0HsG (ORCPT + 99 others); Fri, 27 Sep 2019 03:48:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:34310 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725769AbfI0HsG (ORCPT ); Fri, 27 Sep 2019 03:48:06 -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 82F4BAD63; Fri, 27 Sep 2019 07:48:04 +0000 (UTC) Date: Fri, 27 Sep 2019 09:48:03 +0200 From: Michal Hocko To: David Rientjes Cc: Andrea Arcangeli , Linus Torvalds , Andrew Morton , Mel Gorman , Vlastimil Babka , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch for-5.3 0/4] revert immediate fallback to remote hugepages Message-ID: <20190927074803.GB26848@dhcp22.suse.cz> References: <20190904205522.GA9871@redhat.com> <20190909193020.GD2063@dhcp22.suse.cz> <20190925070817.GH23050@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 Thu 26-09-19 12:03:37, David Rientjes wrote: [...] > Your patch is setting __GFP_THISNODE for __GFP_DIRECT_RECLAIM: this > allocation will fail in the fastpath for both my case (fragmented local > node) and Andrea's case (out of memory local node). The first > get_page_from_freelist() will then succeed in the slowpath for both cases; > compaction is not tried for either. > > In my case, that results in a perpetual remote access latency that we > can't tolerate. If Andrea's remote nodes are fragmented or low on memory, > his case encounters swap storms over both the local node and remote nodes. > > So I'm not really sure what is solved by your patch? There are two aspects the patch is targeting at. The first is that the fast path is targeting a higher watermak (WMARK_LOW) so it might fallback to a remote node easier and then the fast path doesn't wake up kcompactd so there is no pro-active compaction going on to help future allocations. You are right that a fragmented or at min watermark node would fallback to a remote node even with this patch. I wanted to see how much the kcompactd can change the overall picture. If this is not sufficient then maybe we need to drop the first optimistic attempt as well and simply go right into the light compaction. Something like this on top diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ff5484fdbdf9..61284e7f01ee 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4434,7 +4434,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, * The adjusted alloc_flags might result in immediate success, so try * that first */ - 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. -- Michal Hocko SUSE Labs