mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.6 RPAPHP structure size/performance
@ 2004-07-02 16:21 linas
  2004-07-02 20:56 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: linas @ 2004-07-02 16:21 UTC (permalink / raw)
  To: Greg KH; +Cc: inuxppc64-dev, linux-kernel, pcihpd-discuss

[-- Attachment #1: Type: text/plain, Size: 679 bytes --]


Hi Greg,

Please review and apply the following patch if you find it agreeable.

This patch does not make any functional changes, but does improve
both performance and memory usage by rearranging structure elements.

The need for these changes became appearent during a code review of
the disassembly involving this structure. The memory footprint of this
structure is made smaller by grouping the byte fields next to each other.
The access of the list_head can be simplified by making it the first element
of the structure, thus avoiding a needless add-immediate without negatively
impacting any of the other accesses.

Signed-off-by: Linas Vepstas <linas@linas.org>

--linas 

[-- Attachment #2: rpaphp.h.patch --]
[-- Type: text/plain, Size: 927 bytes --]

--- drivers/pci/hotplug/rpaphp.h.orig	2004-06-18 16:10:47.000000000 -0500
+++ drivers/pci/hotplug/rpaphp.h	2004-06-23 13:28:20.000000000 -0500
@@ -85,6 +85,7 @@ struct rpaphp_pci_func {
  * struct slot - slot information for each *physical* slot
  */
 struct slot {
+	struct list_head rpaphp_slot_list;
 	int state;
 	u32 index;
 	u32 type;
@@ -92,6 +93,7 @@ struct slot {
 	char *name;
 	char *location;
 	u8 removable;
+	u8 dev_type;		/* VIO or PCI */
 	struct device_node *dn;	/* slot's device_node in OFDT */
 				/* dn has phb info */
 	struct pci_dev *bridge;	/* slot's pci_dev in pci_devices */
@@ -99,9 +101,7 @@ struct slot {
 		struct list_head pci_funcs; /* pci_devs in PCI slot */ 
 		struct vio_dev *vio_dev; /* vio_dev in VIO slot */
 	} dev;
-	u8 dev_type;		/* VIO or PCI */
 	struct hotplug_slot *hotplug_slot;
-	struct list_head rpaphp_slot_list;
 };
 
 extern struct hotplug_slot_ops rpaphp_hotplug_slot_ops;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] 2.6 RPAPHP structure size/performance
  2004-07-02 16:21 [PATCH] 2.6 RPAPHP structure size/performance linas
@ 2004-07-02 20:56 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-07-02 20:56 UTC (permalink / raw)
  To: linas; +Cc: inuxppc64-dev, linux-kernel, pcihpd-discuss

On Fri, Jul 02, 2004 at 11:21:54AM -0500, linas@austin.ibm.com wrote:
> 
> Hi Greg,
> 
> Please review and apply the following patch if you find it agreeable.
> 
> This patch does not make any functional changes, but does improve
> both performance and memory usage by rearranging structure elements.
> 
> The need for these changes became appearent during a code review of
> the disassembly involving this structure. The memory footprint of this
> structure is made smaller by grouping the byte fields next to each other.
> The access of the list_head can be simplified by making it the first element
> of the structure, thus avoiding a needless add-immediate without negatively
> impacting any of the other accesses.
> 
> Signed-off-by: Linas Vepstas <linas@linas.org>

Applied, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-02 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02 16:21 [PATCH] 2.6 RPAPHP structure size/performance linas
2004-07-02 20:56 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®