Received: by 10.192.165.156 with SMTP id m28csp1314493imm; Wed, 18 Apr 2018 07:47:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/QuBLwm12ONw/mNJ60S6U/0ZWNqiTtq6j8JuxWWs0JCwIBejLEOKih58lA1PCVX8OULVx8 X-Received: by 10.98.40.68 with SMTP id o65mr2244709pfo.103.1524062849034; Wed, 18 Apr 2018 07:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524062848; cv=none; d=google.com; s=arc-20160816; b=P+YvhMc7sY1YucETt3L/erDBQ5ZMyf5jNZBabhOfJZRzCEJrDIbV9WtlfF1pi6gKyg cSZRV0ilUeDWy3b5OftFJAnI04dE+6dpTjBYrUicrl3eNCq40cHJRLlSEnbB2mLX0ItA gB7bmsZJ82sI6PWdr21QZEHNeQJ/Qx64J0KJoJd5v88saWOnlNKC1U8/V3VVnrX/cFZa 878Jep4oRz3SketDDmAGIDtPkWAFDDCbwDt7+UKJKvSP0uNyJMopXFJTsHgiKHbsY4l8 SsecGNLtgf+1SQRjhmBEmlaAFP4km58SU70rbhCFXDt41Wq9dyXx3AGi5EgU5rn4v1uK H2eQ== 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:message-id :subject:cc:to:from:date:arc-authentication-results; bh=wYIPhFUQgj9e4FgrPodt0p/mo4ykYkc3gYUy/dTRXGo=; b=Ye/FWjFLTxGOYwMoe9l2kO740zLHOQrgqQ8B0FGaEQ++f19It2eQH+ljC8EDrAPi61 PS0IRhG7i6I+ssRkkTXk7D4b4tltBxReU5rz3dlky2lj7Q1KsIPpZn4QfaJZR8dM0hi5 nb4ph+5xXRtqLpueCMCXaSbyb2bpEJG7VX4MTUq7jJIe4TIu57YTCd4TuBrvCFCIkJLt vFspSmfwZ5VK5xkbheWXsOlt+nrGCPb900FTVZp92oN3GbmWrXn74rtDk29Dj+JMWi8h OeDVKDP1JG/IF1v21obDZl16HqoKoICuuKNHM8tkaOFHaGP4z2V6Nnu35UEYkQl7h7z1 3oLA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si1220047pgc.588.2018.04.18.07.47.13; Wed, 18 Apr 2018 07:47:28 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752805AbeDROpn (ORCPT + 99 others); Wed, 18 Apr 2018 10:45:43 -0400 Received: from resqmta-ch2-07v.sys.comcast.net ([69.252.207.39]:41658 "EHLO resqmta-ch2-07v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305AbeDROpm (ORCPT ); Wed, 18 Apr 2018 10:45:42 -0400 Received: from resomta-ch2-17v.sys.comcast.net ([69.252.207.113]) by resqmta-ch2-07v.sys.comcast.net with ESMTP id 8oIHfn2AgOcV38oL7f5SSw; Wed, 18 Apr 2018 14:45:41 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-17v.sys.comcast.net with SMTP id 8oL5f0A6OoKh68oL6fDp9Z; Wed, 18 Apr 2018 14:45:41 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 9EA9B1161663; Wed, 18 Apr 2018 09:45:39 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 9B09A1160540; Wed, 18 Apr 2018 09:45:39 -0500 (CDT) Date: Wed, 18 Apr 2018 09:45:39 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Vlastimil Babka cc: Mikulas Patocka , Mike Snitzer , Matthew Wilcox , Pekka Enberg , linux-mm@kvack.org, dm-devel@redhat.com, David Rientjes , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfO6UUdSyMsAk5Jj8wXmnfPAhDaGSLyCgNZA+Hqz6SxxvcjIjbcjapAgU5Fmu4uuY6L/Xc1aMTORSchHe2Cz7jBr9F2wt6n23tReXiYJ7PTs3B0zUhaIX uyOm+w0orQlpgk5JdIphUNKxjxi9mVurjbvqqmcqu10iyUKgXAGRT69EvswO4NGnRXJ0ksfT/mfkzkciG0Y8f9NUFwyB7d/cNHqihkcMmHzxhyT6wSF+5qpS gcANBrmooS46BaJnuWgtMXl9S98kQ9NnJ/ljVhe1jXEdZAaaNImq7OWlK6dqHqkzgfQph1GqaKA3iruTKRjEzNZVVdz5jwrL1bIeOaLVwt98yudAyxV3zZHV 0pEdRNAcgEXPhbG0uB/iNF1l1NTvSKMTxdLwDdJ9se0D0vcKcTE+xuB+/Bda1Zt7HJIk9OdAIzPXncgDjFsPamSty0zK/LPnSHU5wErPHoMla8gNgA6z6fkE p1jKqUTImnlp/aVs Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mikulas Patoka wants to ensure that no fallback to lower order happens. I think __GFP_NORETRY should work correctly in that case too and not fall back. Allocating at a smaller order is a retry operation and should not be attempted. If the caller does not want retries then respect that. GFP_NORETRY allows callers to ensure that only maximum order allocations are attempted. Signed-off-by: Christoph Lameter Index: linux/mm/slub.c =================================================================== --- linux.orig/mm/slub.c +++ linux/mm/slub.c @@ -1598,7 +1598,7 @@ static struct page *allocate_slab(struct alloc_gfp = (alloc_gfp | __GFP_NOMEMALLOC) & ~(__GFP_RECLAIM|__GFP_NOFAIL); page = alloc_slab_page(s, alloc_gfp, node, oo); - if (unlikely(!page)) { + if (unlikely(!page) && !(flags & __GFP_NORETRY)) { oo = s->min; alloc_gfp = flags; /*