Thread (7 messages) flat view 7 messages, 2 authors, 2013-05-28

[PATCH 3/3 v3] net/macb: Try to optimize struct macb layout

From: David Laight <hidden>
Date: 2013-05-15 09:40:04
Also in: lkml, netdev

Move TX-related fields to the top of the struct so that they end up on
the same cache line. Move the NAPI struct below that since it is used
from the interrupt handler. This field is also marked as
___cacheline_aligned_in_smp.
RX-related fields go below those.
Function pointers and capability mask are immediately after that as
they are also used in the hot path.

Move the spinlock before regs since they are usually used together.
Haven't you introduced some holes in the structure?
I suspect that spinloack_t might only be 32bits on
some 64bit systems.
There is certainly one where 'caps' used to be.

...> 
 struct macb {
+	spinlock_t		lock;
 	void __iomem		*regs;
...
+	struct macb_or_gem_ops	macbgem_ops;
+
+	u32			caps;

-	spinlock_t		lock;
 	struct platform_device	*pdev;
	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help