From: Mikulas Patocka <mpatocka@redhat.com>
To: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Yang Yang <yang.yang@vivo.com>, Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@kernel.org>,
dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] dm: support retrieving struct dm_target from struct dm_dev
Date: Wed, 15 May 2024 17:53:23 +0200 (CEST) [thread overview]
Message-ID: <60bd4b9-8edd-7e22-ce8b-e5d0e43da195@redhat.com> (raw)
In-Reply-To: <ZkTXzG1yrPmW64Z6@redhat.com>
On Wed, 15 May 2024, Benjamin Marzinski wrote:
> On Tue, May 14, 2024 at 05:04:42PM +0800, Yang Yang wrote:
> > Add a list to the struct dm_dev structure to store the associated
> > targets, while also allowing differentiation between different target
> > types.
>
> I still think this is more complex than it needs to be. If devices that
> support flush_pass_around can guarantee that:
>
> 1. They will send a flush bio to all of their table devices
> 2. They are fine with another target sending the flush bio to their
> table devices
>
> Then I don't see why we need the table devices to keep track of all the
> different target types that are using them. Am I missing something here?
>
> If we don't need to worry about sending a flush bio to a target of each
> type that is using a table device, then all we need to do is call
> __send_empty_flush_bios() for enough targets to cover all the table
> devices. This seems a lot easier to track. We just need another flag in
> dm_target, something like sends_pass_around_flush.
>
> When a target calls dm_get_device(), if it adds a new table device to
> t->devices, then it's the first target in this table to use that device.
> If flush_pass_around is set for this target, then it also sets
> sends_pass_around_flush. In __send_empty_flush() if the table has
> flush_pass_around set, when you iterate through the devices, you only
> call __send_empty_flush_bios() for the ones with sends_pass_around_flush
> set.
>
> Or am I overlooking something?
>
> -Ben
Yes, I agree that it is complex.
I reworked the patch, I'm testing it now and I'll send it when it passes
the tests.
Mikulas
next prev parent reply other threads:[~2024-05-15 15:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 9:04 [PATCH 0/5] dm: empty flush optimization Yang Yang
2024-05-14 9:04 ` [PATCH 1/5] dm: introduce flush_pass_around flag Yang Yang
2024-05-14 9:04 ` [PATCH 2/5] dm: add __send_empty_flush_bios() helper Yang Yang
2024-05-14 9:04 ` [PATCH 3/5] dm: support retrieving struct dm_target from struct dm_dev Yang Yang
2024-05-15 15:42 ` Benjamin Marzinski
2024-05-15 15:53 ` Mikulas Patocka [this message]
2024-05-16 20:49 ` [PATCH] dm: optimize flushes Mikulas Patocka
2024-05-17 8:55 ` YangYang
2024-05-22 16:10 ` Mike Snitzer
2024-05-22 21:05 ` Mikulas Patocka
2024-05-23 17:46 ` [PATCH v2] " Mikulas Patocka
2024-05-23 18:02 ` Mike Snitzer
2024-05-28 11:37 ` Mikulas Patocka
2024-05-23 22:17 ` Eric Wheeler
2024-05-15 16:00 ` [PATCH 3/5] dm: support retrieving struct dm_target from struct dm_dev Benjamin Marzinski
2024-05-16 2:12 ` YangYang
2024-05-16 16:39 ` Benjamin Marzinski
2024-05-16 1:55 ` YangYang
2024-05-16 15:29 ` Benjamin Marzinski
2024-05-17 7:48 ` YangYang
2024-05-17 14:33 ` Benjamin Marzinski
2024-05-20 3:12 ` YangYang
2024-05-14 9:04 ` [PATCH 4/5] dm: Avoid sending redundant empty flush bios to the same block device Yang Yang
2024-05-14 9:04 ` [PATCH 5/5] dm linear: enable flush optimization function Yang Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=60bd4b9-8edd-7e22-ce8b-e5d0e43da195@redhat.com \
--to=mpatocka@redhat.com \
--cc=agk@redhat.com \
--cc=bmarzins@redhat.com \
--cc=dm-devel@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=snitzer@kernel.org \
--cc=yang.yang@vivo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox