From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f199.google.com (mail-yw0-f199.google.com [209.85.161.199]) by kanga.kvack.org (Postfix) with ESMTP id 1DB7B6B0273 for ; Tue, 17 Apr 2018 10:40:18 -0400 (EDT) Received: by mail-yw0-f199.google.com with SMTP id k32so6105129ywh.21 for ; Tue, 17 Apr 2018 07:40:18 -0700 (PDT) Received: from resqmta-ch2-03v.sys.comcast.net (resqmta-ch2-03v.sys.comcast.net. [2001:558:fe21:29:69:252:207:35]) by mx.google.com with ESMTPS id m61si1227570qtd.184.2018.04.17.07.40.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 07:40:17 -0700 (PDT) Date: Tue, 17 Apr 2018 09:40:15 -0500 (CDT) From: Christopher Lameter Subject: Re: slab: introduce the flag SLAB_MINIMIZE_WASTE In-Reply-To: Message-ID: References: <20c58a03-90a8-7e75-5fc7-856facfb6c8a@suse.cz> <20180413151019.GA5660@redhat.com> <20180416142703.GA22422@redhat.com> <20180416144638.GA22484@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Mikulas Patocka Cc: Vlastimil Babka , 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 On Mon, 16 Apr 2018, Mikulas Patocka wrote: > dm-bufio deals gracefully with allocation failure, because it preallocates > some buffers with vmalloc, but other subsystems may not deal with it and > they cound return ENOMEM randomly or misbehave in other ways. So, the > "SLAB_MINIMIZE_WASTE" flag is also saying that the allocation may fail and > the caller is prepared to deal with it. > > The slub subsystem does actual fallback to low-order when the allocation > fails (it allows different order for each slab in the same cache), but > slab doesn't fallback and you get NULL if higher-order allocation fails. > So, SLAB_MINIMIZE_WASTE is needed for slab because it will just randomly > fail with higher order. Fix Slab instead of adding a flag that is only useful for one allocator?