Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2036467ybv; Fri, 14 Feb 2020 10:13:36 -0800 (PST) X-Google-Smtp-Source: APXvYqz/zKl7lwNUML2kU63bUK+wl0kGVmzQVp7EUWCusDnBinIBvv5DaV7eaouieuoldD1CsRd+ X-Received: by 2002:a9d:67d7:: with SMTP id c23mr3345090otn.262.1581704016215; Fri, 14 Feb 2020 10:13:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704016; cv=none; d=google.com; s=arc-20160816; b=FVVV3hPEbRLpLokLjtpnCuda7X0x+VKaxsRXy98uKbUdImOZEH6j7vUMypn+GT1+T7 p/Pg9m7XTIvUGGwMoCQJu+cJxmzyJ4Yh3gy+c1OTN352CuLbzTmcnaaoV6vcebnUSTPP jOfkLmMc3QoqPqJlJx3uTPNy30xaksKHWI7tKoEyYIJH2JAEAy+Dl0DF9bz+Cc2thFQE s3u9/pLwIUoBNV/fmFUw6+A9Cp0nOTnxwyreOY6oEwLOsbXX3OTx8IwQ8ksfaxVwE1M8 WBnmLoRMERA1arzB8iRBkUgKVyLBQ3P/nJgX9aUABrw8437mH/3ZXs5dgTa8UEDqHH0Y FSyQ== 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:from:references:cc:to:subject; bh=XFP+HFXESqcFwbzdAze4MToC3nV+We8EWAp17o9dDyA=; b=J3JXac/ePdhOkvvK9Qox2eeoEU62x9gxnH5yv/evDbf8B5Y2vHk9TBYTeYM+KD3WBo By1/ojC0Zd8kuztS7Z+Z9iJPp2l9hVuN/4DpaHDaOymPyEPONfTDMQVb5ZKzY+XRjOsu JdOIXg+7HHVzeVvwPqLoMYGJJfvyW9Tya68HjPNWeqlLI/mixmSA0I2j/G0TLkKZyNf1 DGCNkh1SgqDTyFhLQDMPKd1o+uQBPRty5rL/dbqRMmWELIFMmwqlIxYoHMSiosBtNiDy SUtVd0OQMv3Nua/Mmt9WvqeglMbnpu5xUpG9f/Lc3cToUCK7yImdUn0VSG53ugdV9nNe 3TWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si2798490oih.70.2020.02.14.10.13.22; Fri, 14 Feb 2020 10:13:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393363AbgBNSMt (ORCPT + 99 others); Fri, 14 Feb 2020 13:12:49 -0500 Received: from foss.arm.com ([217.140.110.172]:42760 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389702AbgBNSMq (ORCPT ); Fri, 14 Feb 2020 13:12:46 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92AB4328; Fri, 14 Feb 2020 10:12:45 -0800 (PST) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 917163F68E; Fri, 14 Feb 2020 10:12:44 -0800 (PST) Subject: Re: [PATCH] x86/resctrl: Preserve CDP enable over cpuhp To: Reinette Chatre Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" References: <20200212185359.163111-1-james.morse@arm.com> <8aab67d7-c13e-19f1-9bec-85b7cca55146@intel.com> <720c9253-d590-82d5-2338-7f577a71b791@arm.com> <1e1ee570-8deb-688e-1875-94b84eef7641@intel.com> From: James Morse Message-ID: <75bcb664-d840-96ed-c49f-34eefa010143@arm.com> Date: Fri, 14 Feb 2020 18:12:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1e1ee570-8deb-688e-1875-94b84eef7641@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Reinette, On 13/02/2020 19:45, Reinette Chatre wrote: > On 2/13/2020 9:42 AM, James Morse wrote: >> On 12/02/2020 22:53, Reinette Chatre wrote: >>> On 2/12/2020 10:53 AM, James Morse wrote: >>>> 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. >> ... I think you're describing adding: [...] >> to rdtgroup.c and using that from core.c? > > If I understand this correctly the CDP configuration will be done twice > for each CDP resource, and four times for each CDP resource on a system > supporting both L2 and L3 CDP. I think it is possible to do > configuration once for each. Also take care on systems that support MBA > that would not be caught by the first if statement. A system supporting > MBA and CDP may thus attempt the configuration even more. It should be > possible to use the resource parameter for a positive test and then just > let the other resources fall through? Considering this, what do you > think of something like below? > > 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); > } Sold! (the !r->alloc_capable are already filtered out by the caller, but checking is the least-surprise option) I'll send a v2 shortly with your suggested-by. I'd like to keep the lockdep annotations as the MPAM tree tries to stop the arch code taking the rdtgroup_mutex. Those patches changing these annotations makes it nice and clear what is going on. Thanks, James