On Thu, 2021-09-16 at 15:12 -0700, Dan Williams wrote: > On Tue, Aug 31, 2021 at 2:05 AM Vishal Verma <[email protected]> wrote: > > > > These patches add policy (config file) support to daxctl. The > > introductory user is daxctl-reconfigure-device. Sysadmins may wish to > > use daxctl devices as system-ram, but it may be cumbersome to automate > > the reconfiguration step for every device upon boot. > > > > Introduce a new option for daxctl-reconfigure-device, --check-config. > > This is at the heart of policy based reconfiguration, as it allows > > daxctl to look up reconfiguration parameters for a given device from the > > config system instead of the command line. > > > > Some systemd and udev glue then automates this for every new dax device > > that shows up, providing a way for the administrator to simply list all > > the 'system-ram' UUIDs in a config file, and not have to worry about > > anything else. > > > > An example config file can be: > > > > # cat /etc/ndctl/daxctl.conf > > Take these comments as provisional until I read through the rest, but > this is just a reaction to the proposed ini format.
I somehow missed this email originally, and just saw it on lore.. > > > > [auto-online unique_identifier_foo] > > I am thinking this section name should be "reconfigure-device > unique_identifier_foo" if only because resize might also be something > someone wants to do, and if other commands get config automation it > makes it clearer which config snippets apply to which command. Yep that makes sense - I'll change this. > > > uuid = 48d8e42c-a2f0-4312-9e70-a837faafe862 > > I think this should be called: > > "nvdimm.uuid" > > ...or something like that to make it clear this depends on dax devices > emitted by libnvdimm, and not those that come from "soft-reserved" > memory. It also helps distinguish if we ever get UUIDs in the HMAT > which is something I have been meaning to propose. Yep makes sense, will change. > > mode = system-ram > > I can see this being "mode = devdax" if feature was being used to > change size or alignment. Agreed, but that should 'just work' right - especially once we rename the section name from auto-online to reconfigure-device. > > > online = true > > movable = false > > I wonder if these keys should be prefixed by the mode name: > > system-ram.online = true > system-ram.movable = false Hm, maybe, but since the config options feed directly into the commands params, I figured we can let the command's option parsing throw any errors for incompatible options. My hope was for config identifiers to - as far as possible - exactly match command-line options. If we do make changes like this, I feel for every command that supports config, the man page is asking for a dedicated config section documenting every config option it supports. Maybe this is a good idea regardless :) > > ...so it's a bit more self documenting about which parameters are > sub-options, and delineates them from generic options like size. > > > Any file under '/etc/ndctl/' can be used - all files with a '.conf' suffix > > will be considered when looking for matches. > > any concern about name collisions between ndctl, daxctl, and cxl-cli > section names? Yep good point, changed this to be in /etc/daxctl/, and cxl-cli can get its own directory too when the time comes.
