Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't merge when the asking region entirely exists in the caching device #118

Open
akiradeveloper opened this issue Jul 18, 2016 · 2 comments
Assignees

Comments

@akiradeveloper
Copy link
Owner

If the read is partially hit, we always do merging: reading the backing data and read the cached data and then merge them.

        if (unlikely(dirtiness.data_bits != 255)) {

but if the wanting data is all found in the caching device, we don't need to merge like non-partial read-hit case.

@akiradeveloper
Copy link
Owner Author

akiradeveloper commented Jul 18, 2016

I made a reproducer.

class REPRO_118 extends DMTestSuite {
  // TODO enable this once dm-flakey is fixed
  ignore("don't merge when the asking region entirely exists in the caching device") {
    slowDevice(Sector.M(128)) { _slow => Linear.Table(_slow).create { slow =>
      fastDevice(Sector.M(32)) { _fast => Linear.Table(_fast).create { fast =>
        Writeboost.sweepCaches(fast)
        Writeboost.Table(slow, fast).create { s =>
          val data = DataBuffer.random(Sector(4).toB.toInt)
          s.bdev.write(Sector(1), data)
          s.dropTransient()
          // the data is cached

          // we don't merge the backing data and the cached data
          // but instead directly read the cached data
          slow.reload(Flakey.Table(_slow, 0, 1))
          assert(s.bdev.read(Sector(1), Sector(4)) isSameAs data)
        }
      }}
    }}
  }
}

@akiradeveloper
Copy link
Owner Author

remove -f (with force flag) should remove the device forcibly without waiting the flushing completed. I should write a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant