Skip to contentSkip to conversation

Was: [patch 1/1] md/dm: Reduce stack usage with stacked block devices

DISCUSSION Molle Bestefich 4 participants 8 messages Jan 11, 2006 – Jan 12, 2006 Device mapper

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · Alasdair G Kergon

My main concern is whether the timing changes implicit in this patch will make the rare data-corrupting races in the existing snapshot code more likely.

Haha! Rare my a** :-).

Quoted 2 lines

(I'm working on a fix for these races, but the unfinished patch is already several hundred lines long.)

Sounds cool.
A few questions, if you have the time:

* Do you think that there is only 1 data corruption bug in dm snapshot and that the code is otherwise good (data consistency wise)?

* Is dm-snapshot being actively developed?

* Which organization/person is the main developer on dm-snapshot?

Quoted 2 lines

It would be helpful if some people on this mailing list would test this patch in various scenarios and report back.

I'd be more than happy to test improvements to dm-snapshot. Is this supposed to be one?

What's the codebase that this patch applies to?

#1 lore raw
Quoted 2 lines · Molle Bestefich

* Do you think that there is only 1 data corruption bug in dm snapshot and that the code is otherwise good (data consistency wise)?

There are several races. The code makes some ordering assumptions about the I/O but does nothing to enforce those assumptions. So if you're unlucky and I/O happens to complete in the wrong order or too soon you can see transient corruption in the snapshot or reference memory that has been freed and perhaps reallocated to something else.

Some references:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175830
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=164959
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=173209

Quoted 2 lines

* Is dm-snapshot being actively developed?
* Which organization/person is the main developer on dm-snapshot?

Not actively developed, no. Long-term we want to replace it with something better. But at the moment I'm reviewing the existing code and fixing as many problems as I can find.

Quoted 1 line

What's the codebase that this patch applies to?

The -mm tree is here:
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/

The patches I'm working on will appear here very soon now (and I'll send an email dm-devel):
http://www.kernel.org/pub/linux/kernel/people/agk/patches/2.6/

Alasdair

Signature · 1 line
[email protected]
#2 lore raw
Quoted 6 lines · Alasdair G Kergon

There are several races. The code makes some ordering assumptions about the I/O but does nothing to enforce those assumptions. So if you're unlucky and I/O happens to complete in the wrong order or too soon you can see transient corruption in the snapshot or reference memory that has been freed and perhaps reallocated to something else.

Thanks a lot for the status report.

Quoted 1 line

Some references:

[snip]

Thanks. I opened a bug report myself at one point:
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=120937

Quoted 2 lines

Not actively developed, no. Long-term we want to replace it with something better.

That's really too bad :-(.
There's a lot of people over in the Xen community that could *really* use something like dm-snapshot if it was stable and production mature.

Quoted 2 lines

But at the moment I'm reviewing the existing code
and fixing as many problems as I can find.

Sounds great. Shout out if you need help :-).
(With testing or other monkey work, not C coding. I'm not a good C coder.)

Thanks!

#3 lore raw
Quoted 8 lines · Molle Bestefich
Quoted 6 lines · Alasdair G Kergon

There are several races. The code makes some ordering assumptions about the I/O but does nothing to enforce those assumptions. So if you're unlucky and I/O happens to complete in the wrong order or too soon you can see transient corruption in the snapshot or reference memory that has been freed and perhaps reallocated to something else.

Quoted 10 lines

Thanks a lot for the status report.

Quoted 1 line

Some references:

[snip]

Thanks. I opened a bug report myself at one point:
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=120937

Quoted 2 lines

Not actively developed, no. Long-term we want to replace it with something better.

does this mean/confirm linux 2.6.x will not have a stable snapshot support any time soon?

i believe tons of people want linux has a stable snapshot support.

Quoted 17 lines

That's really too bad :-(.
There's a lot of people over in the Xen community that could *really* use something like dm-snapshot if it was stable and production mature.

Quoted 2 lines

But at the moment I'm reviewing the existing code
and fixing as many problems as I can find.

Sounds great. Shout out if you need help :-).
(With testing or other monkey work, not C coding. I'm not a good C coder.)

Thanks!

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#4 lore raw
Quoted 2 lines · Ming Zhang

does this mean/confirm linux 2.6.x will not have a stable snapshot support any time soon?

Stable, yes.
Efficient, unlikely with the current implemention - hence the need for a rewrite.

If you have 5 snapshots of the same origin, the current implemention takes 5 copies of the data when you change it. That approach is never going to scale well! And it uses lots of memory.

Next patch is heading for dm-devel in the next hour or so...

Alasdair

Signature · 1 line
[email protected]
#5 lore raw
Quoted 5 lines · Alasdair G Kergon
Quoted 2 lines · Ming Zhang

does this mean/confirm linux 2.6.x will not have a stable snapshot support any time soon?

Stable, yes.

yes, we want stable first.

Quoted 7 lines

Efficient, unlikely with the current implemention - hence the need for a rewrite.

If you have 5 snapshots of the same origin, the current implemention takes 5 copies of the data when you change it. That approach is never going to scale well! And it uses lots of memory.

yes, you are right. is there any new rewrite action proposed or planned?

Quoted 2 lines

Next patch is heading for dm-devel in the next hour or so...

thanks!

Quoted 2 lines

Alasdair

#6 lore raw
Quoted 11 lines · Ming Zhang
Quoted 7 lines · Alasdair G Kergon

Efficient, unlikely with the current implemention - hence the need for a rewrite.

If you have 5 snapshots of the same origin, the current implemention takes 5 copies of the data when you change it. That approach is never going to scale well! And it uses lots of memory.

yes, you are right. is there any new rewrite action proposed or planned?

My understanding is that much of RedHat's Cluster Snapshot Block Device (CSNAP) core is a candidate for the dm-snapshot rewrite:
http://sources.redhat.com/cluster/csnap/csnap.ps

Along with other improvements, performance would be addressed with a shared exception table (tree) for all snapshots (only one copy of each exception). When I spoke with Daniel Phillips (author of CSNAP stuffs) a few months ago he said CSNAP is on the back burner until others realize just how bad the existing dm-snapshot is. He is looking/waiting for others who are willing to contribute in moving CSNAP's snapshot improvements into dm-snapshot++. Unfortunately I'd only be able to contribute testing at this time...

Mike

#7 lore raw
Quoted 17 lines · Mike Snitzer
Quoted 11 lines · Ming Zhang
Quoted 7 lines · Alasdair G Kergon

Efficient, unlikely with the current implemention - hence the need for a rewrite.

If you have 5 snapshots of the same origin, the current implemention takes 5 copies of the data when you change it. That approach is never going to scale well! And it uses lots of memory.

yes, you are right. is there any new rewrite action proposed or planned?

My understanding is that much of RedHat's Cluster Snapshot Block Device (CSNAP) core is a candidate for the dm-snapshot rewrite:
http://sources.redhat.com/cluster/csnap/csnap.ps

Quoted 8 lines

Along with other improvements, performance would be addressed with a shared exception table (tree) for all snapshots (only one copy of each exception). When I spoke with Daniel Phillips (author of CSNAP stuffs) a few months ago he said CSNAP is on the back burner until others realize just how bad the existing dm-snapshot is. He is looking/waiting for others who are willing to contribute in moving CSNAP's snapshot improvements into dm-snapshot++. Unfortunately I'd only be able to contribute testing at this time...

Thanks a lot for this information! Just have a quick glimpse on abstract. Looks interesting.

Quoted 2 lines

Mike