From nobody Sun Nov 24 12:53:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1724393807; cv=none; d=zohomail.com; s=zohoarc; b=ecYnw3gPUPsq9bJdTzuFyh/cl2u3w7TXWmRpjkZUsxVh9fyQB4g5NB5S1WXb0VHh+XhJV35OsAbUaqBdBrkc7NKAVKYxnN04vHBpvYoOPPny+CxjNFxzW1edBwJpv6fZ1Tm9fFO6mDt9GXiKtzISyomKC1xO6RPfCq9gQVPezho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724393807; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=b4fRw6ya5cnFbQAZ70Uw8BnHXsKEEdwvnI09RO2JZjU=; b=PSYR0+hAKf4gQ14M9geAeCqPQuC6lXphf4sCzpu+TV+wZYjcw9nbkSJl+xWwaSmhsb+XFDfYxFzzOVCXMXLBvueiLzkiCo8XChaR/EwamtpftVLFeH9EAzrMleJdxwEVuIo0+SDm2xkjub+VGsBfYoOQj7l27PfT2uPr/X5qBGA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172439380726768.51461143483687; Thu, 22 Aug 2024 23:16:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shNYZ-0002Up-R5; Fri, 23 Aug 2024 02:13:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shNYU-0002O0-E0 for qemu-devel@nongnu.org; Fri, 23 Aug 2024 02:13:52 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1shNYH-000378-9c for qemu-devel@nongnu.org; Fri, 23 Aug 2024 02:13:50 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-712603f7ba5so1403527b3a.3 for ; Thu, 22 Aug 2024 23:13:36 -0700 (PDT) Received: from localhost ([157.82.207.23]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2d5eba26377sm5363854a91.32.2024.08.22.23.13.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2024 23:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1724393616; x=1724998416; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=b4fRw6ya5cnFbQAZ70Uw8BnHXsKEEdwvnI09RO2JZjU=; b=dlHtcE0VED/esk8e+YdidFgXWkO4W7WWNGo4SmgANOd/pxSB2zR4j/L+gvnchExWZU YdCSJu0cIwBZv2FCyc2XjeogVZSG4P9eNO4DeXee0ywbumuuGwZdfQQnPeo9CRnWu1ZS 7eSCXHbhXIpTI5JppcTLORuOkPkKDqv+V5fE6k2iMShhyu50+kJ5DwaTKhr6hOWNhCVp BLvm0LRxaGW09H5DMg6P2Dlhk0w8iWuJuVABvd9eIKEGRO2e/7Qlf3AhJJdeDHq6PvUH DCbQ/IfdPoAJ0hPdYK7ak/M6W5XrcfSqXPHjR4nAaVGxQlP/9YwXaUY+2yE1Vr+YTP8z wQcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724393616; x=1724998416; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b4fRw6ya5cnFbQAZ70Uw8BnHXsKEEdwvnI09RO2JZjU=; b=u+QcwN2ptKnHESGovoO2wmLstbgDLfeuyiXJuneG3MrO0zAXY4UK5qL0WAFPOH8AgN 4MGdIIMNCf77XklGlhfDaxqir4ncZBduA8xXwMgPDzsinFqiCDpvkiioPUEoB6pqnsng XeeUhg9dw5ur38CqpJ2GdigUYk8ncpZRVaJzSwtUyjE0faguLnO0x87InK1jwRB+2qlI CyVp7SnSBaZeBNTpSX4YOVXwcqUPH2rZqTfoAt25IBTwK9y5wNsEeC8SyM839tHri5xx biecnc1ZO/v3bGQImgIxZNYrkyK7ilWmyeRvBkRnpfF3Mqo1Pwiy0KQquqGzRfMcIo0/ qJwA== X-Gm-Message-State: AOJu0Yw8zFsLgjyyy+SoYKAIp0VYbIOta0hpq/o+J8AS5AL48q0vpPLh wu2GebC7RNqtirKusA25EctfMPCmgk/oe3dPquGwG0laF1M+kmJncPCiXAC5Nhg= X-Google-Smtp-Source: AGHT+IEqho7w76m6+nPWwV3j9fAGvJFVqKDMS/DQRiOrn+gYlgjQbuDe7q2Ae/okScjoRm2rK6bGHA== X-Received: by 2002:a05:6a21:478b:b0:1ca:da51:6635 with SMTP id adf61e73a8af0-1cc89d29da2mr1717102637.1.1724393615889; Thu, 22 Aug 2024 23:13:35 -0700 (PDT) From: Akihiko Odaki Date: Fri, 23 Aug 2024 15:13:07 +0900 Subject: [PATCH v4 2/7] memory: Do not refer to "memory region's reference count" MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240823-san-v4-2-a24c6dfa4ceb@daynix.com> References: <20240823-san-v4-0-a24c6dfa4ceb@daynix.com> In-Reply-To: <20240823-san-v4-0-a24c6dfa4ceb@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier , Peter Maydell Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1724393809393116600 Now MemoryRegions do have their own reference counts, but they will not be used when their owners are not themselves. However, the documentation of memory_region_ref() says it adds "1 to a memory region's reference count", which is confusing. Avoid referring to "memory region's reference count" and just say: "Add a reference to a memory region". Make a similar change to memory_region_unref() too. Signed-off-by: Akihiko Odaki --- include/exec/memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 02f7528ec060..b9f0ad09bfad 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1217,7 +1217,7 @@ void memory_region_init(MemoryRegion *mr, uint64_t size); =20 /** - * memory_region_ref: Add 1 to a memory region's reference count + * memory_region_ref: Add a reference to a memory region * * Whenever memory regions are accessed outside the BQL, they need to be * preserved against hot-unplug. MemoryRegions actually do not have their @@ -1234,7 +1234,7 @@ void memory_region_init(MemoryRegion *mr, void memory_region_ref(MemoryRegion *mr); =20 /** - * memory_region_unref: Remove 1 to a memory region's reference count + * memory_region_unref: Remove a reference to a memory region * * Whenever memory regions are accessed outside the BQL, they need to be * preserved against hot-unplug. MemoryRegions actually do not have their --=20 2.46.0