Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9173512imu; Tue, 4 Dec 2018 23:35:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/VP+YriA8vUmNIrws29YGoV22No+S4Z5E8lrtNe2Tlpqx7tAluFGoHaUbMTGj13CfrbELWo X-Received: by 2002:a63:be4d:: with SMTP id g13mr19628562pgo.378.1543995330206; Tue, 04 Dec 2018 23:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543995330; cv=none; d=google.com; s=arc-20160816; b=n9J9CFIIozocioSUDa7MGeIrL8YwwjAdbDj+Jhm7fJnnZcP9F8xr2/JG4VmTomFPLF KvPFTcRn3fxrNG3eQ2yLDPLmB81icZYPfg1e5ThbnqvWrG+1i+S8UlFkonc16yZ2af7j xfV6XOuBjZ59i0WicueLjQmhdV5tY4YCYt8OsOXyRA9rQAKFJ/bJEOXfnxqcyTu5pnz+ ALG8iY4dGWvRj1/A2HJg2N8+n/mpaKoFm3/aKss6toK+LdIoFIeCc7KZsxZyPPEFT3u6 0g0i77+Z4rh6gGJKDJejtnJpaZP6+NnEXayDWJVmn/l5laaCWlAkf8u5ja5fZBfu0kKd tfrg== 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=twpchpcEiTOxP2ibM5ITxjJS3PEhHVGyfmegQagqmkk=; b=UIg5rqMpCnaR9vYdUSoaeKE5vx6eME3iPhaBZVS5hbtKG0gMkS3aT977pNnM0Vr37v Yb1JXTZE5DbiwH4RT37plWIG/s/Put11Mkds5Cvme9tj91bYvixp87EQ0D1FpCfnxxLE WMztXW6u/ZRR/ZPmXZwEor888uvp2LyZP+VVpZqPiVReImoRsP1nXlDxIbfLj3sBZVLj bpS7fvaMZOXE3Tq1etLcQctQaN0PakKoSy5da3mw834S0TVM1KV4BGPqpaLmpWEusiz0 PA0kkfhTSZxl+8w7c3YfzTmzU/P/F6Nhdyd3y5Y1uaQPEIFpljTEhMRhIAwXvLZfzveW GtAw== 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 f9si17222968pgk.313.2018.12.04.23.35.15; Tue, 04 Dec 2018 23:35:30 -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; 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 S1726937AbeLEHek (ORCPT + 99 others); Wed, 5 Dec 2018 02:34:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:55258 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726171AbeLEHek (ORCPT ); Wed, 5 Dec 2018 02:34:40 -0500 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 45BF0ACC7; Wed, 5 Dec 2018 07:34:38 +0000 (UTC) Date: Wed, 5 Dec 2018 08:34:34 +0100 From: Michal Hocko To: David Rientjes 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 Message-ID: <20181205073434.GT1286@dhcp22.suse.cz> References: <20181204073535.GV31738@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 Tue 04-12-18 13:56:30, David Rientjes wrote: > 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. Why should be new_page any different? -- Michal Hocko SUSE Labs