From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796013148; b=SVGNcaPQ2p1rluRBAmgj+S/dCilJnME3At9HquhvRhhOfCn1kjOIs8a6yw6OKF+U6bGJ PJ36lFCYeUory/Kibj0uyfLcatu9MWFzkHb99lUzUHgnlQOnHQ3lbdBXjjVFeFe1VFUtZ dBhq3P4JJuzChQobIVyLmTliKPd30RURMBzwIK5G4/aeQsOVw9yWQ3Ki1yZn0je8R6eAy cOD2Xh8VDQz7jOVIF/qmgSiaJgEkIoXRNvEI25ymR3WRw9oLIQ1JC5bo/zMeZaoCZFW4K E5i+JPMJ60CZIUS1K7+zlAGonT0M8ZW7kQA1dFrhuF97C2v35/KWaVwLl0W/gToaJxQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796013148; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:Content-Language:Organization: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=cRpc4GvaTV4erkc8TDX2yIxaojSklJh2M1zWCrKnDFk=; b=Q1/p7eMC8FE6GleaVv5OvvEN+3Gh0am04BdsNDByBf99/+1Yt5S7sicV4Cx87Yykro4+ RhHnL7BnzJbZbRcPxGA8nOgVGwm6N91681g4lYRgGG1X5QQo+ktxTIe6cDVQMPRDWAKS2 35c2s8E95wsY7ozuC8MbHZgcCmN3/BK1B9lK46Cm04Mo1djGbU7gtbzk4zBF4dVcX/aIj ZKvWiYXdkUPUSQglXBrK7HlXKmt6RS64mrI1dzce2c9fqkyn48Ks6Ebg2uzu8KjOkhBrz 35a/PTgyUTxXpoQZjpINPGKnBoDJaRXBFbiMyX4cteJwvb6alQ4kkhHRzC75Rlfwmug== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=N5WG0XE0; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D11BE606A32D for ; Mon, 30 Nov 2026 04:32:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=N5WG0XE0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 014EE1F000C1; Mon, 30 Nov 2026 04:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796013148; bh=cRpc4GvaTV4erkc8TDX2yIxaojSklJh2M1zWCrKnDFk=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=N5WG0XE08PpQpJh/HqtAxmJ6hB1u2YConzclnJL/x/hw+6hVO35dc/ynvVeSyvoQh oGdiFlyiNny7ANNxQj73bjShIloWfPInJOYBKQhr6yneAyi3jhzWuU6RP8soBKGPAz SpvnXMl0kRdIZn71OPbTTg+mvne+4PbtYnxvErO4boDdDR+JC2LNObqCeNdeJziYZS OBKsLd8TH364dQgPsZl052nSR44GiiL6BoW1FlkMt4sJ4nm1MJjCfRcy0OjeRGzLEK RpKvxEMyUPNQMHSDhjH4J5q+hB45C4m1PdTplBEChEsOsY3f7NnybUv2pHc5HHbw/d Vr7h6EdxFBWFQ== Message-ID: Date: Mon, 30 Nov 2026 13:32:26 +0900 X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/2] block: don't wait for all RCU callbacks when freeing zone write plugs To: Qiliang Yuan , Jens Axboe Cc: Bart Van Assche , linux-block@vger.kernel.org References: <20261126-feat-blk-zoned-rcu-barrier-v4-0-a4ab1d2162e0@linux.dev> <20261126-feat-blk-zoned-rcu-barrier-v4-1-a4ab1d2162e0@linux.dev> From: Damien Le Moal Content-Language: en-US Organization: Western Digital Research In-Reply-To: <20261126-feat-blk-zoned-rcu-barrier-v4-1-a4ab1d2162e0@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/27/26 12:43, Qiliang Yuan wrote: > Zone write plugs are allocated from a per-disk mempool and freed with > call_rcu(). Before destroying the mempool, which happens every time a > zoned disk is released, disk_destroy_zone_wplugs_hash_table() calls > rcu_barrier() so that no zone write plug is still waiting to be returned > to it. > > rcu_barrier() waits for the RCU callbacks queued on every CPU by anyone, > which usually takes a grace period or more, even when the disk had no > zone write plug left to free. Removing many zoned disks, such as the SMR > drives of a storage node taken offline, pays this once per disk. > > Count the zone write plugs of the disk that wait for their RCU callback, > and call rcu_barrier() only when that count is not zero. Use > rcu_barrier() rather than waiting for the count to drop, so that lazily > queued callbacks (CONFIG_RCU_LAZY) are still flushed. > > Removing 32 zoned null_blk or scsi_debug devices, base and patched > kernels alternating over 4 rounds of 5 runs, median of the 20 runs and > interquartile range in parentheses; "with plugs" leaves four partially > written zones, and so four zone write plugs, on each null_blk device: > > devices before (ms) after (ms) change > null_blk 848 (828-862) 424 (410-430) -50% > null_blk, with plugs 865 (854-876) 876 (866-886) +1% > scsi_debug, host-managed 1057 (1024-1092) 740 (722-779) -30% > > Signed-off-by: Qiliang Yuan I am not sure that the atomic_read_acquire() is necessary (atomic_read() should be fine), but I guess it does not hurt either. So, Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research