Received: by 10.192.165.148 with SMTP id m20csp1789852imm; Sat, 21 Apr 2018 16:17:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+fxjAVHNzB7VUxVNTc7GFgN+3dWsb2NbQDoPjgHk+3o4/x1+vmqwv2Sp5FxSy8/Qi4jOV5 X-Received: by 10.99.172.86 with SMTP id z22mr12319984pgn.411.1524352625721; Sat, 21 Apr 2018 16:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524352625; cv=none; d=google.com; s=arc-20160816; b=R9fp9RQIy4VcE9EC+V3Bn9UCI2G+WBHPdpy/4CggFEZlZsOmZsnuq14Tc+Oh6Z6Fry Oeb/n2OYcce2fM9wh4E9+mtAiYhNUCQwF4FU5Izp874vVzMNvy64eggA4p/BJVNy+bd5 nRgNgw3HVtr81LPa3CxXhIQvcz9BPLDMv2I2XAaT/3NaprIezvuatTnxR3QJEj10kKq/ 1B91IYI99amJ9RopCt0myZyjZTqV1p8hf/3qmAWCSAoKmkSVSQUYxdh/fRprTp8L+7CF jlzn/+9rdDs4RLV2qfVGQIGdWiKuthHXsTuDlm2SVPi8+45/msCDbkM2d6+6QPLfpcZ8 b8LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=ELL9C5P6Q0gI8BjfNhiLIHND5gGc3SjqLHr+HmBcOkk=; b=05X+KgowZ8c+5k7zSUck5R6nLZ1kqtkI+ZeJfp5xszcBkOwncTuvIowbBeC6f+ItxV LiqbsZrFZgsSMptqpeHoMUxQBz6tC0MiDt7kkT+snidMwEUq3JaG49v0FOl44cKtqVMQ izaxvAOZKzjnO5eXiG0Ib35RlJMkO8YsRNTP3L1BMJIEazfy2z5gKIwMLEZ4ubY18NDt Of+paJ5gtdXGMRN3G+3WYlOx3nFkUhGjyInhiKSSyP9OmbrNpUa2NJ1AYcNj7dOUuHBy ugQ81KX0J49ZQASv9/LGvNAmGDPvnH/0sV7d/2Uub0Be39Vm9MLu1iiuh164PedaDR1P RUAw== 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 127si4558790pff.224.2018.04.21.16.16.51; Sat, 21 Apr 2018 16:17:05 -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 S1753424AbeDUXPo (ORCPT + 99 others); Sat, 21 Apr 2018 19:15:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:46415 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753208AbeDUXPl (ORCPT ); Sat, 21 Apr 2018 19:15:41 -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 64593ADA9; Sat, 21 Apr 2018 23:15:40 +0000 (UTC) Subject: Re: [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set To: Christopher Lameter , Michal Hocko 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 References: <20180419110051.GB16083@dhcp22.suse.cz> From: Vlastimil Babka Message-ID: <26580de4-70b5-90f7-b3b9-22f57ba38843@suse.cz> Date: Sat, 21 Apr 2018 19:02:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/20/2018 04:53 PM, Christopher Lameter wrote: > On Thu, 19 Apr 2018, Michal Hocko wrote: > >> 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. > > Redoing the allocation after failing a large order alloc is a retry. I > would say its confusing right now because a retry occurs despite > specifying GFP_NORETRY, > >> 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? > > The problem is that SLUB does not honor GFP_NORETRY. The semantics of > GFP_NORETRY are not followed. The caller might want SLUB to try hard to get that high-order page that will minimize memory waste (e.g. 2MB page for 3 640k objects), and __GFP_NORETRY will kill the effort on allocating that high-order page. Thus, using __GPF_NORETRY for "please give me a space-optimized object, or nothing (because I have a fallback that's better than wasting memory, e.g. by using 1MB page for 640kb object)" is not ideal. Maybe __GFP_RETRY_MAYFAIL is a better fit? Or perhaps indicate this situation to SLUB with e.g. __GFP_COMP, although that's rather ugly?