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=1796013173; b=BOOi9Wp1X8054nVe5kZlZCZcNzR4OQzTHMIKItKf1KNbuK8ZuqDo/jkfVveQgFHWgIEU 3f/uPPIyy/gxkaB8/+WM8jWkkd7pTmRGGPICFYJMaxDvMcXE3v39CCL7NvNTI1NDZJGip Gs06hfWsswJyARyiRraG+MvCW2UMQkvFbv6Y91Tr6SYqJ6LjBBzgQhE5DcDFhn57/ZoCG UXPqMsJv7dOHNRnBz6ySvfN1RF7JHsegbPBnWUGmGdcS+sO35bte5WV4wDCvK1uipWPF2 G9HSMqpTvN+8VMjBTJNPF+bvpEU4h6uoLppI8f+5h8CaM33UwIhYN5l4FprTe599yLQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796013173; 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=xt3ANjCSO+KltMR0zK4zJIRNBIb2pTRAb4lsA7IbFU4=; b=LEmygjNwbeiGuALNY5Iw4h/IEKZ0vtuSnqOi1fWx2YRycqng0w8rHTT4lKvtBlWl3Y5v kvPpq1xjZrZJDDclQhYAoXnvCmD9+Z0EAVH7jrKSs0P5i59kL3hyWz2ngCrmcHSUCfavF yBjg/Sc3+Ah5moqL5h7Cvk+tFtyF/WyLt6iEmedGNvYXeh0qpBrO8IZ1E5V02ALZ3XOVD WTFWTr06gJoSKVUZGvr9PGN7Ua259TvkUdwFvhSNhIrpIpwLSmt+Jhm/0VnpRHdrKDwaA BnClYFXOfUcqFozWqxIUD0Yti4xoLHeajfl+OZnKl0pv7O7m4y0hc0TbRyG4N1dJwrA== 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=B1Bxr1Fa; 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 CEB59606A337 for ; Mon, 30 Nov 2026 04:32:53 +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=B1Bxr1Fa Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B8BB1F00898; Mon, 30 Nov 2026 04:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796013172; bh=xt3ANjCSO+KltMR0zK4zJIRNBIb2pTRAb4lsA7IbFU4=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=B1Bxr1FaqP8KE2l6qRRqW/4GsXTDZZCjutTiLNFdFbEcqdiVshGXoV4/ENVbLW5yq vdftH40xUMjM5jiRW2YlNRxL/l8K42Do4braxqGYnKZND21i4gfpQhR30rxmeVFBPL 4fPmbjeenQ0Bunsv9nVgRrXxpih/30I0kUCo3s5SOslJDhhSxPV30/M/LhS86G2xfS DErBSqYmhsKn8nZiKwXgeiciFc2RVkOBULU3VPoygsMZClC3uA2JbwAEJCCSUL8MGY tTFfgsvkBzo6jFf2gCz+KznMJjo/R4sa2FHYk4KvuJ+7FvFkKvGuOPBgcBZDX86R6q 7/TJktxbBK6BA== Message-ID: <2cc3acf0-9c76-4961-9708-f0df5e23d4bf@kernel.org> Date: Mon, 30 Nov 2026 13:32:50 +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 2/2] block: free remaining zone write plugs directly on disk release 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-2-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-2-a4ab1d2162e0@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/27/26 12:43, Qiliang Yuan wrote: > disk_destroy_zone_wplugs_hash_table() runs from disk_release() and frees > the zone write plugs still in the hash table by marking them dead, which > drops their last reference and queues them for RCU freeing. Nothing can > look up a plug at that point: the function already walks the hash table > without zone_wplugs_hash_lock and frees the table itself with kfree(). > > Zoned drives taken offline usually have partially written zones, so > their plugs are still in the hash table when the disk is released. Each > such disk then queues RCU callbacks and waits for them in rcu_barrier() > before destroying the mempool. > > Unhash these plugs and return them to the mempool directly, keeping the > checks of disk_free_zone_wplug(). The zones state array that freeing > them would update is freed right after by disk_release_zone_resources(). > > Removing 32 zoned null_blk or scsi_debug devices, kernels with and > without this patch alternating over 4 rounds of 5 runs, in the same > rounds as the previous patch, 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, and the > scsi_debug devices have no plugs left at release: > > devices before (ms) after (ms) change > null_blk 424 (410-430) 428 (414-438) +1% > null_blk, with plugs 876 (866-886) 433 (426-438) -51% > scsi_debug, host-managed 740 (722-779) 742 (722-767) 0% > > Suggested-by: Bart Van Assche > Signed-off-by: Qiliang Yuan Looks good to me. Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research