Received: by 10.192.165.156 with SMTP id m28csp568780imm; Thu, 19 Apr 2018 04:02:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+2W46pXPB7x1RRC9jB1/+DSv3UZOjwJMCgN0WPQmRKO9xS5nK7AXXo7e/RWAEPriBT8K95 X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr2159682plb.99.1524135771724; Thu, 19 Apr 2018 04:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524135771; cv=none; d=google.com; s=arc-20160816; b=BoA7gBQZLiaimb27v7eIPW0znk9cf2uzHo6gDCLAkMlfQFsOI4uYjXG8MHMvXTR05z uIt1anu9zuK4xRFMw2BvKxVGZ+3NiC2YCXsCWE41kY0LOr45OasLNrrxrVkOuHkDQSIw 3snltVCKLDPtds2w5vL6jyxO83E6o6eHVqaLORSCqIftfA/TBR6IFPrDIrhX7tYCRG2G 6l/kWMXfLlsHF8gWOyiQDsHd3hNW2XiEEWC//3PqsnlIbCYntwNhKmyfJHydc6rzyour n/RBysoYC03t0VFiO4Ya6iviBjbTfLmOHK5eUezs+LPfEtVgftoN8osMYYA+8H/C7Zdv JOsg== 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:arc-authentication-results; bh=qrjbuQJ6PR/BLoMEtLJaCXuEBBh8xiHqlpvYvUYic64=; b=zxG4mZvLVwWThDm9ZSihViNEFU6/sbHH38GMoSxBNKW7tqUuyCxeMvnlDRnBJZkXL5 hQ9logsJZi4PgCl1WzzHY0TaSBrzCK8oLbkv4DQJo3oP8Jp3PpVv3VDyW092aWfCdEb9 rhDuuJQ9nHzEWQx++vIkFA2nxM5JveH/74udwHofKMLZAuWF95AA/Zjv35rOPtNI5HLK CiFDd7f/6Be4NwT38Z2UNuQlOuM3NFeXaBS0dOlYnWnF3Lc16ArVUVGoJJ11k4diaKC8 J8qToE6cHmCNrd4ZBRsZEqAHZT0cim/paFzMAI5mJ2zOVxH/Cnj//9bj0QtD2LraFikJ 9eFg== 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 k127si2903794pgc.578.2018.04.19.04.02.37; Thu, 19 Apr 2018 04:02:51 -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 S1752848AbeDSLA6 (ORCPT + 99 others); Thu, 19 Apr 2018 07:00:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:43564 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbeDSLA4 (ORCPT ); Thu, 19 Apr 2018 07:00:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B4C70AEA7; Thu, 19 Apr 2018 11:00:55 +0000 (UTC) Date: Thu, 19 Apr 2018 13:00:51 +0200 From: Michal Hocko To: Christopher Lameter Cc: Vlastimil Babka , 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: Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set Message-ID: <20180419110051.GB16083@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed 18-04-18 09:45:39, Cristopher Lameter wrote: > 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. Overriding __GFP_NORETRY is just a bad idea. It will make the semantic of the flag just more confusing. Note there are users who use __GFP_NORETRY as a way to suppress heavy memory pressure and/or the OOM killer. You do not want to change the semantic for them. Besides that the changelog is less than optimal. What is the actual problem? Why somebody doesn't want a fallback? Is there a configuration that could prevent the same? > 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; > /* -- Michal Hocko SUSE Labs