From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753289AbcGYSFs (ORCPT ); Mon, 25 Jul 2016 14:05:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:5891 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbcGYSFq (ORCPT ); Mon, 25 Jul 2016 14:05:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,420,1464678000"; d="scan'208";a="1013568651" Date: Mon, 25 Jul 2016 11:05:32 -0700 From: "Luck, Tony" To: Nilay Vaish Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Tejun Heo , Borislav Petkov , Stephane Eranian , Peter Zijlstra , Marcelo Tosatti , David Carrillo-Cisneros , Ravi V Shankar , Vikas Shivappa , Sai Prakhya , linux-kernel , x86 Subject: Re: [PATCH 05/32] x86/intel_rdt: Implement scheduling support for Intel RDT Message-ID: <20160725180531.GA4116@intel.com> References: <1468371785-53231-1-git-send-email-fenghua.yu@intel.com> <1468371785-53231-6-git-send-email-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 25, 2016 at 11:31:24AM -0500, Nilay Vaish wrote: > I was thinking more about this software caching of CLOSids. How > likely do you think these CLOSids would be found cached? I think the > software cache would be very infrequently accessed, so it seems you > are likely to miss these in all levels of cache hierarchy and more > likely to have to fetch these from the main memory, which itself might > cost ~250 cycles. We need to avoid reading the PQR_ASSOC MSR (which would cost far more than 250 cycles). Life is complicated here because this MSR contains the CLOSID in the upper half, and the RMID (owned by the perf code to measure cache occupancy and memory bandwidth) in the lower half. I've wondered whether it would be possible to include both the CLOSID and the RMID in either the task or thread struct (in some spot that was likely to be pulled into cache by access to adjacent members during context switch). This would smooth the path in context switch (since we can look at the values from the previous process and compare them to the ones for the new process to see whether we need to do the wrmsr()). But it likely needs a bunch of other changes to update the values when a process migrates between cpus to get the closid precedence that tglx requires. -Tony