[PATCH v4 9/9] powerpc/pseries/vas: Write 'nr_total_credits' for QoS credits change
Nicholas Piggin
npiggin at gmail.com
Wed Feb 23 18:33:40 AEDT 2022
Excerpts from Haren Myneni's message of February 20, 2022 6:03 am:
>
> pseries supports two types of credits - Default (uses normal priority
> FIFO) and Qality of service (QoS uses high priority FIFO). The user
> decides the number of QoS credits and sets this value with HMC
> interface. With the core add/removal, this value can be changed in HMC
> which invokes drmgr to communicate to the kernel.
>
> This patch adds an interface so that drmgr command can write the new
> target QoS credits in sysfs. But the kernel gets the new QoS
> capabilities from the hypervisor whenever nr_total_credits is updated
> to make sure sync with the values in the hypervisor.
>
> Signed-off-by: Haren Myneni <haren at linux.ibm.com>
> ---
> arch/powerpc/platforms/pseries/vas-sysfs.c | 33 +++++++++++++++++++++-
> arch/powerpc/platforms/pseries/vas.c | 2 +-
> arch/powerpc/platforms/pseries/vas.h | 1 +
> 3 files changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/vas-sysfs.c b/arch/powerpc/platforms/pseries/vas-sysfs.c
> index e24d3edb3021..20745cd75f27 100644
> --- a/arch/powerpc/platforms/pseries/vas-sysfs.c
> +++ b/arch/powerpc/platforms/pseries/vas-sysfs.c
> @@ -25,6 +25,33 @@ struct vas_caps_entry {
>
> #define to_caps_entry(entry) container_of(entry, struct vas_caps_entry, kobj)
>
> +/*
> + * This function is used to get the notification from the drmgr when
> + * QoS credits are changed. Though receiving the target total QoS
> + * credits here, get the official QoS capabilities from the hypervisor.
> + */
> +static ssize_t nr_total_credits_store(struct vas_cop_feat_caps *caps,
> + const char *buf, size_t count)
> +{
> + int err;
> + u16 creds;
> +
> + /*
> + * Nothing to do for default credit type.
> + */
> + if (caps->win_type == VAS_GZIP_DEF_FEAT_TYPE)
> + return -EOPNOTSUPP;
> +
> + err = kstrtou16(buf, 0, &creds);
> + if (!err)
> + err = vas_reconfig_capabilties(caps->win_type);
So what's happening here? The creds value is ignored? Can it just
be a write-only file which is named appropriately to indicate it
can be written-to to trigger an update?
Thanks,
Nick
More information about the Linuxppc-dev
mailing list