Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3160777imd; Mon, 29 Oct 2018 02:43:57 -0700 (PDT) X-Google-Smtp-Source: AJdET5c2FbIkAbuvXUWyam6zBdQ2ux3fQlH10E+9mF4QEpSwsD80pVoK62htrmhMTB9zVySy+8X3 X-Received: by 2002:a17:902:b198:: with SMTP id s24-v6mr12953404plr.70.1540806237871; Mon, 29 Oct 2018 02:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540806237; cv=none; d=google.com; s=arc-20160816; b=pEEe/FKL0Q1Nyyr9+xOzS68qJhjIKoR7wNXJMAuykoIht8IDyHe5jRb1yJxniPGGVC J4wSUc4iyJPjGC+B6Rg9tyc0wD6kXUxcXQk8DkYPy/v43wSxc8N/QJrUpxQut1hF/M/P 059vDtLMpyMgIbqd14b5UrfXz0a6eivbz5x8D1lMuaYVnD9f5M/kenK3LXGVOFEtVT0M vUFrM4jpRQuAXcQPum964mI2uE9b7QAKokcruYwDV5BLgxtUorUY28kRSgKuSwVZYxVq R2BISMCM7ypJa1LB5MCsu5Qm8EsB+r4mNyXBDVnuAT6vnwl2C1CFtx2q5xKphU59zfIa sKwQ== 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:dkim-signature; bh=dBQvLdnsYnmXkuzMfk7uNHHPlRKih1qzk67c6Ebokbg=; b=vLy2RvO2YT8U/lLSQKtuLMoquUA38QAWKYad20OspTZJxsXj9AjC3kgrJUcmryd+Lf UqbmmMkR815Nr++iSeGtOHPFiCEGPeOfkufWB94islzi4KHuV4EDWvIsMEmujh4BxI3K d49lGu/IbIzZ8CSKBwoIXSFs3arxlgqlSBm3BEW0VwPsyyXr6Yaete6h3P6AJZTHV65B PKFPygtz1odov5fZ+c8pg95ivQblwROq5NPh2k3Sb1CmcE49hgW1hrilYopFZSAmqy4Q DRbaHI0WaT+lpFmQR4ZNWcRkUnPTddnbhK7EdbHlEhCGBb/yQ9XkydSPTwrU9RoH3XAc 8S0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ngT1s3rj; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23-v6si19401972pfn.85.2018.10.29.02.43.42; Mon, 29 Oct 2018 02:43:57 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ngT1s3rj; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729616AbeJ2Sax (ORCPT + 99 others); Mon, 29 Oct 2018 14:30:53 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36628 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbeJ2Sax (ORCPT ); Mon, 29 Oct 2018 14:30:53 -0400 Received: by mail-pg1-f193.google.com with SMTP id z17-v6so3616737pgv.3; Mon, 29 Oct 2018 02:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dBQvLdnsYnmXkuzMfk7uNHHPlRKih1qzk67c6Ebokbg=; b=ngT1s3rjCJO5j/bPY47inxehLkWgdp1PmF3WJmKgaulBrMcr1+dHZ2jkpLG8r9bfqV qgUQ0xbmuxSJlnmqek7svKJPO7vOhLEnLGMzU7dc+5KsGWRdaGWLiT55HX3jXCKEV+bg rQNpojd9G6/9CozRJKCsXDYROL0zws9XIcWg6+zr3JBOnrL5cWQApYHvPN9XRIpMRGGo P5nmOT7zVLH+5sJsLguqk7H2qbpZx5ZFokzw3tdvqmd5wlmp8i7rUndfyRGgvhRiGXWZ ZqeuUAyh1LsI41E7bye7JHUktDl358teQoSLuQfLUdnfCuDSWkWRGaGj2d1Rx01z4Q1c 3/PQ== 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:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dBQvLdnsYnmXkuzMfk7uNHHPlRKih1qzk67c6Ebokbg=; b=iE5wRluba1qihzA4wDHID49mc196AO5MtyHKQUYXOqR7yjdJa8rqibi6euAfeZXa0p ZlqXoHiXXvgc5TeM0fcd+8iJOD3fmaxM+t15bcH0yQARgfiQvYmUaj7XGi5eF2tuIpkc PQngBfEcaetsXjKAuWXTakwV4Hs2+5hrQw/KXz36O1G6vg0ymjFUOdEZ0B40XsKbohLA QkUH2HBdPvxYrEbqKnMkL4Xh00TFeWU1XM1ZmScUHfvEVkzPhZEgwgc2hhr/MeDyY9vp RrBs5g68dq1yqvfxl5L+ntSu9jfJTWBZIAnbJwmrszGdLArXi3QhFk5KSDSg3A2YadZ2 tzlw== X-Gm-Message-State: AGRZ1gKKhS2TFN4UHn5O6SVj3w2MplCdgPhQdMoeZ3Q4eMzj156K/+EK uzCvP6irImM+LqZrYZ4Ro7g= X-Received: by 2002:a65:65c9:: with SMTP id y9mr13439661pgv.438.1540806179661; Mon, 29 Oct 2018 02:42:59 -0700 (PDT) Received: from localhost (14-202-194-140.static.tpgi.com.au. [14.202.194.140]) by smtp.gmail.com with ESMTPSA id p62-v6sm31727231pfp.111.2018.10.29.02.42.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 02:42:58 -0700 (PDT) Date: Mon, 29 Oct 2018 20:42:53 +1100 From: Balbir Singh To: Michal Hocko Cc: Andrew Morton , Mel Gorman , Vlastimil Babka , David Rientjes , Andrea Argangeli , Zi Yan , Stefan Priebe - Profihost AG , "Kirill A. Shutemov" , linux-mm@kvack.org, LKML , Andrea Arcangeli , Stable tree Subject: Re: [PATCH 1/2] mm: thp: relax __GFP_THISNODE for MADV_HUGEPAGE mappings Message-ID: <20181029094253.GC16399@350D> References: <20180925120326.24392-1-mhocko@kernel.org> <20180925120326.24392-2-mhocko@kernel.org> <20181029051752.GB16399@350D> <20181029090035.GE32673@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181029090035.GE32673@dhcp22.suse.cz> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 29, 2018 at 10:00:35AM +0100, Michal Hocko wrote: > On Mon 29-10-18 16:17:52, Balbir Singh wrote: > [...] > > I wonder if alloc_pool_huge_page() should also trim out it's logic > > of __GFP_THISNODE for the same reasons as mentioned here. I like > > that we round robin to alloc the pool pages, but __GFP_THISNODE > > might be an overkill for that case as well. > > alloc_pool_huge_page uses __GFP_THISNODE for a different reason than > THP. We really do want to allocated for a per-node pool. THP can > fallback or use a different node. > Not really static int alloc_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed) ... gfp_t gfp_mask = htlb_alloc_mask(h) | __GFP_THISNODE; ... for_each_node_mask_to_alloc(h, nr_nodes, node, nodes_allowed) { page = alloc_fresh_huge_page(h, gfp_mask, node, nodes_allowed); if (page) break; } The code just tries to distribute the pool > These hugetlb allocations might be disruptive and that is an expected > behavior because this is an explicit requirement from an admin to > pre-allocate large pages for the future use. __GFP_RETRY_MAYFAIL just > underlines that requirement. Yes, but in the absence of a particular node, for example via sysctl (as the compaction does), I don't think it is a hard requirement to get a page from a particular node. I agree we need __GFP_RETRY_FAIL, in any case the real root cause for me is should_reclaim_continue() which keeps the task looping without making forward progress. The __GFP_THISNODE was again an example of mis-leading the allocator in this case, IMHO. > > Maybe the compaction logic could be improved and that might be a shared > goal with future changes though. I'll also send my RFC once my testing is done, assuming I get it to reproduce with a desired frequency. Balbir Singh.