[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <32eaf406-aca7-a17a-813a-631616480e42@dorminy.me>
Date: Sat, 19 Mar 2022 14:31:49 -0400
From: Sweet Tea Dorminy <sweettea-kernel@...miny.me>
To: Yusuf Khan <yusisamerican@...il.com>, linux-btrfs@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, dsterba@...e.com,
josef@...icpanda.com, clm@...com
Subject: Re: [PATCH] btrfs: raid56: do blk_check_plugged check twice while
writing
Hi Yusuf:
On 3/18/22 21:18, Yusuf Khan wrote:
> Do the check to see if the drive was connected twice in case that
> the first was a fluke.
Block plugging is not actually about checking the connectivity of the
drive; it's about batching IO submission. Specifically, when a client of
the block layer (a filesystem or DM device, for instance) knows that it
needs to send a whole batch of IO to disk from a thread, it can request
the thread's be temporarily delayed, with blk_start_plug()
(block/blk-core.c has a lengthy great comment about it). Then it submits
its batch of requests. Finally, it requests the plug be released. This
is useful because it can allow better IO by releasing a large,
potentially better ordered batch at once.
In this particular case, to my understanding, blk_check_plug() checks
whether the current thread is plugged, and, if it is, it adds the rbio
to a list; when the plug expires, perhaps from the thread going to
sleep, the plug callback gets called, specifically btrfs_raid_unplug(),
which sorts the pending IOs.
As such, it shouldn't be necessary to check whether the thread is
plugged twice. Your change description is a little light on *why* you'd
like to check twice; maybe I'm missing something.
Hope this helps,
Sweet Tea
Powered by blists - more mailing lists