Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752246AbdGGGup (ORCPT ); Fri, 7 Jul 2017 02:50:45 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:58931 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbdGGGuo (ORCPT ); Fri, 7 Jul 2017 02:50:44 -0400 Date: Fri, 7 Jul 2017 08:50:40 +0200 (CEST) From: Thomas Gleixner To: Shivappa Vikas cc: Vikas Shivappa , x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, ravi.v.shankar@intel.com, tony.luck@intel.com, fenghua.yu@intel.com, andi.kleen@intel.com Subject: Re: [PATCH 21/21] x86/intel_rdt/mbm: Handle counter overflow In-Reply-To: Message-ID: References: <1498503368-20173-1-git-send-email-vikas.shivappa@linux.intel.com> <1498503368-20173-22-git-send-email-vikas.shivappa@linux.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 798 Lines: 27 On Thu, 6 Jul 2017, Shivappa Vikas wrote: > On Sun, 2 Jul 2017, Thomas Gleixner wrote: > > On Mon, 26 Jun 2017, Vikas Shivappa wrote: > > > +static void mbm_update(struct rdt_domain *d, int rmid) > > > +{ > > > + struct rmid_read rr; > > > + > > > + rr.first = false; > > > + rr.d = d; > > > + > > > + if (is_mbm_total_enabled()) { > > > + rr.evtid = QOS_L3_MBM_TOTAL_EVENT_ID; > > > + __mon_event_count(rmid, &rr); > > > > This is broken as it is not protected against a concurrent read from user > > space which comes in via a smp function call. > > The read from user also has the rdtgroup_mutex. Which is again, completely non obvious and undocumented in the code. Aside of that, are you really serious about serializing the world and everything on a single global mutex? Thanks, tglx