From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-f197.google.com (mail-yb0-f197.google.com [209.85.213.197]) by kanga.kvack.org (Postfix) with ESMTP id C268E6B0008 for ; Tue, 17 Apr 2018 14:53:48 -0400 (EDT) Received: by mail-yb0-f197.google.com with SMTP id x2-v6so12739350ybp.10 for ; Tue, 17 Apr 2018 11:53:48 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id 79si2075532qkr.197.2018.04.17.11.53.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 11:53:47 -0700 (PDT) Date: Tue, 17 Apr 2018 14:53:45 -0400 (EDT) From: Mikulas Patocka 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: Christopher Lameter 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 Tue, 17 Apr 2018, Christopher Lameter wrote: > 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? Slab assumes that all slabs have the same order, so it's not so easy to fix it. Mikulas