Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751685AbdHBHkH (ORCPT ); Wed, 2 Aug 2017 03:40:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:55777 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750725AbdHBHkG (ORCPT ); Wed, 2 Aug 2017 03:40:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,310,1498546800"; d="scan'208";a="114624144" Date: Wed, 2 Aug 2017 00:41:57 -0700 (PDT) From: Shivappa Vikas X-X-Sender: vikas@vshiva-Udesk To: Thomas Gleixner cc: Vikas Shivappa , vikas.shivappa@intel.com, 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, eranian@google.com, davidcc@google.com, ak@linux.intel.com, reinette.chatre@intel.com Subject: Re: [PATCH 09/28] x86/intel_rdt/cqm: Add RMID(Resource monitoring ID) management In-Reply-To: Message-ID: References: <1501017287-28083-1-git-send-email-vikas.shivappa@linux.intel.com> <1501017287-28083-10-git-send-email-vikas.shivappa@linux.intel.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1679 Lines: 45 On Tue, 1 Aug 2017, Thomas Gleixner wrote: > On Tue, 25 Jul 2017, Vikas Shivappa wrote: >> Hardware uses RMID(Resource monitoring ID) to keep track of each of the >> RDT events associated with tasks. The number of RMIDs is dependent on >> the SKU and is enumerated via CPUID. We add support to manage the RMIDs >> which include managing the RMID allocation and reading LLC occupancy >> for an RMID. >> >> RMID allocation is managed by keeping a free list which is initialized >> to all available RMIDs except for RMID 0 which is always reserved for >> root group. RMIDs goto a limbo list once they are >> freed since the RMIDs are still tagged to cache lines of the tasks which >> were using them - thereby still having some occupancy. They continue to >> be in limbo list until the occupancy < threshold_occupancy. The >> threshold_occupancy is a user configurable value. >> OS uses IA32_QM_CTR MSR to read the occupancy associated with an RMID >> after programming the IA32_EVENTSEL MSR with the RMID. >> >> [Tony: Improved limbo search] > > The search is smarter, but the smp function call problem per se > persists. It's still more than 100us worstcase on a BDW box and it's going > to be worse with the next generation As an alternative we could have delayed worker threads(hence not in interrupt context) every 1s to check the limbo lists using the same optimized search with 1 bit per RMID. When a mkdir tries to get RMID if no RMID is in free list and some are present in limbo we return -EBUSY and if both free and limbo lists are empty we return -ENOSPC. If that is reasonable I can send an updated patch for the same. Thanks, Vikas > > Thanks, > > tglx >