Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1895518ybn; Thu, 26 Sep 2019 03:58:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYSGo7rnV3LFcd85GFp8KgfR0PAeEbSf++jUPF8Juvo4raFXPftaBv1ebc4JuWnmI14tlp X-Received: by 2002:a50:cf0d:: with SMTP id c13mr2756115edk.125.1569495502890; Thu, 26 Sep 2019 03:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569495502; cv=none; d=google.com; s=arc-20160816; b=dcVcb5PPC1jBcV1K7QC03I2zN3mLxTCOtjV5eEKd2ggcpiTwH0T8hmR9nGcHb7lrFg LSMWWYDCDF6havyIu6Z5nAx/SjhTKuFFEkSeOAJOe3Li92lj9ZfbdmlwVUtkeuxuJFX9 ORFP6i4lFXDNRugAi1Mqqb4325IVWkFIBm31+588rm1x5DKKf76pjWvdAVXOVsKFWPyz Wup01XfVYJNWjQoIOwgKmiRHgFW87dJ1Yg61oaNYwWQ9Q4bP2ziRC9+V16w+yLXTEqBh zoGbmyISZ1TfbjmptRkkKF+ISatySSg8NZnrlln3YHBmWuwXFbn7Y7INiZExE41mmDUF v80g== 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; bh=Drc8th39iLxrWopPLyCT40mWIhwDNwUBOkfNzNsHPkQ=; b=hx90fqYdayKZBTJMeZQ5kI69XgO/DW+SgZ8y0OKv2bSZMemfk8fDO8DXp+U6z/PsFR nfxApwjKAJubUHq+zXToNBzXVulPYcsAjOV/WchUZw2Kn52ErhkqbWjbelnb/AcMyRyg 2Gnsdt7B87W0bjI4j39RdpSdJWSTJtc3m8SHPsPZ0ywYLtWFVECrf+IqWI4KQxrGdDVk ypOpq4eTqK1XGsX6hqp4ij5VTmXBnhyAUTH81trVLeqGMOQhLzD55Kwt2sAkzgiYjIEa PhyKL2Z36SVJgUP8zTC7dvEGym47U+/2RJItN6600itv94VzRYbjdRNW9YW4B3meQjOq kLQQ== 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 5si1142320edy.95.2019.09.26.03.57.59; Thu, 26 Sep 2019 03:58:22 -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 S2387736AbfIZAOp (ORCPT + 99 others); Wed, 25 Sep 2019 20:14:45 -0400 Received: from gentwo.org ([3.19.106.255]:49630 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733141AbfIZAOp (ORCPT ); Wed, 25 Sep 2019 20:14:45 -0400 Received: by gentwo.org (Postfix, from userid 1002) id 17D1D3EEC6; Thu, 26 Sep 2019 00:14:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 150213E86C; Thu, 26 Sep 2019 00:14:44 +0000 (UTC) Date: Thu, 26 Sep 2019 00:14:44 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Andrew Morton cc: David Sterba , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Pekka Enberg , David Rientjes , Ming Lei , Dave Chinner , Matthew Wilcox , "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, Roman Gushchin , Johannes Weiner Subject: Re: [PATCH v2 2/2] mm, sl[aou]b: guarantee natural alignment for kmalloc(power-of-two) In-Reply-To: <20190924165425.a79a2dafbaf37828a931df2b@linux-foundation.org> Message-ID: References: <20190826111627.7505-1-vbabka@suse.cz> <20190826111627.7505-3-vbabka@suse.cz> <20190923171710.GN2751@twin.jikos.cz> <20190924165425.a79a2dafbaf37828a931df2b@linux-foundation.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Sep 2019, Andrew Morton wrote: > I agree it's a bit regrettable to do this but it does appear that the > change will make the kernel overall a better place given the reality of > kernel development. No it wont. - It will only work for special cases like the kmalloc array without extras like metadata at the end of objects. - It will be an inconsistency in the alignments provided by the allocator. - It will cause us in the future to constantly consider these exceptional alignments in the maintenance of the allocators. - These alignments are only needed in exceptional cases but with the patch we will provide the alignment by default even if the allocating subsystem does not need it. - We have mechanisms to detect alignment problems using debug kernels and debug options that have been available for years. These were not used for testing in these cases it seems before the patches hit mainline. Once in mainly someone ran a debug kernel and found the issue. > Given this, have you reviewed the patch for overall implementation > correctness? Yes, the patch is fine. > I'm wondering if we can avoid at least some of the patch's overhead if > slab debugging is disabled - the allocators are already returning > suitably aligned memory, so why add the new code in that case? As far as I know this patch is not needed given that we have had the standards for alignments for a long time now. Why would the allocators provide specially aligned memory just based on the size of an object? This is weird and unexpected behavior.