random: reorder struct entropy_store to remove padding on 64bits
PATCH 1/1 random: reorder struct entropy_store to remove padding on 64bits
Re-order structure entropy_store to remove 8 bytes of padding on 64 bit builds, so shrinking this structure from 72 to 64 bytes and allowing it to fit into one cache line.
---
patch against v2.6.35-rc6
built & tested on x86_64
regards
Richard
drivers/char/random.c +1 -1
@@ -407,8 +407,8 @@ struct entropy_store {struct poolinfo *poolinfo;__u32 *pool;const char *name; -int limit;struct entropy_store *pull; +int limit;/* read-write data: */ spinlock_t lock;
Quoted 3 lines · Richard Kennedy
Re-order structure
entropy_storeto remove 8 bytes of padding on 64 bit builds, so shrinking this structure from 72 to 64 bytes and allowing it to fit into one cache line.
I have a vague memory that we reordered things so that the r/w bits would be on a separate cache line than the r/o bits. But as we never added the alignment primitives to actually enforce that, I guess it doesn't matter much.
Quoted 1 line
Signed-off-by Richard Kennedy <[email protected]>
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Quoted 5 lines · Matt Mackall
Quoted 3 lines · Richard Kennedy
Re-order structure
entropy_storeto remove 8 bytes of padding on 64 bit builds, so shrinking this structure from 72 to 64 bytes and allowing it to fit into one cache line.
Quoted 8 lines
I have a vague memory that we reordered things so that the r/w bits would be on a separate cache line than the r/o bits. But as we never added the alignment primitives to actually enforce that, I guess it doesn't matter much.
Quoted 1 line
Signed-off-by Richard Kennedy <[email protected]>Signed-off-by Matt Mackall <[email protected]>
Patch applied. Thanks!
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 11 lines · Herbert Xu
Quoted 10 lines · Matt Mackall
Quoted 3 lines · Richard Kennedy
Re-order structure
entropy_storeto remove 8 bytes of padding on 64 bit builds, so shrinking this structure from 72 to 64 bytes and allowing it to fit into one cache line.I have a vague memory that we reordered things so that the r/w bits would be on a separate cache line than the r/o bits. But as we never added the alignment primitives to actually enforce that, I guess it doesn't matter much.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Richard Kennedy <[email protected]>Signed-off-by Matt Mackall <[email protected]>Patch applied. Thanks!
Oops, I forgot to cc: you on this and Andrew queued it. Andrew, I've been queueing the RNG bits through Herbert's crypto tree lately.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Quoted 3 lines · Matt Mackall
Oops, I forgot to cc: you on this and Andrew queued it. Andrew, I've been queueing the RNG bits through Herbert's crypto tree lately.
I think Andrew's scripts are clever enough to remove patches once they show up in another tree.
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt