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 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC9BAEE49A5 for ; Mon, 21 Aug 2023 07:40:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXzT5-0000Ea-PP; Mon, 21 Aug 2023 03:36: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 1qXzSU-0008Jg-QB for qemu-devel@nongnu.org; Mon, 21 Aug 2023 03:36:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXzSS-00065d-J3 for qemu-devel@nongnu.org; Mon, 21 Aug 2023 03:36:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692603375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7QspIay/Ak4bzIfRMtubKTZxqo7vPj78aDXwUXCY3V8=; b=g06l1gzrAjKKAH5myBU4iOuQcZGeXojmcVeiSRH57lIqKfx7WqR3VfTZclrv/bORE58MhB IaCP8TNMxBNFIPNRWcEgsoejZ98RpWeKGtQ3q0yRsgH98T+XQpUuSq2y/U2H8Nfje9Hz2b y/Yqm6qfh4bf/tLUchx/LV7fxlZ2wko= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-213-_CgIPPz4NIer3gL3OMP5vw-1; Mon, 21 Aug 2023 03:35:09 -0400 X-MC-Unique: _CgIPPz4NIer3gL3OMP5vw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3fef27968adso2905905e9.3 for ; Mon, 21 Aug 2023 00:35:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692603308; x=1693208108; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7QspIay/Ak4bzIfRMtubKTZxqo7vPj78aDXwUXCY3V8=; b=T0Z/HntpMtp8fHqta1Q5Zg4b5EcrRA4LXQQWzlnifWOtwFuxfYOdeFRdcC9j44EYUk eVyGQs3fzn01gh8gsEoWe4N+Iq0LHpWMCUMG5Gzk1brI12Jh6Br1R0n8XITkYbwHA5UG kEYXEB1PdAC0R/n8xZmoiKva17sFhHO7fi98WDPzzN+3mXjQbFOGeqpK4iqIB4gFcC2W wJkFVRLpsbDREx7k7VLAMZ9hEHr5XSElkJO3I6MzvYmuaNPuX9KR/E4K3gEtXRimgZ/y i7xtyeJfhno2khy5buJodT2JkedzMVZO5QvNxIYlOigpNpQDvOWVtzdXE2Vpx1M/0Ohp m7xA== X-Gm-Message-State: AOJu0YxMmeJrpPP7zU5rKnzRMuF5BSdHnKUgUTms9Rv5HrloMXA9Gm/7 4q0xStiegqjOcvPW/7jL4PPojKAKjqWD2WhQOBK38/rSWdYaSYByNxf84hZFVxIFGkv5yZArVuo aHhFbxWGvESHtEgg= X-Received: by 2002:a7b:cc95:0:b0:3fe:d7b9:8238 with SMTP id p21-20020a7bcc95000000b003fed7b98238mr4419800wma.18.1692603308024; Mon, 21 Aug 2023 00:35:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOnMny8jgDibdz+z3N88T51qFcrQK+SIl3/7PArl+RFKegsVHB+drrxEQQWu8e1BRnbd97cQ== X-Received: by 2002:a7b:cc95:0:b0:3fe:d7b9:8238 with SMTP id p21-20020a7bcc95000000b003fed7b98238mr4419785wma.18.1692603307749; Mon, 21 Aug 2023 00:35:07 -0700 (PDT) Received: from [192.168.149.106] (58.254.164.109.static.wline.lns.sme.cust.swisscom.ch. [109.164.254.58]) by smtp.gmail.com with ESMTPSA id y19-20020a1c4b13000000b003fbe4cecc3bsm14990067wma.16.2023.08.21.00.35.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Aug 2023 00:35:07 -0700 (PDT) Message-ID: Date: Mon, 21 Aug 2023 09:35:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 09/21] block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK Content-Language: de-CH To: Kevin Wolf , qemu-block@nongnu.org Cc: stefanha@redhat.com, eblake@redhat.com, pbonzini@redhat.com, vsementsov@yandex-team.ru, qemu-devel@nongnu.org References: <20230817125020.208339-1-kwolf@redhat.com> <20230817125020.208339-10-kwolf@redhat.com> From: Emanuele Giuseppe Esposito In-Reply-To: <20230817125020.208339-10-kwolf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=eesposit@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -63 X-Spam_score: -6.4 X-Spam_bar: ------ X-Spam_report: (-6.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-4.279, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Am 17/08/2023 um 14:50 schrieb Kevin Wolf: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_replace_child_tran(). These callers will > typically already hold the graph lock once the locking work is > completed, which means that they can't call functions that take it > internally. > > While a graph lock is held, polling is not allowed. Therefore draining > the necessary nodes can no longer be done in bdrv_remove_child() and > bdrv_replace_node_noperm(), but the callers must already make sure that > they are drained. > > Note that the transaction callbacks still take the lock internally, so > tran_finalize() must be called without the lock held. This is because > bdrv_append() also calls bdrv_attach_child_noperm(), which currently > requires to be called unlocked. Once it changes, the transaction > callbacks can be changed, too. > > Signed-off-by: Kevin Wolf Reviewed-by: Emanuele Giuseppe Esposito