diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2010-05-25 23:53:07 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-07-06 22:33:56 -0400 |
commit | c45b5c097001480e66d4c523eb715ad317a4ef77 (patch) | |
tree | 5b9415840b97a724537273db99b2c66975c63347 /drivers/acpi/acpica/nswalk.c | |
parent | 5821f75421aa7c7bafdec291223153597f649934 (diff) |
ACPICA: Performance enhancement for namespace search and access
This change enhances the performance of namespace searches and
walks by adding a backpointer to the parent in each namespace
node. On large namespaces, this change can improve overall ACPI
performance by up to 9X. Adding a pointer to each namespace node
increases the overall size of the internal namespace by about 5%,
since each namespace entry usually consists of both a namespace
node and an ACPI operand object.
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/nswalk.c')
-rw-r--r-- | drivers/acpi/acpica/nswalk.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c index 00e79fb26029..2cd5be8fe10f 100644 --- a/drivers/acpi/acpica/nswalk.c +++ b/drivers/acpi/acpica/nswalk.c | |||
@@ -79,15 +79,6 @@ struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node | |||
79 | return parent_node->child; | 79 | return parent_node->child; |
80 | } | 80 | } |
81 | 81 | ||
82 | /* | ||
83 | * Get the next node. | ||
84 | * | ||
85 | * If we are at the end of this peer list, return NULL | ||
86 | */ | ||
87 | if (child_node->flags & ANOBJ_END_OF_PEER_LIST) { | ||
88 | return NULL; | ||
89 | } | ||
90 | |||
91 | /* Otherwise just return the next peer */ | 82 | /* Otherwise just return the next peer */ |
92 | 83 | ||
93 | return child_node->peer; | 84 | return child_node->peer; |
@@ -146,9 +137,9 @@ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type, | |||
146 | return (next_node); | 137 | return (next_node); |
147 | } | 138 | } |
148 | 139 | ||
149 | /* Otherwise, move on to the next node */ | 140 | /* Otherwise, move on to the next peer node */ |
150 | 141 | ||
151 | next_node = acpi_ns_get_next_valid_node(next_node); | 142 | next_node = next_node->peer; |
152 | } | 143 | } |
153 | 144 | ||
154 | /* Not found */ | 145 | /* Not found */ |
@@ -355,7 +346,7 @@ acpi_ns_walk_namespace(acpi_object_type type, | |||
355 | */ | 346 | */ |
356 | level--; | 347 | level--; |
357 | child_node = parent_node; | 348 | child_node = parent_node; |
358 | parent_node = acpi_ns_get_parent_node(parent_node); | 349 | parent_node = parent_node->parent; |
359 | 350 | ||
360 | node_previously_visited = TRUE; | 351 | node_previously_visited = TRUE; |
361 | } | 352 | } |