Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751569AbbHTKlz (ORCPT ); Thu, 20 Aug 2015 06:41:55 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:38145 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbbHTKly (ORCPT ); Thu, 20 Aug 2015 06:41:54 -0400 Date: Thu, 20 Aug 2015 11:41:51 +0100 From: Matt Fleming To: Kanaka Juvva Cc: kanaka.d.juvva@intel.com, glenn.p.williamson@intel.com, matt.fleming@intel.com, will.auld@intel.com, andi@firstfloor.org, linux-kernel@vger.kernel.org, tony.luck@intel.com, peterz@infradead.org, tglx@linutronix.de, tj@kernel.org, x86@kernel.org, mingo@redhat.com, hpa@zytor.com, vikas.shivappa@intel.com Subject: Re: [PATCH v3 2/2] perf,x86: skip intel_cqm_stable if CMT is not present in a CPU model Message-ID: <20150820104151.GA2567@codeblueprint.co.uk> References: <1439019379-10025-1-git-send-email-kanaka.d.juvva@linux.intel.com> <20150818170900.GG3233@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150818170900.GG3233@codeblueprint.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1742 Lines: 41 On Tue, 18 Aug, at 06:09:01PM, Matt Fleming wrote: > > You can only skip the stabilization if there are no CMT RMIDs on the > limbo lru at all. I need to provide a little more detail here... There are actually 3 cases you need to consider when you make the MBM changes to intel_cqm_rmid_stabilize(), 1. RMIDs on the limbo lru are *only* CMT 2. RMIDs on the limbo lru are *only* MBM 3. RMIDs on the limbo lru are a mixture of CMT *and* MBM Case 1 is exactly what is supported today and so that functionality needs to remain unchanged. For case 2 you can completely skip the SMP IPI stabilization and move all RMIDs from the limbo lru to the free lru, which is similar in spirit to your patch. Case 3 is by far the most interesting. The simplest way to handle it is to skip any MBM RMIDs on the limbo lru inside of the SMP IPI callback, intel_cqm_stable(). But that's pretty suboptimal if you have lots of MBM RMIDs and few CMT RMIDs on the limbo lru because you'd be iterating most of the entries in the callback function for no reason - you'd just skip them. Instead what I suggest you explore is removing each MBM RMID from the limbo lru and putting it on a function-local list on the stack in intel_cqm_rmid_stabilize(). Since you are guaranteed to be allowed to put the MBM RMID on the free lru (we don't need to stabilize it, so the stabilzation can't fail) there's no need to worry about error cases or anything like that. -- Matt Fleming, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/