[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1909260005060.1508@www.lameter.com>
Date: Thu, 26 Sep 2019 00:14:44 +0000 (UTC)
From: Christopher Lameter <cl@...ux.com>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: David Sterba <dsterba@...e.cz>, Vlastimil Babka <vbabka@...e.cz>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Ming Lei <ming.lei@...hat.com>,
Dave Chinner <david@...morbit.com>,
Matthew Wilcox <willy@...radead.org>,
"Darrick J . Wong" <darrick.wong@...cle.com>,
Christoph Hellwig <hch@....de>, linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
James Bottomley <James.Bottomley@...senPartnership.com>,
linux-btrfs@...r.kernel.org, Roman Gushchin <guro@...com>,
Johannes Weiner <hannes@...xchg.org>
Subject: Re: [PATCH v2 2/2] mm, sl[aou]b: guarantee natural alignment for
kmalloc(power-of-two)
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.
Powered by blists - more mailing lists