Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp711842ybz; Wed, 15 Apr 2020 17:16:31 -0700 (PDT) X-Google-Smtp-Source: APiQypL7xnzdOtmoz7Vu9cG87sa07DxeTc3zdbNiI0J86Wu7Rpy57v+K91WxqJQdpx8pTjhRIyCN X-Received: by 2002:aa7:cb0f:: with SMTP id s15mr971789edt.164.1586996191143; Wed, 15 Apr 2020 17:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586996191; cv=none; d=google.com; s=arc-20160816; b=gfUMgJ7BWp0DcAsEJNSDCmRbSiOdd+3sNEDODPx/wewPXlNekhMVEKKoX+6ykKJjBJ F0HyV9aytGHBXDYASC0LW0k3R0XI4bZo0ciWL92ocsy/UidiD+QvuonhTO4kUiYglnbn Jfll3/176lIwUBnlMWQ1HTKEAYw/02Pwp0/vcWEBerMszvu6Vg+Atpjru61dNRUKpcrW 5cb7Snl9aNc4RZQ8I+HAtx7vZDnfsC/2ec364xLoZ5Iqjb+/rDcxiNgbML+8WhefGmDI cEbwwczZaqQVaxzw5L23dy1k91ooUxW2y9ch2Xtd2WXUhFoQW/LY3IXZsgol2rxHhc6u bZUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:ironport-sdr:ironport-sdr; bh=Gkk+HmiFft4ZZGDSLq6TMecVrYPbqgRfBXaELSQvnJQ=; b=GOg6gZX84VrTzlgm4CkxhWNZXJJkSPPwdlL0JV7FCGzOK+I7P91+m8I9aVCv2gwQTC ia0yNNHM5KbJk5occVlryTmVckQ9gOULLelLYirI/4ZhspBAqHRl/gCpLtV9Nzw5mHU4 7aQzeu1qRbcKemDvQfYPXGTJukeg0PtYKlm9UkVdSPQ30mHBVOtidyr/oKK4DR9bdAMM FhGFHSYRiH4skQCSHsBCyfQfa8jaUCY3F+MmHZYvekMOHhBmpivywfapc8t7URyxiWWz wRKlTADy/cC38mPE7PRi7h0HVx7MeoXfw1ur62cTFxgZMXSFWXK+I6IO4H7+IdhQuiOg 3+fQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a31si4361981ede.290.2020.04.15.17.16.08; Wed, 15 Apr 2020 17:16:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2410012AbgDOP5l (ORCPT + 99 others); Wed, 15 Apr 2020 11:57:41 -0400 Received: from mga05.intel.com ([192.55.52.43]:22485 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404323AbgDOP5i (ORCPT ); Wed, 15 Apr 2020 11:57:38 -0400 IronPort-SDR: /qELbgPeI2AE9dUjSrF5y5my/y2nsvgsE/p+5DZpzAAwMrV4fd/qsusgIaHF4ZH2gNADvtS5zK F6jJIKJkGIcQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 08:57:38 -0700 IronPort-SDR: X+0pqlEsf3wsI0YpgYG7z3YLyeqeQTQhTSRP4FGaonyXx1xfhmzCfgip622seAmL9B2awbg2ek Hzv+nYZ09kfg== X-IronPort-AV: E=Sophos;i="5.72,387,1580803200"; d="scan'208";a="245723605" Received: from smitavil-mobl.amr.corp.intel.com (HELO [10.254.108.43]) ([10.254.108.43]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 08:57:37 -0700 Subject: Re: [PATCH v3] x86/resctrl: Preserve CDP enable over cpuhp From: Reinette Chatre To: James Morse , x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Borislav Petkov Cc: Fenghua Yu , Ingo Molnar , "H . Peter Anvin" , Babu Moger References: <20200221162105.154163-1-james.morse@arm.com> <8d84868f-4045-8d69-ed45-d0f0629ba25c@intel.com> Message-ID: Date: Wed, 15 Apr 2020 08:57:34 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <8d84868f-4045-8d69-ed45-d0f0629ba25c@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas and Borislav, Could you please consider this patch for inclusion as a fix for v5.7? Thank you Reinette On 2/24/2020 10:23 AM, Reinette Chatre wrote: > Hi James, > > On 2/21/2020 8:21 AM, James Morse wrote: >> Resctrl assumes that all CPUs are online when the filesystem is >> mounted, and that CPUs remember their CDP-enabled state over CPU >> hotplug. >> >> This goes wrong when resctrl's CDP-enabled state changes while all >> the CPUs in a domain are offline. >> >> When a domain comes online, enable (or disable!) CDP to match resctrl's >> current setting. >> >> Fixes: 5ff193fbde20 ("x86/intel_rdt: Add basic resctrl filesystem support") >> Suggested-by: Reinette Chatre >> Signed-off-by: James Morse >> --- >> arch/x86/kernel/cpu/resctrl/core.c | 2 ++ >> arch/x86/kernel/cpu/resctrl/internal.h | 1 + >> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 13 +++++++++++++ >> 3 files changed, 16 insertions(+) >> >> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c >> index 89049b343c7a..d8cc5223b7ce 100644 >> --- a/arch/x86/kernel/cpu/resctrl/core.c >> +++ b/arch/x86/kernel/cpu/resctrl/core.c >> @@ -578,6 +578,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r) >> d->id = id; >> cpumask_set_cpu(cpu, &d->cpu_mask); >> >> + rdt_domain_reconfigure_cdp(r); >> + >> if (r->alloc_capable && domain_setup_ctrlval(r, d)) { >> kfree(d); >> return; >> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h >> index 181c992f448c..3dd13f3a8b23 100644 >> --- a/arch/x86/kernel/cpu/resctrl/internal.h >> +++ b/arch/x86/kernel/cpu/resctrl/internal.h >> @@ -601,5 +601,6 @@ bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d); >> void __check_limbo(struct rdt_domain *d, bool force_free); >> bool cbm_validate_intel(char *buf, u32 *data, struct rdt_resource *r); >> bool cbm_validate_amd(char *buf, u32 *data, struct rdt_resource *r); >> +void rdt_domain_reconfigure_cdp(struct rdt_resource *r); >> >> #endif /* _ASM_X86_RESCTRL_INTERNAL_H */ >> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> index 064e9ef44cd6..1c78908ef395 100644 >> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> @@ -1859,6 +1859,19 @@ static int set_cache_qos_cfg(int level, bool enable) >> return 0; >> } >> >> +/* Restore the qos cfg state when a domain comes online */ >> +void rdt_domain_reconfigure_cdp(struct rdt_resource *r) >> +{ >> + if (!r->alloc_capable) >> + return; >> + >> + if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA]) >> + l2_qos_cfg_update(&r->alloc_enabled); >> + >> + if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA]) >> + l3_qos_cfg_update(&r->alloc_enabled); >> +} >> + >> /* >> * Enable or disable the MBA software controller >> * which helps user specify bandwidth in MBps. >> > > As mentioned in my response to v2 the lockdep annotation that formed > part of this fix is welcome. It is not clear to me if you will be > submitting again with the annotation added back. Since it is not > required for this fix I will add my tag here and you could include it if > you do decide to resubmit. > > Thank you > > Reviewed-by: Reinette Chatre > > Reinette >