From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Starikovskiy Subject: Re: [PATCH 1/4] ACPICA: Remove use of caches in controlled way Date: Tue, 12 May 2009 22:54:14 +0400 Message-ID: <4A09C5D6.80409@gmail.com> References: <20090507155202.26361.38778.stgit@thinkpad> <1242029667.4641.31.camel@minggr.sh.intel.com> <4911F71203A09E4D9981D27F9D8308582281A5F5@orsmsx503.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bw0-f222.google.com ([209.85.218.222]:36285 "EHLO mail-bw0-f222.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498AbZELSyQ (ORCPT ); Tue, 12 May 2009 14:54:16 -0400 Received: by bwz22 with SMTP id 22so161039bwz.37 for ; Tue, 12 May 2009 11:54:16 -0700 (PDT) In-Reply-To: <4911F71203A09E4D9981D27F9D8308582281A5F5@orsmsx503.amr.corp.intel.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Moore, Robert" Cc: "Lin, Ming M" , Alexey Starikovskiy , "Linux-acpi@vger.kernel.org" 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 >>> --- >>> >>> 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 >