Received: by 2002:a17:90a:b81:0:0:0:0 with SMTP id 1csp979912pjr; Fri, 30 Aug 2019 10:42:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd/HxUWWj7WWYRnZ/vVqVY6ncNVtWxkzOeKkrgcvNIovD7md/Yj6pESqgeeQUJLH5xK6SE X-Received: by 2002:a17:902:33c1:: with SMTP id b59mr17150964plc.104.1567186978426; Fri, 30 Aug 2019 10:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567186978; cv=none; d=google.com; s=arc-20160816; b=sILnIZjqxor8rOWmqwE+2/oIMtegA3VB0zfrrjPK+9u2/O2pqJSkaR6UX2t9Sd0RLY XsqnyBmn9gHI6ki3ysto9UT432jKZTESJ8jaSsmdNA6mxIb/TyXobSP5S+NCrnXeGrk0 bVeRK9DrnVCETzJfZR//+mB8QY70rl8UseHVvnfys3QGTsyIuHV9rpm/z599t6Nh3CS6 Vz320EXexGQ2atKCJCAGgP5xOHV4jwWSebKO0IWq9K6syTgQ6SW0zto6MeEMr8dok7U9 Pmat/21+l/UPxWq1mlqEZRDASJpIUA4JXlFIC+PFMNXhiwYCoETQ6A5LyHUep01W9hcN o9Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=2d73kXzzJqKCJDTvOe39g1zeY/e9ED8jtphRsm63DEk=; b=zbtidUZUe3iQIN+GzXocJVTW72MXyD/UsZuNJ1Dbbl63wn2bz1Tu31pQTfKq5LYotu 99wyyIWHePjfrT05D7N5otaY3LsLLU2CR1gGwAJyQhGk9IkQjMoWZ2Wlq+v4lntuoAg0 Q9pjc5FRvkdpXDMlPEcm+kXXj7D1VAU1LXBj0K3jh40AlXnzT+6nY/LTonPFwLKNKOnf 8zPvNNfw/uBYjyV3C/HXgA9/vdlaga1EsyIKVaFWmNmfohMXx04yMDXNoI0i1A+Vc0R+ DLooyNCU/9uxWYemoPNvU4HOFoJ+c30hv4aFWaObqOgPofuc/DyKgBAhtorqTgqPyOGf bvYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b="jOwxuN0/"; 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 k3si4931475pgs.223.2019.08.30.10.42.41; Fri, 30 Aug 2019 10:42:58 -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=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b="jOwxuN0/"; 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 S1728058AbfH3Rls (ORCPT + 99 others); Fri, 30 Aug 2019 13:41:48 -0400 Received: from a9-46.smtp-out.amazonses.com ([54.240.9.46]:43362 "EHLO a9-46.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727914AbfH3Rlr (ORCPT ); Fri, 30 Aug 2019 13:41:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1567186906; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=O4l8bfyB+VvL+95TNWx4FpZqRMWRe8LWpmXp151rZPQ=; b=jOwxuN0/GsY64oKXgfJmdwBB+AXtX2WpGHqJuhQjx2ptbH8DVIIqkqyXxRD8yOn8 GV8ejswyFu4wYPPvC5trc2TJ+u/8YK8DHJOysSHUEOvy5EY/yEQJyv85OgQB3tVrNRO oEjKdNcHWMyjIds//broy3iaTxgNIeqHLNuDl3dY= Date: Fri, 30 Aug 2019 17:41:46 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Michal Hocko cc: Matthew Wilcox , 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) In-Reply-To: <20190829073921.GA21880@dhcp22.suse.cz> Message-ID: <0100016ce39e6bb9-ad20e033-f3f4-4e6d-85d6-87e7d07823ae-000000@email.amazonses.com> 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> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.08.30-54.240.9.46 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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? 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.