Received: by 10.192.165.156 with SMTP id m28csp406573imm; Tue, 17 Apr 2018 12:10:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ZMkiu8hnHQoEswm0d9l4oilnZKtMJHQWwTtTugmHmKb77BslyZeDsPjKmVfIPAh503OIf X-Received: by 2002:a17:902:60cf:: with SMTP id k15-v6mr3225118pln.44.1523992236481; Tue, 17 Apr 2018 12:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523992236; cv=none; d=google.com; s=arc-20160816; b=zR0ptaCh6woGheZV6zFthrHmCCtQpxF1EOHvm9/lo7UfonBs0ulh5S/7IRZYGj4S4c Wpw9HB/zk73P3nlY1J86376y7H2FpmBfSMBGIkhZoKQPGpYcvA8GzHQ8YJD2hUd+NGqn NUEnV1fmxr8tY/WwZzwlufj3gtyuCVCS2ztpTHoPs/cgwvC6QgLlSubEzfY9wCBeXBsb FeKMrnB84DaArH6PhiE3RdyF627v1ESbsAubsAY84XxOrF5rwpWoarYHCKxg2ruM3Hig 9wmBR7Xwe2mxWi+S4SD8hjYWS4dwRVkVvcVbgNF/oplw+bbz/gDOCq4w1jcwqi///KaI HgNg== 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:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=ougwr3TJb801ff5m9p3ILMytH4hF/3DsKqd8md4GQHE=; b=APnTYMu8v8L8KTOxWFemNjDM54pMo7z0FDKmgI9dPohthPa/X8Ke546bPLORAzHszE WnfGy+WK4N9xyfTvHmu2t3yaRYrRCiTSTAhfXtvvttc/JBX0DGxcmbN3Y+HVaYcC9drs tqnzv2DtwFez0wa3vhqZ4S3ENmyrJsuc3Di97hK/XEcJeOeQqWnA5GDEHjCrmeTfMCSs 9uIweczMMkQMxHC51Fy03IkC1XGnqVu0v7533txWa7BinWOo6Xm8HnPhZp3/FJmR4C+5 A/dFs/xfGhujzMp8Qg6ZvhYodINPWQ5fUWRc3AketAzONiy7yJtLKqNUhK2DlRuI1lT7 bzIw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1-v6si14448067pld.108.2018.04.17.12.10.22; Tue, 17 Apr 2018 12:10:36 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752647AbeDQTJL (ORCPT + 99 others); Tue, 17 Apr 2018 15:09:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55574 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752497AbeDQTJK (ORCPT ); Tue, 17 Apr 2018 15:09:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61F42EC016; Tue, 17 Apr 2018 19:09:10 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5124A2140624; Tue, 17 Apr 2018 19:09:10 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w3HJ9A0q030162; Tue, 17 Apr 2018 15:09:10 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w3HJ99RO030158; Tue, 17 Apr 2018 15:09:09 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 17 Apr 2018 15:09:09 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com 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 Subject: Re: [PATCH RESEND] 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> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 17 Apr 2018 19:09:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 17 Apr 2018 19:09:10 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mpatocka@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Apr 2018, Christopher Lameter wrote: > On Tue, 17 Apr 2018, Vlastimil Babka wrote: > > > On 04/17/2018 04:45 PM, Christopher Lameter wrote: > > > > But then higher order allocs are generally seen as problematic. > > > > I think in this case they are better than wasting/fragmenting 384kB for > > 640kB object. > > Well typically we have suggested that people use vmalloc in the past. vmalloc is slow - it is unuseable for a buffer cache. > > > That > > > means that callers need to be able to tolerate failures. > > > > Is it any different from now? I suppose there would still be > > smallest-order fallback involved in sl*b itself? And if your allocation > > is so large it can fail even with the fallback (i.e. >= costly order), > > you need to tolerate failures anyway? > > Failures can occur even with < costly order as far as I can telkl. Order 0 > is the only safe one. The alloc_pages functions seems to retry indefinitely for order <= PAGE_ALLOC_COSTLY_ORDER. Do you have some explanation why it should fail? > > One corner case I see is if there is anyone who would rather use their > > own fallback instead of the space-wasting smallest-order fallback. > > Maybe we could map some GFP flag to indicate that. > > Well if you have a fallback then maybe the slab allocator should not fall > back on its own but let the caller deal with it. Mikulas