Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11226571imu; Thu, 6 Dec 2018 13:44:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xi14JxnucHxsiPLzAMBvnnpkDfSAVp0eM23ceFNfROUZ6jAgT4SWBnwGKG9zm4hrfnCKI/ X-Received: by 2002:a63:2b01:: with SMTP id r1mr25254681pgr.432.1544132652522; Thu, 06 Dec 2018 13:44:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544132652; cv=none; d=google.com; s=arc-20160816; b=XYFlxRs7/lLJNHC4WJWF/QuktJgpxnWQSxO4acVYa8igSmBY1G2XWyW6HZIrpkoH64 u+uX43ehYFEncu3zD0FBO3FDHt8XdV1b2LKZI/sLsoptLRKDCjCqcOxjuliChjvz7MVm MfVXJDvgShmql8erV3gbpwEIkSCBygWTt6RIbTu6new5KdNGPHTk+bG0r247R0cKfwLb OBITdbTKEkmxqLZSrQDA8bKfDxuLf6Q1+jeuOekT+QxqgtBEsfxSSCZUzDN6YUpzNVxH LDWcBtsuFMZ/l3Q/MBqu5iHUzb5Frg46wXjvFMDbPrWBV6FYsIEB5A/zWsWVA+Z0LR7H 5rWw== 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=ZNrhDs5PxEBlWuD1FLLXNATiY6plJdsQy7OCpiATADg=; b=r6neULc5j3SavnSNvyJMXnJp8tP2B9ca5utz+TfYB41fJcgquS6NcBPeZiWe74CL2n mEtPu8BxarFgqXYJmb1EFsYguLhcaIWlH4Bjeuoa8rZ3s0Cas/sq0wiXrXXNcVsn0Yh5 buYcisSNzJLbGWNk1/FDlyhby2NSmGHI4bzeG+bue6LGj0/GuRi5V2EauxNNXJd3sTz+ 6jmHZexlU0TPhtm8/d9ZBdD586FK6arDhPji5ur+vNLujvrijzlxuueCu3riHMb9zttY dgRwsyh5A+f6G8AAj++ZSi+xAW3aNr87lL/GOnJDqRGwlR9VZYf79dTTFtghRtjvNBCH ky9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FOsSUTlq; 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 q8si1103484pgc.580.2018.12.06.13.43.55; Thu, 06 Dec 2018 13:44:12 -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=FOsSUTlq; 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 S1726011AbeLFVmI (ORCPT + 99 others); Thu, 6 Dec 2018 16:42:08 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40758 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725929AbeLFVmI (ORCPT ); Thu, 6 Dec 2018 16:42:08 -0500 Received: by mail-pg1-f194.google.com with SMTP id z10so718400pgp.7 for ; Thu, 06 Dec 2018 13:42:07 -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=ZNrhDs5PxEBlWuD1FLLXNATiY6plJdsQy7OCpiATADg=; b=FOsSUTlq8CQHjfeavw1acL7sE3waUi7axw308X33qdWeQ2wZiIL+HRU4jrqRdt7W8s +Q6jWx1PA+i+5H2iZWctsh+bmGfXGuJ7BWYlzJKq6XT8GUrwnZrbv+0CwppKNXTg/qtX O0BSAfmqWV+RRVMcAEQK2Z7HGSj42qO3T45iuAXIdjvQnMIPRGAivbGkRw2ZaATNTVgG R1c8/ayyeyll9FkNFIoexY/jk7QraeiCAJX+0vkmcnSur3wjb1PZAjQrXXSMYB7NP638 7Lk4mujqjDlZmWOPxNVRtn1m+Y6SvIJj3o5dP/6qWoFVd7AhQi9CwQojU7A1/MGTA1XH n/5g== 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=ZNrhDs5PxEBlWuD1FLLXNATiY6plJdsQy7OCpiATADg=; b=VGcYjY//+zsBoSRqphHOedgVKjLTnAn9rEhTT8+TIoHl4r1pxiVxeMsCKDyMwk0Syt u3spubx7SVgiELPhHq6vU5TBzE4iBgp5ScVqtGj6gF6wV5cwXsOuEf19NZBtrJP75Ck1 eHS89Qy5Ov1x4AA0WrZXQuDL61obpfn5Lfb1qXrfatBnJ3Z239e67tkLsmXgfJtzOZSA Hwrz/M9ZI5cGU+x+WXgOehoHzFJFi9hP9KzmkTkxIreKOzjG7U3zJDWjAIFnsAC5iHd5 09hFYASYRofWd2O1/h/P4+pSNLMGqDLv7hKkkn06Fq8tf0rS90uXwnejNwt3DFefW8QH k6CA== X-Gm-Message-State: AA+aEWaGIVhwecU/50XKOC7z5Jp1BpKKXRKnjOh32mtwuOiPicT6K9X3 xmm7LCMQf0bH3lAQzOuXADtDvA== X-Received: by 2002:a62:1c96:: with SMTP id c144mr30106603pfc.129.1544132527260; Thu, 06 Dec 2018 13:42:07 -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 y6sm1939026pfd.104.2018.12.06.13.42.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 13:42:06 -0800 (PST) Date: Thu, 6 Dec 2018 13:42:05 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Linus Torvalds cc: Andrea Arcangeli , mgorman@techsingularity.net, Vlastimil Babka , mhocko@kernel.org, ying.huang@intel.com, s.priebe@profihost.ag, Linux List Kernel Mailing , alex.williamson@redhat.com, lkp@01.org, kirill@shutemov.name, Andrew Morton , zi.yan@cs.rutgers.edu Subject: Re: [patch v2 for-4.20] mm, thp: restore node-local hugepage allocations In-Reply-To: Message-ID: References: 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 Wed, 5 Dec 2018, David Rientjes 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") > Signed-off-by: David Rientjes We've identified a couple more regressions wrt 89c83fb539f9 ("mm, thp: consolidate THP gfp handling into alloc_hugepage_direct_gfpmask") in automated testing so I'm going to be proposing a full revert of that commit for 4.20 as a follow-up to this.