Message ID | 1242029667.4641.31.camel@minggr.sh.intel.com (mailing list archive) |
---|---|
State | RFC, archived |
Headers | show |
Removing the cache has exposed a couple of bugs that we are currently working on. We need to make sure that we pass the ASLTS suite before the code is integrated/released. Bob >-----Original Message----- >From: Lin, Ming M >Sent: Monday, May 11, 2009 1:14 AM >To: Alexey Starikovskiy >Cc: Moore, Robert; Linux-acpi@vger.kernel.org >Subject: Re: [PATCH 1/4] ACPICA: Remove use of caches in controlled way > >Hi, Alexey > >The attachment are the linuxized version of your patches. >I added another patch (the 4th) to remove linux specific cache code. > >The patches are applied on top of linux-acpi-2.6/acpica branch. > >Do you have any suggestion what data I should collect to verify if these >patches have a performance gain? > >Lin Ming > >On Thu, 2009-05-07 at 23:52 +0800, Alexey Starikovskiy wrote: >> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> >> --- >> >> source/components/utilities/utcache.c | 99 +++++---------------------- >------ >> 1 files changed, 14 insertions(+), 85 deletions(-) >> >> >> diff --git a/source/components/utilities/utcache.c >b/source/components/utilities/utcache.c >> index aabc0a2..d08d520 100644 >> --- a/source/components/utilities/utcache.c >> +++ b/source/components/utilities/utcache.c >> @@ -287,49 +287,15 @@ AcpiOsReleaseObject ( >> ACPI_MEMORY_LIST *Cache, >> void *Object) >> { >> - ACPI_STATUS Status; >> - >> - >> ACPI_FUNCTION_ENTRY (); >> >> - >> if (!Cache || !Object) >> { >> return (AE_BAD_PARAMETER); >> } >> >> - /* If cache is full, just free this object */ >> - >> - if (Cache->CurrentDepth >= Cache->MaxDepth) >> - { >> - ACPI_FREE (Object); >> - ACPI_MEM_TRACKING (Cache->TotalFreed++); >> - } >> - >> - /* Otherwise put this object back into the cache */ >> - >> - else >> - { >> - Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); >> - if (ACPI_FAILURE (Status)) >> - { >> - return (Status); >> - } >> - >> - /* Mark the object as cached */ >> - >> - ACPI_MEMSET (Object, 0xCA, Cache->ObjectSize); >> - ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_CACHED); >> - >> - /* Put the object at the head of the cache list */ >> - >> - * (ACPI_CAST_INDIRECT_PTR (char, >> - &(((char *) Object)[Cache->LinkOffset]))) = Cache->ListHead; >> - Cache->ListHead = Object; >> - Cache->CurrentDepth++; >> - >> - (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); >> - } >> + ACPI_FREE (Object); >> + ACPI_MEM_TRACKING (Cache->TotalFreed++); >> >> return (AE_OK); >> } >> @@ -353,8 +319,6 @@ AcpiOsAcquireObject ( >> ACPI_MEMORY_LIST *Cache) >> { >> ACPI_STATUS Status; >> - void *Object; >> - >> >> ACPI_FUNCTION_NAME (OsAcquireObject); >> >> @@ -372,61 +336,26 @@ AcpiOsAcquireObject ( >> >> ACPI_MEM_TRACKING (Cache->Requests++); >> >> - /* Check the cache first */ >> + /* The cache is empty, create a new object */ >> >> - if (Cache->ListHead) >> - { >> - /* There is an object available, use it */ >> - >> - Object = Cache->ListHead; >> - Cache->ListHead = *(ACPI_CAST_INDIRECT_PTR (char, >> - &(((char *) Object)[Cache- >>LinkOffset]))); >> - >> - Cache->CurrentDepth--; >> - >> - ACPI_MEM_TRACKING (Cache->Hits++); >> - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, >> - "Object %p from %s cache\n", Object, Cache->ListName)); >> - >> - Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >> - if (ACPI_FAILURE (Status)) >> - { >> - return (NULL); >> - } >> - >> - /* Clear (zero) the previously used Object */ >> - >> - ACPI_MEMSET (Object, 0, Cache->ObjectSize); >> - } >> - else >> - { >> - /* The cache is empty, create a new object */ >> - >> - ACPI_MEM_TRACKING (Cache->TotalAllocated++); >> + ACPI_MEM_TRACKING (Cache->TotalAllocated++); >> >> #ifdef ACPI_DBG_TRACK_ALLOCATIONS >> - if ((Cache->TotalAllocated - Cache->TotalFreed) > Cache- >>MaxOccupied) >> - { >> - Cache->MaxOccupied = Cache->TotalAllocated - Cache- >>TotalFreed; >> - } >> + if ((Cache->TotalAllocated - Cache->TotalFreed) > Cache- >>MaxOccupied) >> + { >> + Cache->MaxOccupied = Cache->TotalAllocated - Cache->TotalFreed; >> + } >> #endif >> >> - /* Avoid deadlock with ACPI_ALLOCATE_ZEROED */ >> + /* Avoid deadlock with ACPI_ALLOCATE_ZEROED */ >> >> - Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >> - if (ACPI_FAILURE (Status)) >> - { >> - return (NULL); >> - } >> - >> - Object = ACPI_ALLOCATE_ZEROED (Cache->ObjectSize); >> - if (!Object) >> - { >> - return (NULL); >> - } >> + Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >> + if (ACPI_FAILURE (Status)) >> + { >> + return (NULL); >> } >> >> - return (Object); >> + return ACPI_ALLOCATE_ZEROED (Cache->ObjectSize); >> } >> #endif /* ACPI_USE_LOCAL_CACHE */ >> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
What bugs are you seeing? May I be of any help? Regards, Alex. Moore, Robert wrote: > Removing the cache has exposed a couple of bugs that we are currently working on. We need to make sure that we pass the ASLTS suite before the code is integrated/released. > > Bob > > > >> -----Original Message----- >> From: Lin, Ming M >> Sent: Monday, May 11, 2009 1:14 AM >> To: Alexey Starikovskiy >> Cc: Moore, Robert; Linux-acpi@vger.kernel.org >> Subject: Re: [PATCH 1/4] ACPICA: Remove use of caches in controlled way >> >> Hi, Alexey >> >> The attachment are the linuxized version of your patches. >> I added another patch (the 4th) to remove linux specific cache code. >> >> The patches are applied on top of linux-acpi-2.6/acpica branch. >> >> Do you have any suggestion what data I should collect to verify if these >> patches have a performance gain? >> >> Lin Ming >> >> On Thu, 2009-05-07 at 23:52 +0800, Alexey Starikovskiy wrote: >> >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> >>> --- >>> >>> source/components/utilities/utcache.c | 99 +++++---------------------- >>> >> ------ >> >>> 1 files changed, 14 insertions(+), 85 deletions(-) >>> >>> >>> diff --git a/source/components/utilities/utcache.c >>> >> b/source/components/utilities/utcache.c >> >>> index aabc0a2..d08d520 100644 >>> --- a/source/components/utilities/utcache.c >>> +++ b/source/components/utilities/utcache.c >>> @@ -287,49 +287,15 @@ AcpiOsReleaseObject ( >>> ACPI_MEMORY_LIST *Cache, >>> void *Object) >>> { >>> - ACPI_STATUS Status; >>> - >>> - >>> ACPI_FUNCTION_ENTRY (); >>> >>> - >>> if (!Cache || !Object) >>> { >>> return (AE_BAD_PARAMETER); >>> } >>> >>> - /* If cache is full, just free this object */ >>> - >>> - if (Cache->CurrentDepth >= Cache->MaxDepth) >>> - { >>> - ACPI_FREE (Object); >>> - ACPI_MEM_TRACKING (Cache->TotalFreed++); >>> - } >>> - >>> - /* Otherwise put this object back into the cache */ >>> - >>> - else >>> - { >>> - Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); >>> - if (ACPI_FAILURE (Status)) >>> - { >>> - return (Status); >>> - } >>> - >>> - /* Mark the object as cached */ >>> - >>> - ACPI_MEMSET (Object, 0xCA, Cache->ObjectSize); >>> - ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_CACHED); >>> - >>> - /* Put the object at the head of the cache list */ >>> - >>> - * (ACPI_CAST_INDIRECT_PTR (char, >>> - &(((char *) Object)[Cache->LinkOffset]))) = Cache->ListHead; >>> - Cache->ListHead = Object; >>> - Cache->CurrentDepth++; >>> - >>> - (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); >>> - } >>> + ACPI_FREE (Object); >>> + ACPI_MEM_TRACKING (Cache->TotalFreed++); >>> >>> return (AE_OK); >>> } >>> @@ -353,8 +319,6 @@ AcpiOsAcquireObject ( >>> ACPI_MEMORY_LIST *Cache) >>> { >>> ACPI_STATUS Status; >>> - void *Object; >>> - >>> >>> ACPI_FUNCTION_NAME (OsAcquireObject); >>> >>> @@ -372,61 +336,26 @@ AcpiOsAcquireObject ( >>> >>> ACPI_MEM_TRACKING (Cache->Requests++); >>> >>> - /* Check the cache first */ >>> + /* The cache is empty, create a new object */ >>> >>> - if (Cache->ListHead) >>> - { >>> - /* There is an object available, use it */ >>> - >>> - Object = Cache->ListHead; >>> - Cache->ListHead = *(ACPI_CAST_INDIRECT_PTR (char, >>> - &(((char *) Object)[Cache- >>> LinkOffset]))); >>> - >>> - Cache->CurrentDepth--; >>> - >>> - ACPI_MEM_TRACKING (Cache->Hits++); >>> - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, >>> - "Object %p from %s cache\n", Object, Cache->ListName)); >>> - >>> - Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >>> - if (ACPI_FAILURE (Status)) >>> - { >>> - return (NULL); >>> - } >>> - >>> - /* Clear (zero) the previously used Object */ >>> - >>> - ACPI_MEMSET (Object, 0, Cache->ObjectSize); >>> - } >>> - else >>> - { >>> - /* The cache is empty, create a new object */ >>> - >>> - ACPI_MEM_TRACKING (Cache->TotalAllocated++); >>> + ACPI_MEM_TRACKING (Cache->TotalAllocated++); >>> >>> #ifdef ACPI_DBG_TRACK_ALLOCATIONS >>> - if ((Cache->TotalAllocated - Cache->TotalFreed) > Cache- >>> MaxOccupied) >>> - { >>> - Cache->MaxOccupied = Cache->TotalAllocated - Cache- >>> TotalFreed; >>> - } >>> + if ((Cache->TotalAllocated - Cache->TotalFreed) > Cache- >>> MaxOccupied) >>> + { >>> + Cache->MaxOccupied = Cache->TotalAllocated - Cache->TotalFreed; >>> + } >>> #endif >>> >>> - /* Avoid deadlock with ACPI_ALLOCATE_ZEROED */ >>> + /* Avoid deadlock with ACPI_ALLOCATE_ZEROED */ >>> >>> - Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >>> - if (ACPI_FAILURE (Status)) >>> - { >>> - return (NULL); >>> - } >>> - >>> - Object = ACPI_ALLOCATE_ZEROED (Cache->ObjectSize); >>> - if (!Object) >>> - { >>> - return (NULL); >>> - } >>> + Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >>> + if (ACPI_FAILURE (Status)) >>> + { >>> + return (NULL); >>> } >>> >>> - return (Object); >>> + return ACPI_ALLOCATE_ZEROED (Cache->ObjectSize); >>> } >>> #endif /* ACPI_USE_LOCAL_CACHE */ >>> >>> >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>> > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Problems with deletion of the DdbHandle object type. I think we have it under control, thanks. >-----Original Message----- >From: Alexey Starikovskiy [mailto:aystarik@gmail.com] >Sent: Tuesday, May 12, 2009 11:54 AM >To: Moore, Robert >Cc: Lin, Ming M; Alexey Starikovskiy; Linux-acpi@vger.kernel.org >Subject: Re: [PATCH 1/4] ACPICA: Remove use of caches in controlled way > >What bugs are you seeing? May I be of any help? > >Regards, >Alex. > > >Moore, Robert wrote: >> Removing the cache has exposed a couple of bugs that we are currently >working on. We need to make sure that we pass the ASLTS suite before the >code is integrated/released. >> >> Bob >> >> >> >>> -----Original Message----- >>> From: Lin, Ming M >>> Sent: Monday, May 11, 2009 1:14 AM >>> To: Alexey Starikovskiy >>> Cc: Moore, Robert; Linux-acpi@vger.kernel.org >>> Subject: Re: [PATCH 1/4] ACPICA: Remove use of caches in controlled way >>> >>> Hi, Alexey >>> >>> The attachment are the linuxized version of your patches. >>> I added another patch (the 4th) to remove linux specific cache code. >>> >>> The patches are applied on top of linux-acpi-2.6/acpica branch. >>> >>> Do you have any suggestion what data I should collect to verify if these >>> patches have a performance gain? >>> >>> Lin Ming >>> >>> On Thu, 2009-05-07 at 23:52 +0800, Alexey Starikovskiy wrote: >>> >>>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> >>>> --- >>>> >>>> source/components/utilities/utcache.c | 99 +++++-------------------- >-- >>>> >>> ------ >>> >>>> 1 files changed, 14 insertions(+), 85 deletions(-) >>>> >>>> >>>> diff --git a/source/components/utilities/utcache.c >>>> >>> b/source/components/utilities/utcache.c >>> >>>> index aabc0a2..d08d520 100644 >>>> --- a/source/components/utilities/utcache.c >>>> +++ b/source/components/utilities/utcache.c >>>> @@ -287,49 +287,15 @@ AcpiOsReleaseObject ( >>>> ACPI_MEMORY_LIST *Cache, >>>> void *Object) >>>> { >>>> - ACPI_STATUS Status; >>>> - >>>> - >>>> ACPI_FUNCTION_ENTRY (); >>>> >>>> - >>>> if (!Cache || !Object) >>>> { >>>> return (AE_BAD_PARAMETER); >>>> } >>>> >>>> - /* If cache is full, just free this object */ >>>> - >>>> - if (Cache->CurrentDepth >= Cache->MaxDepth) >>>> - { >>>> - ACPI_FREE (Object); >>>> - ACPI_MEM_TRACKING (Cache->TotalFreed++); >>>> - } >>>> - >>>> - /* Otherwise put this object back into the cache */ >>>> - >>>> - else >>>> - { >>>> - Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); >>>> - if (ACPI_FAILURE (Status)) >>>> - { >>>> - return (Status); >>>> - } >>>> - >>>> - /* Mark the object as cached */ >>>> - >>>> - ACPI_MEMSET (Object, 0xCA, Cache->ObjectSize); >>>> - ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_CACHED); >>>> - >>>> - /* Put the object at the head of the cache list */ >>>> - >>>> - * (ACPI_CAST_INDIRECT_PTR (char, >>>> - &(((char *) Object)[Cache->LinkOffset]))) = Cache- >>ListHead; >>>> - Cache->ListHead = Object; >>>> - Cache->CurrentDepth++; >>>> - >>>> - (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); >>>> - } >>>> + ACPI_FREE (Object); >>>> + ACPI_MEM_TRACKING (Cache->TotalFreed++); >>>> >>>> return (AE_OK); >>>> } >>>> @@ -353,8 +319,6 @@ AcpiOsAcquireObject ( >>>> ACPI_MEMORY_LIST *Cache) >>>> { >>>> ACPI_STATUS Status; >>>> - void *Object; >>>> - >>>> >>>> ACPI_FUNCTION_NAME (OsAcquireObject); >>>> >>>> @@ -372,61 +336,26 @@ AcpiOsAcquireObject ( >>>> >>>> ACPI_MEM_TRACKING (Cache->Requests++); >>>> >>>> - /* Check the cache first */ >>>> + /* The cache is empty, create a new object */ >>>> >>>> - if (Cache->ListHead) >>>> - { >>>> - /* There is an object available, use it */ >>>> - >>>> - Object = Cache->ListHead; >>>> - Cache->ListHead = *(ACPI_CAST_INDIRECT_PTR (char, >>>> - &(((char *) Object)[Cache- >>>> LinkOffset]))); >>>> - >>>> - Cache->CurrentDepth--; >>>> - >>>> - ACPI_MEM_TRACKING (Cache->Hits++); >>>> - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, >>>> - "Object %p from %s cache\n", Object, Cache->ListName)); >>>> - >>>> - Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >>>> - if (ACPI_FAILURE (Status)) >>>> - { >>>> - return (NULL); >>>> - } >>>> - >>>> - /* Clear (zero) the previously used Object */ >>>> - >>>> - ACPI_MEMSET (Object, 0, Cache->ObjectSize); >>>> - } >>>> - else >>>> - { >>>> - /* The cache is empty, create a new object */ >>>> - >>>> - ACPI_MEM_TRACKING (Cache->TotalAllocated++); >>>> + ACPI_MEM_TRACKING (Cache->TotalAllocated++); >>>> >>>> #ifdef ACPI_DBG_TRACK_ALLOCATIONS >>>> - if ((Cache->TotalAllocated - Cache->TotalFreed) > Cache- >>>> MaxOccupied) >>>> - { >>>> - Cache->MaxOccupied = Cache->TotalAllocated - Cache- >>>> TotalFreed; >>>> - } >>>> + if ((Cache->TotalAllocated - Cache->TotalFreed) > Cache- >>>> MaxOccupied) >>>> + { >>>> + Cache->MaxOccupied = Cache->TotalAllocated - Cache- >>TotalFreed; >>>> + } >>>> #endif >>>> >>>> - /* Avoid deadlock with ACPI_ALLOCATE_ZEROED */ >>>> + /* Avoid deadlock with ACPI_ALLOCATE_ZEROED */ >>>> >>>> - Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >>>> - if (ACPI_FAILURE (Status)) >>>> - { >>>> - return (NULL); >>>> - } >>>> - >>>> - Object = ACPI_ALLOCATE_ZEROED (Cache->ObjectSize); >>>> - if (!Object) >>>> - { >>>> - return (NULL); >>>> - } >>>> + Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); >>>> + if (ACPI_FAILURE (Status)) >>>> + { >>>> + return (NULL); >>>> } >>>> >>>> - return (Object); >>>> + return ACPI_ALLOCATE_ZEROED (Cache->ObjectSize); >>>> } >>>> #endif /* ACPI_USE_LOCAL_CACHE */ >>>> >>>> >>>> -- >>>> To unsubscribe from this list: send the line "unsubscribe linux-acpi" >in >>>> the body of a message to majordomo@vger.kernel.org >>>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>>> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/acpi/acpica/acconfig.h b/drivers/acpi/acpica/acconfig.h index e6777fb..aff01be 100644 --- a/drivers/acpi/acpica/acconfig.h +++ b/drivers/acpi/acpica/acconfig.h @@ -71,14 +71,6 @@ */ #define ACPI_OS_NAME "Microsoft Windows NT" -/* Maximum objects in the various object caches */ - -#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ -#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ -#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ -#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ -#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ - /* * Should the subsystem abort the loading of an ACPI table if the * table checksum is incorrect? diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 3d87362..c36e1dc 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h @@ -216,14 +216,6 @@ ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats; #endif -/* Object caches */ - -ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; - /* Global handlers */ ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h index 544dcf8..a8e1319 100644 --- a/drivers/acpi/acpica/acobject.h +++ b/drivers/acpi/acpica/acobject.h @@ -356,12 +356,6 @@ struct acpi_object_data { void *pointer; }; -/* Structure used when objects are cached for reuse */ - -struct acpi_object_cache_list { - ACPI_OBJECT_COMMON_HEADER union acpi_operand_object *next; /* Link for object cache and internal lists */ -}; - /****************************************************************************** * * union acpi_operand_object Descriptor - a giant union of all of the above @@ -393,7 +387,6 @@ union acpi_operand_object { struct acpi_object_reference reference; struct acpi_object_extra extra; struct acpi_object_data data; - struct acpi_object_cache_list cache; /* * Add namespace node to union in order to simplify code that accepts both diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index aceb931..f3d06aa 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c @@ -68,7 +68,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name) ACPI_FUNCTION_TRACE(ns_create_node); - node = acpi_os_acquire_object(acpi_gbl_namespace_cache); + node = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_namespace_node)); if (!node) { return_PTR(NULL); } @@ -147,7 +147,7 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) /* Detach an object if there is one, then delete the node */ acpi_ns_detach_object(node); - (void)acpi_os_release_object(acpi_gbl_namespace_cache, node); + ACPI_FREE(node); return_VOID; } @@ -287,8 +287,7 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node) /* Now we can delete the node */ - (void)acpi_os_release_object(acpi_gbl_namespace_cache, - child_node); + ACPI_FREE(child_node); /* And move on to the next child in the list */ diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c index e636e07..913c585 100644 --- a/drivers/acpi/acpica/psutils.c +++ b/drivers/acpi/acpica/psutils.c @@ -139,11 +139,11 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode) /* The generic op (default) is by far the most common (16 to 1) */ - op = acpi_os_acquire_object(acpi_gbl_ps_node_cache); + op = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_parse_obj_common)); } else { /* Extended parseop */ - op = acpi_os_acquire_object(acpi_gbl_ps_node_ext_cache); + op = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_parse_obj_named)); } /* Initialize the Op */ @@ -179,9 +179,9 @@ void acpi_ps_free_op(union acpi_parse_object *op) } if (op->common.flags & ACPI_PARSEOP_GENERIC) { - (void)acpi_os_release_object(acpi_gbl_ps_node_cache, op); + ACPI_FREE(op); } else { - (void)acpi_os_release_object(acpi_gbl_ps_node_ext_cache, op); + ACPI_FREE(op); } } diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c index 7580f6b..c1c7594 100644 --- a/drivers/acpi/acpica/utalloc.c +++ b/drivers/acpi/acpica/utalloc.c @@ -61,54 +61,8 @@ ACPI_MODULE_NAME("utalloc") ******************************************************************************/ acpi_status acpi_ut_create_caches(void) { - acpi_status status; - - /* Object Caches, for frequently used objects */ - - status = - acpi_os_create_cache("Acpi-Namespace", - sizeof(struct acpi_namespace_node), - ACPI_MAX_NAMESPACE_CACHE_DEPTH, - &acpi_gbl_namespace_cache); - if (ACPI_FAILURE(status)) { - return (status); - } - - status = - acpi_os_create_cache("Acpi-State", sizeof(union acpi_generic_state), - ACPI_MAX_STATE_CACHE_DEPTH, - &acpi_gbl_state_cache); - if (ACPI_FAILURE(status)) { - return (status); - } - - status = - acpi_os_create_cache("Acpi-Parse", - sizeof(struct acpi_parse_obj_common), - ACPI_MAX_PARSE_CACHE_DEPTH, - &acpi_gbl_ps_node_cache); - if (ACPI_FAILURE(status)) { - return (status); - } - - status = - acpi_os_create_cache("Acpi-ParseExt", - sizeof(struct acpi_parse_obj_named), - ACPI_MAX_EXTPARSE_CACHE_DEPTH, - &acpi_gbl_ps_node_ext_cache); - if (ACPI_FAILURE(status)) { - return (status); - } - - status = - acpi_os_create_cache("Acpi-Operand", - sizeof(union acpi_operand_object), - ACPI_MAX_OBJECT_CACHE_DEPTH, - &acpi_gbl_operand_cache); - if (ACPI_FAILURE(status)) { - return (status); - } #ifdef ACPI_DBG_TRACK_ALLOCATIONS + acpi_status status; /* Memory allocation lists */ @@ -150,24 +104,6 @@ acpi_status acpi_ut_delete_caches(void) ACPI_STRCPY(buffer, "MEMORY"); (void)acpi_db_display_statistics(buffer); } -#endif - - (void)acpi_os_delete_cache(acpi_gbl_namespace_cache); - acpi_gbl_namespace_cache = NULL; - - (void)acpi_os_delete_cache(acpi_gbl_state_cache); - acpi_gbl_state_cache = NULL; - - (void)acpi_os_delete_cache(acpi_gbl_operand_cache); - acpi_gbl_operand_cache = NULL; - - (void)acpi_os_delete_cache(acpi_gbl_ps_node_cache); - acpi_gbl_ps_node_cache = NULL; - - (void)acpi_os_delete_cache(acpi_gbl_ps_node_ext_cache); - acpi_gbl_ps_node_ext_cache = NULL; - -#ifdef ACPI_DBG_TRACK_ALLOCATIONS /* Debug only - display leftover memory allocation, if any */ diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c index 0207b62..294d905 100644 --- a/drivers/acpi/acpica/utobject.c +++ b/drivers/acpi/acpica/utobject.c @@ -355,7 +355,7 @@ void *acpi_ut_allocate_object_desc_dbg(const char *module_name, ACPI_FUNCTION_TRACE(ut_allocate_object_desc_dbg); - object = acpi_os_acquire_object(acpi_gbl_operand_cache); + object = ACPI_ALLOCATE_ZEROED(sizeof(union acpi_operand_object)); if (!object) { ACPI_ERROR((module_name, line_number, "Could not allocate an object descriptor")); @@ -399,7 +399,7 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object) return_VOID; } - (void)acpi_os_release_object(acpi_gbl_operand_cache, object); + ACPI_FREE(object); return_VOID; } diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c index 0440c95..ab6fbd4 100644 --- a/drivers/acpi/acpica/utstate.c +++ b/drivers/acpi/acpica/utstate.c @@ -158,7 +158,7 @@ union acpi_generic_state *acpi_ut_create_generic_state(void) ACPI_FUNCTION_ENTRY(); - state = acpi_os_acquire_object(acpi_gbl_state_cache); + state = ACPI_ALLOCATE_ZEROED(sizeof(union acpi_generic_state)); if (state) { /* Initialize */ @@ -341,7 +341,7 @@ void acpi_ut_delete_generic_state(union acpi_generic_state *state) /* Ignore null state */ if (state) { - (void)acpi_os_release_object(acpi_gbl_state_cache, state); + ACPI_FREE(state); } return_VOID; } diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c index 078a227..e239dea 100644 --- a/drivers/acpi/acpica/utxface.c +++ b/drivers/acpi/acpica/utxface.c @@ -296,13 +296,6 @@ acpi_status acpi_initialize_objects(u32 flags) return (status); } - /* - * Empty the caches (delete the cached objects) on the assumption that - * the table load filled them up more than they will be at runtime -- - * thus wasting non-paged memory. - */ - status = acpi_purge_cached_objects(); - acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK; return_ACPI_STATUS(status); } @@ -486,27 +479,4 @@ acpi_install_initialization_handler(acpi_init_handler handler, u32 function) ACPI_EXPORT_SYMBOL(acpi_install_initialization_handler) #endif /* ACPI_FUTURE_USAGE */ -/***************************************************************************** - * - * FUNCTION: acpi_purge_cached_objects - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Empty all caches (delete the cached objects) - * - ****************************************************************************/ -acpi_status acpi_purge_cached_objects(void) -{ - ACPI_FUNCTION_TRACE(acpi_purge_cached_objects); - - (void)acpi_os_purge_cache(acpi_gbl_state_cache); - (void)acpi_os_purge_cache(acpi_gbl_operand_cache); - (void)acpi_os_purge_cache(acpi_gbl_ps_node_cache); - (void)acpi_os_purge_cache(acpi_gbl_ps_node_ext_cache); - return_ACPI_STATUS(AE_OK); -} - -ACPI_EXPORT_SYMBOL(acpi_purge_cached_objects) #endif diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 3e79859..f24c2fb 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -153,22 +153,6 @@ acpi_os_get_physical_address(void *logical_address, #endif /* - * Memory/Object Cache - */ -acpi_status -acpi_os_create_cache(char *cache_name, - u16 object_size, - u16 max_depth, acpi_cache_t ** return_cache); - -acpi_status acpi_os_delete_cache(acpi_cache_t * cache); - -acpi_status acpi_os_purge_cache(acpi_cache_t * cache); - -void *acpi_os_acquire_object(acpi_cache_t * cache); - -acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); - -/* * Interrupt handlers */ acpi_status diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 37ba576..21abd7a 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -223,16 +223,6 @@ typedef u32 acpi_physical_address; #define acpi_cpu_flags acpi_size #endif -/* Object returned from acpi_os_create_cache */ - -#ifndef acpi_cache_t -#ifdef ACPI_USE_LOCAL_CACHE -#define acpi_cache_t struct acpi_memory_list -#else -#define acpi_cache_t void * -#endif -#endif - /* * Synchronization objects - Mutexes, Semaphores, and spin_locks */ diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index e62f10d..d6815c0 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -60,14 +60,6 @@ * *****************************************************************************/ -#ifdef ACPI_LIBRARY -/* - * Note: The non-debug version of the acpi_library does not contain any - * debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG - */ -#define ACPI_USE_LOCAL_CACHE -#endif - #ifdef ACPI_ASL_COMPILER #define ACPI_DEBUG_OUTPUT #define ACPI_APPLICATION @@ -89,7 +81,6 @@ #ifdef ACPI_APPLICATION #define ACPI_USE_SYSTEM_CLIBRARY -#define ACPI_USE_LOCAL_CACHE #endif #ifdef ACPI_FULL_DEBUG diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index fcb8e4b..43bacf2 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -72,7 +72,6 @@ #define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol); #define strtoul simple_strtoul -#define acpi_cache_t struct kmem_cache #define acpi_spinlock spinlock_t * #define acpi_cpu_flags unsigned long #define acpi_thread_id struct task_struct *