Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8769542imu; Tue, 4 Dec 2018 13:57:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/XiKULgrm1F/Bad9KcZXrxn8yDcqFBa9SeESlB0OOj5hDhFHOxzPsm60J1LbU2GOZIyhaj5 X-Received: by 2002:a63:5722:: with SMTP id l34mr18155739pgb.118.1543960646216; Tue, 04 Dec 2018 13:57:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543960646; cv=none; d=google.com; s=arc-20160816; b=kb2+CGxLCqfp0/gDlLholLCnRbM6AgQlJmvUmbpiEdvb0GRlMIlZnpfmpAG07wpm9r GmvJAaUGtgg14IaM/a58c4Jf8CDN86uiHxnl8RyNehW2hL+KpA2BqMXnkql4235K42mv vjiuC7qtkWQApPrDgrjrlVgWAjrCCobqedcp1Dz7CxGGnfGWaRNtIp6wxHPn9LbO9UYO SYo0WMQvSimceyrXECzeVgy82Ae6zq5NCmUwVJdbiz0oI7mscT6cfr0ItzsBKDTDVZwU Y0rRsa6D23Uzsnv3oXE8hl5T3UcnaaNcMqXyf32/2l53XlSD8o1U1WrZwcySLBVycgBm /yFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=T3hfv6FpUqEoVwGjwWdOhSB9qy2IPh/BtoONAW4ywjQ=; b=eJUrLK/vuhn2CWGJDAhtcGIbiquEho36m+FlpDeJOUmE7JtXqdOly+cNHJyBug+zp1 UMxoYoiI3v+O2GCDEYaicoTejyxgfwJ2RJkjqVnh0kkgltESbnmRZjgcJElJPKOEQ7Aa otzHhcbJ12Y1gbVTitCrzr9B8WDWlq/MndgannX4FKkFr3fDYCvYlwq3Hfs5wU0N2iR1 JX8nvvLCpkl/LmNyCRLAWn96DZW50S5RtE0ol/dPPvkhk/d9RRZOip/NRQU6I+KFtsKI m5TjiwO6YFIwBQ7kHeGmZrA3zIBUVB58qWkD/kafXOwm/JwbLvoRNtam1LTIRdfrwtRs Eibg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Xr+/4Vh7"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf16si19174970plb.227.2018.12.04.13.57.10; Tue, 04 Dec 2018 13:57:26 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b="Xr+/4Vh7"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726031AbeLDV4e (ORCPT + 99 others); Tue, 4 Dec 2018 16:56:34 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46670 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbeLDV4e (ORCPT ); Tue, 4 Dec 2018 16:56:34 -0500 Received: by mail-pl1-f194.google.com with SMTP id t13so8945765ply.13 for ; Tue, 04 Dec 2018 13:56:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=T3hfv6FpUqEoVwGjwWdOhSB9qy2IPh/BtoONAW4ywjQ=; b=Xr+/4Vh7vxZX9SK3thA3PPXBK2DN5KSRF0au3wH+h3OMDsKwTv/Ust14NDAlNIl8b9 qauRcakbkUfSm/miM4s/4UfUZKlIREzWZ4Y6vggIrLz0lVyqNwB+VqM++PbbPaax5v/1 DU+i3jvvctcMiXPG6XL28ynOELhvOnMxCAkItoYFfczdBsdnFBgmasw0r+eDG3lHUk+y LCnDNU7dLIK8Xw4upeIe3zLz0lTlyCCjikSpIz9yRbJnMWa5TenHy9d98q6MhNaqxiy1 vaREUcqHG/DU/DY1kbXslf0FUvAFfvWPL/ClAV06+ih+Z5+/t/4os41dlwV362ocz3tC OVEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=T3hfv6FpUqEoVwGjwWdOhSB9qy2IPh/BtoONAW4ywjQ=; b=bSyeM9cHfYhmnqUe1/INUtGyvtkxzF6aRrPXae2ddKIo12Xvt+m20zJqQn8UD3y2lG W8jY2I368uUOHOU7n8vF31GSOJLYxqSZ/PpIDC7+X5CjaEeBT3jPpsO/iucaqiLvzQGq J8vHODXan9aB7PkbkqSERUWrEBdyRzK5jcFpBIrrVcSeQBadcsBZ04NsGC8rALCihbB2 F7ekximMAE+moCoLasz2mRvPKdNnTz8SqR4v1iJLjaOdoElSO7oAmevM3yAl7sOubjb8 JI76xuwhmGYHVEKGQ6saOl9rNhUz/P5UIE8UKM5VpGy+NOQ14F2dn8LgSLaOkOhoDUvF PNpA== X-Gm-Message-State: AA+aEWZnjt/zEVHtf96+s3zXRsej/niUCLMct7BiIIAcSWiQJEzFMG/P 8QEhqiMVUgIV67UmD+A6UYfK1w== X-Received: by 2002:a17:902:8541:: with SMTP id d1mr22115570plo.205.1543960593115; Tue, 04 Dec 2018 13:56:33 -0800 (PST) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id p6sm22704218pfn.53.2018.12.04.13.56.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Dec 2018 13:56:31 -0800 (PST) Date: Tue, 4 Dec 2018 13:56:30 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: Linus Torvalds , Andrea Arcangeli , ying.huang@intel.com, s.priebe@profihost.ag, mgorman@techsingularity.net, Linux List Kernel Mailing , alex.williamson@redhat.com, lkp@01.org, kirill@shutemov.name, Andrew Morton , zi.yan@cs.rutgers.edu, Vlastimil Babka Subject: Re: [patch 1/2 for-4.20] mm, thp: restore node-local hugepage allocations In-Reply-To: <20181204073535.GV31738@dhcp22.suse.cz> Message-ID: References: <20181204073535.GV31738@dhcp22.suse.cz> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Dec 2018, Michal Hocko wrote: > > This is a full revert of ac5b2c18911f ("mm: thp: relax __GFP_THISNODE for > > MADV_HUGEPAGE mappings") and a partial revert of 89c83fb539f9 ("mm, thp: > > consolidate THP gfp handling into alloc_hugepage_direct_gfpmask"). > > > > By not setting __GFP_THISNODE, applications can allocate remote hugepages > > when the local node is fragmented or low on memory when either the thp > > defrag setting is "always" or the vma has been madvised with > > MADV_HUGEPAGE. > > > > Remote access to hugepages often has much higher latency than local pages > > of the native page size. On Haswell, ac5b2c18911f was shown to have a > > 13.9% access regression after this commit for binaries that remap their > > text segment to be backed by transparent hugepages. > > > > The intent of ac5b2c18911f is to address an issue where a local node is > > low on memory or fragmented such that a hugepage cannot be allocated. In > > every scenario where this was described as a fix, there is abundant and > > unfragmented remote memory available to allocate from, even with a greater > > access latency. > > > > If remote memory is also low or fragmented, not setting __GFP_THISNODE was > > also measured on Haswell to have a 40% regression in allocation latency. > > > > Restore __GFP_THISNODE for thp allocations. > > > > Fixes: ac5b2c18911f ("mm: thp: relax __GFP_THISNODE for MADV_HUGEPAGE mappings") > > Fixes: 89c83fb539f9 ("mm, thp: consolidate THP gfp handling into alloc_hugepage_direct_gfpmask") > > At minimum do not remove the cleanup part which consolidates the gfp > hadnling to a single place. There is no real reason to have the > __GFP_THISNODE ugliness outside of alloc_hugepage_direct_gfpmask. > The __GFP_THISNODE usage is still confined to alloc_hugepage_direct_gfpmask() for the thp fault path, we no longer set it in alloc_pages_vma() as done before the cleanup.