From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54F1AC433E2 for ; Wed, 10 Jun 2020 12:23:46 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34C4D20734 for ; Wed, 10 Jun 2020 12:23:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34C4D20734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0A962100A05CF; Wed, 10 Jun 2020 05:23:46 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.96.170.134; helo=cloudserver094114.home.pl; envelope-from=rjw@rjwysocki.net; receiver= Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DC3E1100A22F2 for ; Wed, 10 Jun 2020 05:23:41 -0700 (PDT) Received: from 89-64-83-71.dynamic.chello.pl (89.64.83.71) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 3bbe034ef495dd51; Wed, 10 Jun 2020 14:23:40 +0200 From: "Rafael J. Wysocki" To: Dan Williams , Erik Kaneda Subject: [RFT][PATCH 0/3] ACPI: ACPICA / OSL: Avoid unmapping ACPI memory inside of the AML interpreter Date: Wed, 10 Jun 2020 14:17:04 +0200 Message-ID: <318372766.6LKUBsbRXE@kreacher> In-Reply-To: <158889473309.2292982.18007035454673387731.stgit@dwillia2-desk3.amr.corp.intel.com> References: <158889473309.2292982.18007035454673387731.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Message-ID-Hash: GJGQUWG2IYH6VRJHUI7OYWZNTKVLFQP4 X-Message-ID-Hash: GJGQUWG2IYH6VRJHUI7OYWZNTKVLFQP4 X-MailFrom: rjw@rjwysocki.net X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: rafael.j.wysocki@intel.com, Len Brown , Borislav Petkov , James Morse , Myron Stowe , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-nvdimm@lists.01.org, Bob Moore X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: 7bit Hi All, This series is to address the problem with RCU synchronization occurring, possibly relatively often, inside of acpi_ex_system_memory_space_handler(), when the namespace and interpreter mutexes are held. The basic idea is to avoid the actual unmapping of memory in acpi_ex_system_memory_space_handler() by making it take the advantage of the reference counting of memory mappings utilized by the OSL layer in Linux. The basic assumption in patch [1/3] is that if the special ACPI_OS_MAP_MEMORY_FAST_PATH() macro is present, it can be used to increment the reference counter of a known-existing memory mapping in the OS layer which then is dropped by the subsequent acpi_os_unmap_memory() without unmapping the address range at hand. That can be utilized by acpi_ex_system_memory_space_handler() to prevent the reference counters of all mappings used by it from dropping down to 0 (which also prevents the address ranges associated with them from being unmapped) so that they can be unmapped later (specifically, at the operation region deactivation time). Patch [2/3] defers the unmapping even further, until the namespace and interpreter mutexes are released, to avoid invoking the RCU synchronization under theses mutexes. Finally, patch [3/3] changes the OS layer in Linux to provide the ACPI_OS_MAP_MEMORY_FAST_PATH() macro. Note that if this macro is not defined, the code works the way it used to. The series is available from the git branch at git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \ acpica-osl for easier testing. Cheers, Rafael _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3637AC433E0 for ; Wed, 10 Jun 2020 12:23:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 130A020734 for ; Wed, 10 Jun 2020 12:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729075AbgFJMXo (ORCPT ); Wed, 10 Jun 2020 08:23:44 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:64746 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729068AbgFJMXm (ORCPT ); Wed, 10 Jun 2020 08:23:42 -0400 Received: from 89-64-83-71.dynamic.chello.pl (89.64.83.71) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 3bbe034ef495dd51; Wed, 10 Jun 2020 14:23:40 +0200 From: "Rafael J. Wysocki" To: Dan Williams , Erik Kaneda Cc: rafael.j.wysocki@intel.com, Len Brown , Borislav Petkov , Ira Weiny , James Morse , Myron Stowe , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-nvdimm@lists.01.org, Bob Moore Subject: [RFT][PATCH 0/3] ACPI: ACPICA / OSL: Avoid unmapping ACPI memory inside of the AML interpreter Date: Wed, 10 Jun 2020 14:17:04 +0200 Message-ID: <318372766.6LKUBsbRXE@kreacher> In-Reply-To: <158889473309.2292982.18007035454673387731.stgit@dwillia2-desk3.amr.corp.intel.com> References: <158889473309.2292982.18007035454673387731.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hi All, This series is to address the problem with RCU synchronization occurring, possibly relatively often, inside of acpi_ex_system_memory_space_handler(), when the namespace and interpreter mutexes are held. The basic idea is to avoid the actual unmapping of memory in acpi_ex_system_memory_space_handler() by making it take the advantage of the reference counting of memory mappings utilized by the OSL layer in Linux. The basic assumption in patch [1/3] is that if the special ACPI_OS_MAP_MEMORY_FAST_PATH() macro is present, it can be used to increment the reference counter of a known-existing memory mapping in the OS layer which then is dropped by the subsequent acpi_os_unmap_memory() without unmapping the address range at hand. That can be utilized by acpi_ex_system_memory_space_handler() to prevent the reference counters of all mappings used by it from dropping down to 0 (which also prevents the address ranges associated with them from being unmapped) so that they can be unmapped later (specifically, at the operation region deactivation time). Patch [2/3] defers the unmapping even further, until the namespace and interpreter mutexes are released, to avoid invoking the RCU synchronization under theses mutexes. Finally, patch [3/3] changes the OS layer in Linux to provide the ACPI_OS_MAP_MEMORY_FAST_PATH() macro. Note that if this macro is not defined, the code works the way it used to. The series is available from the git branch at git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \ acpica-osl for easier testing. Cheers, Rafael