Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1779928ybn; Thu, 26 Sep 2019 02:02:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9j+Aa/DhGp1Y7ZCl4aELFgNvkJnkEem76Y0Lcc+ffCFrZLGswjCo68iJQleyRFxdOWcCe X-Received: by 2002:a17:907:4242:: with SMTP id np2mr2122285ejb.102.1569488562750; Thu, 26 Sep 2019 02:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569488562; cv=none; d=google.com; s=arc-20160816; b=i4FYOR7kM+1JPreF8TtRG4yghYeDU1jMeiuAYJNCwO9RChQG1A1TlOcUAfG8q+xKQ6 55IN8GZDKazzudGnM/h3KwxbYPNijpWdKasVgzZxC/FmfcIpozGuVGGb/fnE+t8NZCqY SIPz9o8jTR2+2n/VoNjBWdWvDXVjKZSeciWXic82Ae1PlozqTrkKMEYbswNjwwJMTWdP m+G/RiUbB3aAdJHmjOVtwZKC+CyF6cCpfKjHVQHpKOoEtHwhh8QQWZSb3kGHuBNJobut v5SxT1hpW4RyHItXKNt6O+edGtNUGwiZSINAFcY5tScUJ88104u1tLsEwKx2NLSlAxXN wLTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=I/RyDT8Icek+ONGjk0khIfTC1eYTOj/9pRywFOXW+2A=; b=keWnNBc7pQVByacdQmbTcxL6nRbl8MSOB8jlEIeHrvDn68QLE5nBAcT7nQboQ1VTCq QHiUnCPJsv5vdWV41HHsnjXoP+J3dX/CLBB84adPmv1mVgGtAgPu8fWGDJBeEMBsKdy6 G9E/wsq2dLcuEr2WsCpmAfKqw6KsXRTGbyxJdguxNm1owTpu34lpUDWY5nzXDeLgfmQK 8D8sRSS3aXfa7GdLd6IIAlh6VM4jV5IoVi/Lmf79ae82t1JuwOP/ZCjeJxUECMakC1yk 0ZufWn9PgQXyMKLFC/iGXqzVT7zaGcbOVW9I4iuvGsbtHcV3im7hZuRKDXf5amm478YK m1eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CFO304w0; 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 l18si687810ejg.248.2019.09.26.02.02.13; Thu, 26 Sep 2019 02:02:42 -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=@kernel.org header.s=default header.b=CFO304w0; 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 S2442141AbfIXXy2 (ORCPT + 99 others); Tue, 24 Sep 2019 19:54:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:35052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442070AbfIXXy1 (ORCPT ); Tue, 24 Sep 2019 19:54:27 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 347D8206DD; Tue, 24 Sep 2019 23:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569369266; bh=77LgG7sH8ZOfn/RzxREA78GWTNS60M2eU3Gg2LZZdpg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CFO304w0y4Fr7/j+umJCvtwPWv7SS5ZLtX3xcGFmOMnWdGOFDsQHVh3Dg/H0OkPSm VuUbswWYLalvFIXCA8dOGD6gAsdrEfG47lwYmUHNWLai2zcWU6tC/nScCvlXG9rvyO NliXcizh1hyn+s2NY5x+Vc48EG5aI2akmcTSgqLM= Date: Tue, 24 Sep 2019 16:54:25 -0700 From: Andrew Morton To: cl@linux.com 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) Message-Id: <20190924165425.a79a2dafbaf37828a931df2b@linux-foundation.org> In-Reply-To: References: <20190826111627.7505-1-vbabka@suse.cz> <20190826111627.7505-3-vbabka@suse.cz> <20190923171710.GN2751@twin.jikos.cz> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Sep 2019 20:52:52 +0000 (UTC) cl@linux.com wrote: > On Mon, 23 Sep 2019, David Sterba wrote: > > > As a user of the allocator interface in filesystem, I'd like to see a > > more generic way to address the alignment guarantees so we don't have to > > apply workarounds like 3acd48507dc43eeeb each time we find that we > > missed something. (Where 'missed' might be another sort of weird memory > > corruption hard to trigger.) > > The alignment guarantees are clearly documented and objects are misaligned > in debugging kernels. > > Looking at 3acd48507dc43eeeb:Looks like no one tested that patch with a > debug kernel or full debugging on until it hit mainline. Not good. > > The consequence for the lack of proper testing is to make the production > kernel contain the debug measures? This isn't a debug measure - it's making the interface do that which people evidently expect it to do. Minor point. 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. Given this, have you reviewed the patch for overall implementation correctness? 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?