linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Multi-device dm-log-writes
@ 2017-09-01 18:31 Josef Bacik
  2017-09-01 20:05 ` Mike Snitzer
  2017-09-04 14:42 ` [dm-devel] [RFC] " Heinz Mauelshagen
  0 siblings, 2 replies; 7+ messages in thread
From: Josef Bacik @ 2017-09-01 18:31 UTC (permalink / raw)
  To: snitzer, amir73il, dm-devel, linux-fsdevel, kernel-team, clm,
	osandov, rwareing

Hello,

I'm looking at extending dm-log-writes to support multiple devices to log to a
single log.  The benefit for this is testing things like btrfs's raid code, the
xfs realtime device thing, and even mdraid.  I left room in the log format to
change it as needed with this use case in mind, so I'm not worried about that.
I'm more looking for verification that my plan doesn't suck, or if it does suck
what would be a better approach.  I'll lay out the different parts to try and
make this as quick and concise as possible.

1) Add a "log-writes-log" target that just takes the single device we are going
to use as the log.  This will do the work of taking the log IO from the actual
"log-writes" target and putting it in the log.

2) Extend the "log-writes" target table format to include an "id" at the end of
the table line that will be used to indicate which device the log entry will be
fore.  In this case the "log device" portion will point at the "log-writes-log"
device mapper target.  Everything would work normally, except in this mode we
send the log bio's down with bi_sector = 0 and let the "log-writes-log" target
do the actual mapping for the bio.

So to test with multiple devices you would have to do something like

dmsetup create log --table "0 <size> log-writes-log <log device>"
dmsetup create lw1 --table "0 <size> log-writes <device> /dev/mapper/log 0"
dmsetup create lw2 --table "0 <size> log-writes <device> /dev/mapper/log 1"
mkfs.btrfs -d raid1 -m raid1 /dev/mapper/lw1 /dev/mapper/lw2
mount /dev/mapper/lw1 /mnt
<do whatever>
umount /mnt
dmsetup remove lw1
dmsetup remove lw2
dmsetup remove log

Mike, I would simply add a new struct target_type for log-writes-log that would
do it's own ->map function to re-route the bio's coming into them.  I'd also
change the ->ctr function of the log-writes target_type to handle the new id
field and do the new fancy thing if we have that field populated.  Does that
sound reasonable from an implementation point of view?

Any comments or suggestions are welcome.  I haven't written any code yet so I'm
open to other ideas.  Thanks,

Josef

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-09-07 13:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-01 18:31 [RFC] Multi-device dm-log-writes Josef Bacik
2017-09-01 20:05 ` Mike Snitzer
2017-09-02  0:10   ` Josef Bacik
2017-09-02  8:12     ` Amir Goldstein
2017-09-02  9:54       ` Josef Bacik
2017-09-04 14:42 ` [dm-devel] [RFC] " Heinz Mauelshagen
2017-09-07 13:54   ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).