From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754887AbcAMWDj (ORCPT ); Wed, 13 Jan 2016 17:03:39 -0500 Received: from www.linutronix.de ([62.245.132.108]:52350 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752973AbcAMWDh (ORCPT ); Wed, 13 Jan 2016 17:03:37 -0500 Date: Wed, 13 Jan 2016 23:02:33 +0100 (CET) From: Thomas Gleixner To: Srinivas Pandruvada cc: Borislav Petkov , Jacob Pan , LKML , Linux PM , Rafael Wysocki , "H. Peter Anvin" , Ingo Molnar , X86 Kernel , Peter Zijlstra Subject: Re: [PATCH v2 2/2] powercap/rapl: reduce ipi calls In-Reply-To: <1452722083.3092.92.camel@linux.intel.com> Message-ID: References: <1452647483-14244-1-git-send-email-jacob.jun.pan@linux.intel.com> <1452647483-14244-3-git-send-email-jacob.jun.pan@linux.intel.com> <20160113082113.3314fa92@icelake> <20160113163610.GH12897@pd.tnic> <20160113095124.186ff487@yairi> <20160113180412.GN12897@pd.tnic> <20160113102138.4e34e890@yairi> <20160113191622.GP12897@pd.tnic> <20160113121003.3e9c2108@yairi> <20160113212602.GT12897@pd.tnic> <1452722083.3092.92.camel@linux.intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1863996531-1452722557=:3575" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1863996531-1452722557=:3575 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Wed, 13 Jan 2016, Srinivas Pandruvada wrote: > On Wed, 2016-01-13 at 22:26 +0100, Borislav Petkov wrote: > > rmwmsrl_safe_on_cpu(policy->cpu, MSR_IA32_PERF_CTL, > >     INTEL_PERF_CTL_MASK, > >     (u32)sfi_cpufreq_array[next_perf_state].ctr > > l_val & INTEL_PERF_CTL_MASK); > > > > Yikes! > > > > So yes, it can work but it is ugly, hard to parse and use, not > > generic > > enough, etc, etc. > > > > So thanks, but no thanks. > > > I agree, in some cases it will not make much sense to use read- > modify_write calls, the user may decide whether it makes sense or not. > But such interface is not new to Linux kernel: > > regmap_update_bits(), which is referenced for 346 times. > > Are you saying that any such calls are not useful? There are certainly cases when such calls are useful. And those cases are when we have a sufficiently big occurence of similar code which is sufficiently complex to justify the library code and the export. Thanks, tglx --8323329-1863996531-1452722557=:3575--