datto / dattobd

kernel module for taking block-level snapshots and incremental backups of Linux block devices
GNU General Public License v2.0
576 stars 122 forks source link

Why we always need bio_make_read_clone in snapshot mode? #357

Open hongyuntw opened 8 months ago

hongyuntw commented 8 months ago

Hello, I'd like to ask a question.

In snapshot mode, can we perform a check within the snap_trace_biofunction before executing bio_make_read_clone? If the current bio is not a copy on "first" write (verified through COW mapping can do that), can we directly passthrough this bio without the need for an additional read clone, thus reducing one read IO overhead?

Do you think this idea is reasonable, or was there a specific reason why it wasn't initially designed this way? Because each read operation seems to be quite resource-intensive in snapshot mode.

I also noticed there was a related discussion before https://github.com/datto/dattobd/issues/282 , but it seems there hasn't been any follow-up.

Thank you.