Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2556415ybl; Sat, 31 Aug 2019 18:03:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqw92eSZ76O0hj3dkZ+WCct+/H0xr1xLMasDTxNasqY+VLxQxam+Bh3b1g3a7HeJU2mC7mJG X-Received: by 2002:a17:90a:ca0e:: with SMTP id x14mr5199209pjt.70.1567299793164; Sat, 31 Aug 2019 18:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567299793; cv=none; d=google.com; s=arc-20160816; b=GPnqXJ7FUrBjw7jI9CJbOKk3Loz4p0FmQNzOeO8O6nma2/yIy1ijCxo7kzXf2BtTXp kwEi13wZVU9xyEuCoA681luOBaQWkEE3uxF9ZWXJnlbZQhovb7A48wbVim/5ZuKin8F8 D65KQIPv4S/ZsXlUxh+GslrmOdujl9UsKoCIBbkU99kk+iY7PGxNd2DUO4/y5fmX+PDq WOoTky8C6dtwC0ahXsw34A7N+ok/P//x0/W2L2b1kqfw5iZzLyoiBv9uGEXLXDXJhcFU wQ21joG+id9vS9Thq0aZbF0EnUWJ/e+X/YU2z6lEvjzVIaq3PK3HHLLoCCPCG62SFrDM +nSA== 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:dkim-signature; bh=jXXM66EKtvmEAYvb1Llji9/A136eINaxlL5uqBe0OBY=; b=IZXF6BshFm207iWtwDFuuvpmu7+9WmqOqAKwzPN+dEjwG99s20K1+ZRsoBI9a2Za6F PJjzJ8ey0THPD5czR0/N91JRpG5Tv0ng3/Y6DHOFVvTVAJdnAa2uhdZkwTJYl7H3NCzd JVbEpY1/Lo59uJB1LL4Q0VMJzaj0LrUmbEnOi2I428AmwJcNp8OAZGhRLZhKcmi2mrzz bz4T3PeAfovuqK85Soet5HfcLGQl+VexITlnAuR2Uf7RyExVIe68UE4iuAYyNVidFgaG mbbNDqaL+40Us0Zqgr6YMRy3T3HiC1iNGK/LDj7G5/vXwqicy2mgWKAHVk6Ui1OM/fBC 0Jxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eBz5M1QV; 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 f6si8024792pgs.326.2019.08.31.18.01.55; Sat, 31 Aug 2019 18:03:13 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eBz5M1QV; 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 S1728599AbfIAAwM (ORCPT + 99 others); Sat, 31 Aug 2019 20:52:12 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56238 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfIAAwL (ORCPT ); Sat, 31 Aug 2019 20:52:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jXXM66EKtvmEAYvb1Llji9/A136eINaxlL5uqBe0OBY=; b=eBz5M1QVpKJZMQDzXUQ9MXhMT rIK2EkzUbSraojFclMxJ7OU+sf7tbq9mwzo0REl3yaDUt2YpbGdUBXr1PBULu2aic9sZuNzSPwoCp owngjkSk9HrwVrtscNCYj+aZ/17/cGG88hXmrwj3PKy0BJCvg4ElKAVolJU/MnnAZSwlpMqAmc62e AMUhgpKdATQQ056Kf77qv58BUxrXE6ktixwa0beiRV9gpk+ZAtbCCa1VAH88gCyyf5jTc6PxLSazv wV7o8Fq43JPBfe5nZRIUcQcvYRvRzMraHjUnFk9kNgyg6rLAwcalK0UgYckSGwX3KhjlxftyTplES EIwb3V+yg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1i4E69-0007JD-OE; Sun, 01 Sep 2019 00:52:05 +0000 Date: Sat, 31 Aug 2019 17:52:05 -0700 From: Matthew Wilcox To: Christopher Lameter Cc: Michal Hocko , 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: <20190901005205.GA2431@bombadil.infradead.org> 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> <20190829073921.GA21880@dhcp22.suse.cz> <0100016ce39e6bb9-ad20e033-f3f4-4e6d-85d6-87e7d07823ae-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0100016ce39e6bb9-ad20e033-f3f4-4e6d-85d6-87e7d07823ae-000000@email.amazonses.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 30, 2019 at 05:41:46PM +0000, Christopher Lameter wrote: > On Thu, 29 Aug 2019, Michal Hocko wrote: > > > 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. > > The current behavior without special alignment for these caches has been > in the wild for over a decade. And this is now coming up? In the wild ... and rarely enabled. When it is enabled, it may or may not be noticed as data corruption, or tripping other debugging asserts. Users then turn off the rare debugging option. > There is one case now it seems with a broken hardware that has issues and > we now move to an alignment requirement from the slabs with exceptions and > this and that? Perhaps you could try reading what hasa been written instead of sticking to a strawman of your own invention? > If there is an exceptional alignment requirement then that needs to be > communicated to the allocator. A special flag or create a special > kmem_cache or something. The only way I'd agree to that is if we deliberately misalign every allocation that doesn't have this special flag set. Because right now, breakage happens everywhere when these debug options are enabled, and the very people who need to be helped are being hurt by the debugging.