Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2995847ybt; Mon, 29 Jun 2020 12:25:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrvg99gpj+yFsNO2qgdjSz97NPX0HCPQLfK7rH8ARkhonsv8kfEke1nhL6mB4m41Stq7oX X-Received: by 2002:a17:907:1050:: with SMTP id oy16mr15973389ejb.353.1593458700163; Mon, 29 Jun 2020 12:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593458700; cv=none; d=google.com; s=arc-20160816; b=KTHoL/5tPIuJFu/35xAADC7Jecqi3IRc7hndpcyxxYe2dI8cEoZ77ilPKeid+kLHuL YND7H1bGvlMccnha9zcLfn9N8SEjUHu6d9fu6gj9tR+kYrwQvrksekZNMrX681rujC1o zTPZSKsfRgaC8MCpaFr3UxRhVebUJoYCDEMlG5rNK7wTF8mCg7E1iJ0NI86Kg44Opz7s VEHH+YU6GrHkGyJ61n9FyGr6kzDMcchk4Z4fDVPk4ZiugpmDh+zCBW1me32wpWOab/cj qzboTSRra1T1QumfRwVWbx9A+Cyg4kWBlu5HoMlZtryy/Ck1C/MVfzsnyWELJPyvZk1m 1apg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FsfBwDAx0fUxOqv/C8iQQvtWjKI4KCwVW6ndbmFLGYI=; b=rGXopxNYJAN195j+KrV5oCtNHNQLpyt5tD/GQJofMLYz9s+5CoEF4bckq3pqX1QEcy JSLbnR7N9J2Va949X7rGqluBQS6h/cjFDti/BL6Esx8OcD4IwKdD7Am2Xk3dxriFbALK i4chYPHmp91u3JY7an1SimqUr+E5E3hhQgp5iIrwdNnP7rIbJqM+7iWXjBSdmxVnmsJU 3S1hVKQvmY8lIsVPchyVoQ87yquHEMCeKEudGvh/uE23fqXpSL9hhUHk+sSUOToyX6Dc 8WeWwsZwQqPN1JKa8ITn1OCrQtd+7H30ICZHxbyitSNmN5cc5xbXYJcJgiZ1/F+QWqB5 QoIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr6si330423ejb.259.2020.06.29.12.24.35; Mon, 29 Jun 2020 12:25:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730442AbgF2TWZ (ORCPT + 99 others); Mon, 29 Jun 2020 15:22:25 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:45968 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732226AbgF2TVg (ORCPT ); Mon, 29 Jun 2020 15:21:36 -0400 Received: from 89-64-84-69.dynamic.chello.pl (89.64.84.69) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 200f7df7d1df78b0; Mon, 29 Jun 2020 18:34:54 +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: [PATCH v4 0/2] ACPI: ACPICA / OSL: Avoid unmapping ACPI memory inside of the AML interpreter Date: Mon, 29 Jun 2020 18:31:02 +0200 Message-ID: <1666722.UopIai5n7p@kreacher> In-Reply-To: <2788992.3K7huLjdjL@kreacher> References: <158889473309.2292982.18007035454673387731.stgit@dwillia2-desk3.amr.corp.intel.com> <2713141.s8EVnczdoM@kreacher> <2788992.3K7huLjdjL@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, On Friday, June 26, 2020 7:28:27 PM CEST Rafael J. Wysocki wrote: > Hi All, > > On Monday, June 22, 2020 3:50:42 PM CEST Rafael J. Wysocki wrote: > > 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. > > > > Like I said before, I had decided to change the approach used in the previous > > iteration of this series and to allow the unmap operations carried out by > > acpi_ex_system_memory_space_handler() to be deferred in the first place, > > which is done in patches [1-2/4]. > > In the meantime I realized that calling syncrhonize_rcu_expedited() under the > "tables" mutex within ACPICA is not quite a good idea too and that there is no > reason for any users of acpi_os_unmap_memory() in the tree to use the "sync" > variant of unmapping. > > So, unless I'm missing something, acpi_os_unmap_memory() can be changed to > always defer the final unmapping and the only ACPICA change needed to support > that is the addition of the acpi_os_release_unused_mappings() call to get rid > of the unused mappings when leaving the interpreter (module the extra call in > the debug code for consistency). > > So patches [1-2/4] have been changed accordingly. And this still can be improved by using queue_rcu_work() to queue up the unused mappings for removal in which case ACPICA need not be modified at all for the deferred unmapping to work. Accordingly, patches [1-2/4] from the v3 (and earlier) are now replaced by one patch, the [1/2]. > > However, it turns out that the "fast-path" mapping is still useful on top of > > the above to reduce the number of ioremap-iounmap cycles for the same address > > range and so it is introduced by patches [3-4/4]. > > Patches [3-4/4] still do what they did, but they have been simplified a bit > after rebasing on top of the new [1-2/4]. Moreover, the ACPICA part of the old patches [3-4/4] can be reworked to always preserve memory mappings created by the memory opregion handler without the need to take additional references to memory mappings at the OS level, so patch [4/4] from the v3 (and earlier) is not needed now. Again, for details, please refer to the patch changelogs, but I'm kind of inclined to make these changes regardless, because they both are clear improvements to me. As before: > > 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. > > Also the series have been tested locally. Cheers, Rafael