Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754856AbdGJRyU (ORCPT ); Mon, 10 Jul 2017 13:54:20 -0400 Received: from mga05.intel.com ([192.55.52.43]:7938 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754658AbdGJRyT (ORCPT ); Mon, 10 Jul 2017 13:54:19 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,341,1496127600"; d="scan'208";a="877303454" Date: Mon, 10 Jul 2017 10:54:18 -0700 From: "Luck, Tony" To: Thomas Gleixner Cc: Shivappa Vikas , Vikas Shivappa , x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, ravi.v.shankar@intel.com, fenghua.yu@intel.com, andi.kleen@intel.com Subject: Re: [PATCH 21/21] x86/intel_rdt/mbm: Handle counter overflow Message-ID: <20170710175418.ghphbgunhswrravh@intel.com> References: <1498503368-20173-1-git-send-email-vikas.shivappa@linux.intel.com> <1498503368-20173-22-git-send-email-vikas.shivappa@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1256 Lines: 40 On Fri, Jul 07, 2017 at 08:50:40AM +0200, Thomas Gleixner wrote: > Aside of that, are you really serious about serializing the world and > everything on a single global mutex? It would be nice to not do that, but there are challenges. At any instant someone else might run: # rmdir /sys/fs/resctrl/{some_control_group} and blow away the control group and all the monitor groups under it. Someone else might do: # echo 0 > /sys/devices/system/cpu/cpu{N}/online where "N" is the last online cpu in a domain, which will blow away an rdt_domain structure and ask kernfs to remove some monitor files from every monitor directory. If we change how we handle rdt_domains to 1) Not delete them when last CPU goes away (and re-use them if they come back) 2) Have a safe way to search rdt_resource.domains for a domain that we know is there even though another may be in the middle of being added Then we could probably make: $ cat /sys/fs/restrl/ ... /llc_occupancy etc. not need to grab the mutex. We'd still need something to protect against a cross processor interrupt geting in the middle of the access to IA32_QM_EVTSEL/IA32_QM_CTR and for MBM counters to serialize access to mbm_state ... but it would be a lot finer granularity. -Tony