Re: [PATCH 15/79] block: rnull: add `use_per_node_hctx` config option

Alice Ryhl
2026-03-16T10:43:39Z

On Mon, Feb 16, 2026 at 12:35:02AM +0100, Andreas Hindborg wrote:
> Add a configfs attribute to enable per-NUMA-node hardware contexts.
> When enabled, the driver creates one hardware queue per NUMA node
> instead of the default configuration.
>
> Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>

This and other patches make me think that module parameters should have
value() return a copy of the value (and require Copy). For non-copy
types, there can be a separate value_ref() method. You would avoid *so*
many asterisks by doing that.

> +configfs_attribute!(DeviceConfig, 8,
> + show: |this, page| show_field(
> + this.data.lock().submit_queues == kernel::num_online_nodes(), page
> + ),
> + store: |this, page| store_with_power_check(this, page, |this, page| {
> + let value = core::str::from_utf8(page)?
> + .trim()
> + .parse::<u8>()
> + .map_err(|_| kernel::error::code::EINVAL)?
> + != 0;
> +
> + if value {
> + this.data.lock().submit_queues *= kernel::num_online_nodes();
> + }

kstrtobool again. Also, this is *multiplying* the existing submit_queues
value by the number of NUMA nodes?

> + use_per_node_hctx: u8 {
> + default: 0,
> + description:
> + "Use per-node allocation for hardware context queues, 0-false, 1-true. Default: 0-false",
> + },

formatting (rustfmt ignores macros)

Alice