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

Fast Dedup: dnode: allow storage class to be overridden by object type #15894

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

allanjude
Copy link
Contributor

Motivation and Context

The upcoming “dedup log” feature requires a new type of object to store the log. We will want to use the dedup storage class, however as a new object type (“OTN”) it has no distinguishing features, so we can’t set the storage class for it.

Description

This allows a caller to set an alternate object type on a dnode hold to use when computing the storage class. Writes generated under that hold will be written with the storage class for the overridden type.

(It would be far better if this was stored with the dnode somewhere, but that would be a serious on-disk format change and is a massive undertaking in its own right).

How Has This Been Tested?

TBD.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Feb 15, 2024
@robn robn force-pushed the fdt-rel-dnode-storage-class branch from c4ae15b to 9bccf29 Compare February 15, 2024 19:58
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. But I am thinking if storage specification could possibly be done at some different layer. We could specify, for example, that within ZAP the first block and hash blocks are more important than others.

@robn robn force-pushed the fdt-rel-dnode-storage-class branch from 9bccf29 to bf56931 Compare May 15, 2024 03:39
@robn
Copy link
Contributor

robn commented May 15, 2024

[Fast dedup stack rebased to master 3c941d1]

@robn
Copy link
Contributor

robn commented May 15, 2024

Looks fine to me. But I am thinking if storage specification could possibly be done at some different layer. We could specify, for example, that within ZAP the first block and hash blocks are more important than others.

Yeah, there's a lot I would like to do like that. In my head it's a kind of "reimagine dmu_write_policy()" superproject.

At least with this, there's no on-disk format change, so we can punt the actual design work down the road a bit.

robn added 2 commits May 15, 2024 13:56
Rather than picking out specific values out of the properties, just pass
the entire zio in, to make it easier in the future to use more of that
info to decide on the storage class.

I would have rathered just pass io_prop in, but having spa.h include
zio.h gets a bit tricky.

Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: iXsystems, Inc.
spa_preferred_class() selects a storage class based on (among other
things) the DMU object type. This only works for old-style object types
that match only one specific kind of thing. For DMU_OTN_ types we need
another way to signal the storage class.

This commit allows the object type to be overridden in the IO policy for
the purposes of choosing a storage class. It then adds the ability to
set the storage type on a dnode hold, such that all writes generated
under that hold will get it.

This method has two shortcomings:

- it would be better if we could "name" a set of storage class
  preferences rather than it being implied by the object type.
- it would be better if this info were stored in the dnode on disk.

In the absence of those things, this seems like the smallest possible
change.

Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: iXsystems, Inc.
@robn robn force-pushed the fdt-rel-dnode-storage-class branch from bf56931 to 02b4741 Compare May 15, 2024 04:02
@robn
Copy link
Contributor

robn commented May 15, 2024

@behlendorf rebased to sit alone on top of master. If the tests pass, this should be safe to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Code Review Needed Ready for review and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants