Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1929042ybl; Thu, 29 Aug 2019 00:40:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6u6/y25dsK7rPAwo3HiSFGJs825nwVTVd2R2z8/9WrZbfYYe7ywGTJbA772z3bXRTcNfm X-Received: by 2002:a62:174a:: with SMTP id 71mr9923315pfx.140.1567064452933; Thu, 29 Aug 2019 00:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567064452; cv=none; d=google.com; s=arc-20160816; b=IMhPBCzKTjguf+u8TXgXSZa5LztyIFK3bWD9bovE2R2hUkWrFtnTxAgD1DNXcya/sS n64whdpE9F/GTGCbmg2rS+mWUX7CtAVg2XwgzNrBXiXX+ABo99HBpd4HXVcui30lgThO ZvTHHWMqTC8QAyd3KIwzj1oIQbeRFasgweFoYtoCenwxbxzEeQcZihrkYiBHCVuBNkjS wesO5MAS0y7qNOMau/ro5XwNBPmenE83YbXWXW6ss4WVBjmrglpfTZewpMXuX9dgOXQf hx3DV6jVcnpFqNnGpLbLc1/nGHRVKmIopr8plXREv6SUtRHuIja2+imNmkLZnMfCHYpg VZ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bawjrTo9u4dhtI/EmZBXOzrxYmTJ0Wm6sxlXMRZ6Hp4=; b=0+WXVwB0WearNBZIl8bM+rIwwROyDWDgpJgXF3Z36Bbe/zUFgC1yUb3A1hWEIpEkSK 7b+3GIQXoMurZMzEb4p/0t+MazIL5R68ufXFXzc6FtjD7hMI8GVK0wOAKOkG+Cw3uK8t 2pCcHGu2a3Bghi1j/dqsxl/2AGXv6BUiCm6jSZeRlioOo2V1F8Lqqim0Wnwyvli+nGyq 0kpg2WytdsDWMHTQtNt5Df59O8gZaQN/cPvMs89xlLpyXndeBdQSjS2VPzfo6mSXnaGG YnfpnSnvXOVd+0TJ/V9v2U0bApYR5NgiTcm0BviD5/Hs1ILr10Rg9kKGUyKKVWJBQozf JPow== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si1263824pgv.497.2019.08.29.00.40.37; Thu, 29 Aug 2019 00:40:52 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727639AbfH2HjY (ORCPT + 99 others); Thu, 29 Aug 2019 03:39:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:44172 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726330AbfH2HjY (ORCPT ); Thu, 29 Aug 2019 03:39:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 78FB3B03B; Thu, 29 Aug 2019 07:39:22 +0000 (UTC) Date: Thu, 29 Aug 2019 09:39:21 +0200 From: Michal Hocko To: Matthew Wilcox Cc: Christopher Lameter , Vlastimil Babka , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pekka Enberg , David Rientjes , Ming Lei , Dave Chinner , "Darrick J . Wong" , Christoph Hellwig , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, James Bottomley , linux-btrfs@vger.kernel.org Subject: Re: [PATCH v2 2/2] mm, sl[aou]b: guarantee natural alignment for kmalloc(power-of-two) Message-ID: <20190829073921.GA21880@dhcp22.suse.cz> References: <20190826111627.7505-1-vbabka@suse.cz> <20190826111627.7505-3-vbabka@suse.cz> <0100016cd98bb2c1-a2af7539-706f-47ba-a68e-5f6a91f2f495-000000@email.amazonses.com> <20190828194607.GB6590@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190828194607.GB6590@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 28-08-19 12:46:08, Matthew Wilcox wrote: > On Wed, Aug 28, 2019 at 06:45:07PM +0000, Christopher Lameter wrote: [...] > > be suprising and it limits the optimizations that slab allocators may use > > for optimizing data use. The SLOB allocator was designed in such a way > > that data wastage is limited. The changes here sabotage that goal and show > > that future slab allocators may be similarly constrained with the > > exceptional alignents implemented. Additional debugging features etc etc > > must all support the exceptional alignment requirements. > > While I sympathise with the poor programmer who has to write the > fourth implementation of the sl*b interface, it's more for the pain of > picking a new letter than the pain of needing to honour the alignment > of allocations. > > There are many places in the kernel which assume alignment. They break > when it's not supplied. I believe we have a better overall system if > the MM developers provide stronger guarantees than the MM consumers have > to work around only weak guarantees. I absolutely agree. A hypothetical benefit of a new implementation doesn't outweigh the complexity the existing code has to jump over or worse is not aware of and it is broken silently. My general experience is that the later is more likely with a large variety of drivers we have in the tree and odd things they do in general. -- Michal Hocko SUSE Labs