Thread (19 messages) 19 messages, 6 authors, 2011-06-23

Re: [PATCH] slob: push the min alignment to long long

From: Matt Mackall <hidden>
Date: 2011-06-15 20:55:59

On Wed, 2011-06-15 at 23:40 +0300, Pekka Enberg wrote:
On Wed, Jun 15, 2011 at 11:24 PM, Matt Mackall [off-list ref] wrote:
quoted
On Wed, 2011-06-15 at 22:12 +0200, Sebastian Andrzej Siewior wrote:
quoted
* Matt Mackall | 2011-06-14 17:05:40 [-0500]:
quoted
Ok, so you claim that ARCH_KMALLOC_MINALIGN is not set on some
architectures, and thus SLOB does the wrong thing.

Doesn't that rather obviously mean that the affected architectures
should define ARCH_KMALLOC_MINALIGN? Because, well, they have an
"architecture-specific minimum kmalloc alignment"?
nope, if nothing is defined SLOB asumes that alignment of long is the way
go. Unfortunately alignment of u64 maybe larger than of u32.
I understand that. I guess we have a different idea of what constitutes
"architecture-specific" and what constitutes "normal".

But I guess I can be persuaded that most architectures now expect 64-bit
alignment of u64s.
Changing the alignment for everyone is likely to cause less problems
in the future. Matt, are there any practical reasons why we shouldn't
do that?
Unless you audit all architectures to check that things are sensible,
it's a trade: regressing performance on one arch to improve correctness
on another. On the one hand, regressions trump improvement. On the
other, correctness trumps performance.

In general, I think the right thing is to require every arch to
explicitly document its alignment requirements via defines in the kernel
headers so that random hackers don't have to scour the internet for
datasheets on obscure architectures they don't care about. We should
have no defaults and refuse to compile on any arch that doesn't have the
define which will ensure someone somewhere actually thinks about it for
each arch.

But as I don't have time to push that vision, I'll let it slide.

-- 
Mathematics is the supreme nostalgia of our time.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help