[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1601131042590.3575@nanos>
Date: Wed, 13 Jan 2016 10:47:26 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Jacob Pan <jacob.jun.pan@...ux.intel.com>
cc: LKML <linux-kernel@...r.kernel.org>,
Linux PM <linux-pm@...r.kernel.org>,
Rafael Wysocki <rafael.j.wysocki@...el.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
X86 Kernel <x86@...nel.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v2 2/2] powercap/rapl: reduce ipi calls
On Tue, 12 Jan 2016, Jacob Pan wrote:
> @@ -805,30 +809,18 @@ static int rapl_write_data_raw(struct rapl_domain *rd,
> enum rapl_primitives prim,
> unsigned long long value)
> {
> - u64 msr_val;
> - u32 msr;
> struct rapl_primitive_info *rp = &rpi[prim];
> int cpu;
> + u64 bits;
>
> cpu = find_active_cpu_on_package(rd->package_id);
> if (cpu < 0)
> return cpu;
> - msr = rd->msrs[rp->id];
> - if (rdmsrl_safe_on_cpu(cpu, msr, &msr_val)) {
> - dev_dbg(&rd->power_zone.dev,
> - "failed to read msr 0x%x on cpu %d\n", msr, cpu);
> - return -EIO;
> - }
> - value = rapl_unit_xlate(rd, rd->package_id, rp->unit, value, 1);
> - msr_val &= ~rp->mask;
> - msr_val |= value << rp->shift;
> - if (wrmsrl_safe_on_cpu(cpu, msr, msr_val)) {
> - dev_dbg(&rd->power_zone.dev,
> - "failed to write msr 0x%x on cpu %d\n", msr, cpu);
> - return -EIO;
> - }
>
> - return 0;
> + bits = rapl_unit_xlate(rd, rd->package_id, rp->unit, value, 1);
> + bits |= bits << rp->shift;
> +
> + return rmwmsrl_safe_on_cpu(cpu, rd->msrs[rp->id], rp->mask, bits);
So here you actually use that new (misnomed) function, but for
> +static void power_limit_irq_save_cpu(void *info)
and
> +static void power_limit_irq_restore_cpu(void *info)
you use a bog standard smp function call. What's the benefit of adding that
rmw function over a bog standard smp function call if you can only use it for
one instance of the same pattern?
Boris asked you the same question here
https://lkml.kernel.org/r/20151220152749.GA29805@pd.tnic
but you decided to ignore it.
Thanks,
tglx
Powered by blists - more mailing lists