Received: by 10.192.165.156 with SMTP id m28csp139453imm; Tue, 17 Apr 2018 07:47:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Qq7izonxb+EPtXcMe45CSX0J9mOqTLfJaPj1afkHFqFzZIvfiEFXwU4miCoqjx/vSsqFq X-Received: by 2002:a17:902:8e83:: with SMTP id bg3-v6mr2287538plb.144.1523976457822; Tue, 17 Apr 2018 07:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523976457; cv=none; d=google.com; s=arc-20160816; b=YZB441YfN+KGXb5JW1Qb2bb250Vzlu36f08gCYY5cRhxRTvKj519j+fngEmt1FO/gI JQqKuThZF4W+44raRmLOBukgMsn1hwny7VzfYisd03zm27rXZAGRRq7cgGJ9EiJxhAdo hA1TBwyOoYYucG8m7hAj27fEji22TwApm8DWqLh1g8mVMZfa43e9VpVsDPAttmyoIXs0 XuW2vcLYNf4IKOASuDc8/dm+R3E9Acj3WUiOfOIserB3IpQFscv2YmPqOzXR5tIXnUqF hgBn16LbB/lHaG6pwBN+6+6Pc8P4UcRkNT9J019tM8hJ/mhhV7OdOeKBd6E3NLHKFrLf 8Zwg== 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=eBXhQ5TCxn+xfjQOzXXGN/5p72n7dT9LNNVFco7wptM=; b=aNnkSEJWVPN7zANyqoi4bNsBOHvThywn0x9hQOm6vpANDZzx+z8zMpSMY5YDnyFGHp pDv3QoC5qvzwApSzvtIT3m19mWXGS0uc4GxXAbT0uuoeNm33FpknEWr3v1F3BCLn0kLA WiwQ3quek5i0rGjOH6zKBlIoITJS9eylRE5Eijw5/sDGBkLs/9inZVlefyIWZ7TyKHfI ERsc4PBIJZWv5LldwCHTW3hYLJNGN3NO97d1P8CxSPPzqW1MnPFOV2lkJnXKfB6gV9r5 /u/pSlYJgyZiISCT3fS2BQMvgOhELh8vtlt4Ms/yiTBT2qQdaky6tTA9GTFBcPQMS4XW IpyQ== 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 i6si10100861pgt.52.2018.04.17.07.47.23; Tue, 17 Apr 2018 07:47:37 -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 S1753196AbeDQOph (ORCPT + 99 others); Tue, 17 Apr 2018 10:45:37 -0400 Received: from resqmta-ch2-12v.sys.comcast.net ([69.252.207.44]:43744 "EHLO resqmta-ch2-12v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753139AbeDQOp3 (ORCPT ); Tue, 17 Apr 2018 10:45:29 -0400 Received: from resomta-ch2-17v.sys.comcast.net ([69.252.207.113]) by resqmta-ch2-12v.sys.comcast.net with ESMTP id 8RrMfTVTMxNju8RrMfduPs; Tue, 17 Apr 2018 14:45:28 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-17v.sys.comcast.net with SMTP id 8RrLfpQhroKh68RrLfBgE1; Tue, 17 Apr 2018 14:45:28 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 1B5881161681; Tue, 17 Apr 2018 09:45:27 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 18B4F1160172; Tue, 17 Apr 2018 09:45:27 -0500 (CDT) Date: Tue, 17 Apr 2018 09:45:27 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Mikulas Patocka cc: Mike Snitzer , Vlastimil Babka , 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.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfOE1VLzCkYy4qlzmfXRXA0rVMD3tF4LspKQnAN48XCHWMvzikNCTjYiZ0yBT0L2OK3ZcQFxS1Gl5V8Uq7E4vcrSRrk26ZSWggqafxcvFh536fPZxP6IX FFtJriPvoPVV9Iwy8SVmT9D+wqraYaVdwiMftGBoY7CjRqAEzKJp3rRYhBttvPzxUgcFfZ7LWZz7+C5E+ATQJ4NVbu2ivUOREczi/+nm14uSBRe7OtxhdJeT yVuWBaBp6KVI86Mvu4JieGxT5NJUDM3ARnqinpG274QxxSROJiBjAPMIazEmBc5iX8kAMjKOx+5phGzg8WobsV1YPleKsfAy79aF2TFUfFzscQNHjLyDiSZ4 Q3QnciKSTzPC25uvgctKRDp2aWsNOgyE6wkjOLZPlXbVmCTxourTeuyeMnEJDfiF5P39NJNo8Jra7YxuLC40UMjO2rAsuNxHTUyZH0SBfKMIk5U6rIz5mpoi MA5F8KMPytL+bca2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Apr 2018, Mikulas Patocka wrote: > This patch introduces a flag SLAB_MINIMIZE_WASTE for slab and slub. This > flag causes allocation of larger slab caches in order to minimize wasted > space. > > This is needed because we want to use dm-bufio for deduplication index and > there are existing installations with non-power-of-two block sizes (such > as 640KB). The performance of the whole solution depends on efficient > memory use, so we must waste as little memory as possible. Hmmm. Can we come up with a generic solution instead? This may mean relaxing the enforcement of the allocation max order a bit so that we can get dense allocation through higher order allocs. But then higher order allocs are generally seen as problematic. Note that SLUB will fall back to smallest order already if a failure occurs so increasing slub_max_order may not be that much of an issue. Maybe drop the max order limit completely and use MAX_ORDER instead? That means that callers need to be able to tolerate failures.