aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2010-05-26 01:59:51 -0400
committerLen Brown <len.brown@intel.com>2010-07-06 22:33:57 -0400
commita9fc03125ea0001ff18bc29da9539b587fdbd1d7 (patch)
tree721b794d27aa84780c8e8f0e01d2119713b01ca7 /drivers/acpi/acpica
parent20d33aea7ae7ad858f3f91c834d9043cd8122d38 (diff)
ACPICA: Optimization: Reduce the number of namespace walks
On control method exit, only walk the namespace if the method is known to have created namespace objects outside of its local scope. 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')
-rw-r--r--drivers/acpi/acpica/dsmethod.c18
-rw-r--r--drivers/acpi/acpica/nsalloc.c20
2 files changed, 32 insertions, 6 deletions
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 00846333773e..64750ee96e20 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -584,8 +584,22 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
584 * want make the objects permanent. 584 * want make the objects permanent.
585 */ 585 */
586 if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) { 586 if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) {
587 acpi_ns_delete_namespace_by_owner(method_desc->method. 587
588 owner_id); 588 /* Delete any direct children of (created by) this method */
589
590 acpi_ns_delete_namespace_subtree(walk_state->
591 method_node);
592
593 /*
594 * Delete any objects that were created by this method
595 * elsewhere in the namespace (if any were created).
596 */
597 if (method_desc->method.
598 flags & AOPOBJ_MODIFIED_NAMESPACE) {
599 acpi_ns_delete_namespace_by_owner(method_desc->
600 method.
601 owner_id);
602 }
589 } 603 }
590 } 604 }
591 605
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c
index 8d3a43a061ab..1e5ff803d9ad 100644
--- a/drivers/acpi/acpica/nsalloc.c
+++ b/drivers/acpi/acpica/nsalloc.c
@@ -219,12 +219,24 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp
219 219
220 ACPI_FUNCTION_TRACE(ns_install_node); 220 ACPI_FUNCTION_TRACE(ns_install_node);
221 221
222 /*
223 * Get the owner ID from the Walk state. The owner ID is used to track
224 * table deletion and deletion of objects created by methods.
225 */
226 if (walk_state) { 222 if (walk_state) {
223 /*
224 * Get the owner ID from the Walk state. The owner ID is used to
225 * track table deletion and deletion of objects created by methods.
226 */
227 owner_id = walk_state->owner_id; 227 owner_id = walk_state->owner_id;
228
229 if ((walk_state->method_desc) &&
230 (parent_node != walk_state->method_node)) {
231 /*
232 * A method is creating a new node that is not a child of the
233 * method (it is non-local). Mark the executing method as having
234 * modified the namespace. This is used for cleanup when the
235 * method exits.
236 */
237 walk_state->method_desc->method.flags |=
238 AOPOBJ_MODIFIED_NAMESPACE;
239 }
228 } 240 }
229 241
230 /* Link the new entry into the parent and existing children */ 242 /* Link the new entry into the parent and existing children */