Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1426387yba; Sun, 14 Apr 2019 09:43:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1k6Cy8FZrpoyAEdZbYgqvqWsC4jppqCf8ZhlL494QFkY8M3A7rkv4zOFsnNzD2o2PnRKb X-Received: by 2002:a65:6489:: with SMTP id e9mr64843722pgv.364.1555260237921; Sun, 14 Apr 2019 09:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555260237; cv=none; d=google.com; s=arc-20160816; b=ZfDnPKybWBad4f9GA9bdX5pcvCQiRYxxXZj5gORPi6PL78fvhgxqzDWuiARnpSpy0I CR0TC/C+5vtDm2NxGBpMlsDs4wF+8BdcgOQ7wI6YIyaIQ+BUUaC+wXs0Lwz4VpqVw0l9 cYJVBE52gOo/noQbZO5WImrhG7Mz9UYIC8lr2+a3B8gFOVv9JtT/to4wEMfkgwpyIcDI eIS2Eetrjc68aUL5VpqFnJAzWE5T/uTUOgR+YtNzQIXBWGqx52he2IEpENHQZrc+GthN wzsNRLS+vwe1cC8N62a17oSue9eC2Qn9wQbxKVkYgAH39SA8LWAytd9ZYwpUtebDDFLX h7Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=/tulKIrU7Li/am7VJXf4lS3Q/Hy+/A2fAGPm5I+6aYI=; b=rm2P3tIkYhXFMzRTQreCP0wqKT4yXo0ji7i9EtEvgc1mYZEm9WWGcDSM48S5uA+qpS a2ZWsTH/VGPZ1MUdPeCIx0qUVtFcc675z7Mcgai5C5I9JwWI1n6KiRNP9o1eEH8r0BnJ +XZApf5vPgCduhdbnH6iJyHuEnOOMzsZ4CqEUgEUhsgEposTSaEn30A6lDC33F0xy522 ilfj2ztYplwYColYm99J8mXc+FCsgL1ItsOqT8TzKCvknmj5/leX/kbHIRUKDmaVpg5e 0leePn7zv5DCQ93BO4tWoXbbKDFwlrmfWSz+JA37xEKof+unkD+qUFUcv6hZ+mlTYMa4 gMxA== 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 i40si24004775plb.177.2019.04.14.09.43.41; Sun, 14 Apr 2019 09:43:57 -0700 (PDT) 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 S1727032AbfDNQlo (ORCPT + 99 others); Sun, 14 Apr 2019 12:41:44 -0400 Received: from terminus.zytor.com ([198.137.202.136]:33671 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbfDNQlo (ORCPT ); Sun, 14 Apr 2019 12:41:44 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3EGfNnN2618879 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 14 Apr 2019 09:41:24 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3EGfLA52618870; Sun, 14 Apr 2019 09:41:21 -0700 Date: Sun, 14 Apr 2019 09:41:21 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Xiaochen Shen Message-ID: Cc: xiaochen.shen@intel.com, fenghua.yu@intel.com, tglx@linutronix.de, reinette.chatre@intel.com, mingo@redhat.com, tony.luck@intel.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, bp@suse.de, x86@kernel.org Reply-To: fenghua.yu@intel.com, xiaochen.shen@intel.com, tglx@linutronix.de, mingo@redhat.com, reinette.chatre@intel.com, tony.luck@intel.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, bp@suse.de, x86@kernel.org In-Reply-To: <1554839629-5448-1-git-send-email-xiaochen.shen@intel.com> References: <1554839629-5448-1-git-send-email-xiaochen.shen@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/resctrl: Do not repeat rdtgroup mode initialization Git-Commit-ID: 40fba00ffa431c8597ca785ea1cfa4d9f6503390 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=0.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_03_06 autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 40fba00ffa431c8597ca785ea1cfa4d9f6503390 Gitweb: https://git.kernel.org/tip/40fba00ffa431c8597ca785ea1cfa4d9f6503390 Author: Xiaochen Shen AuthorDate: Wed, 10 Apr 2019 03:53:49 +0800 Committer: Borislav Petkov CommitDate: Sun, 14 Apr 2019 18:23:13 +0200 x86/resctrl: Do not repeat rdtgroup mode initialization When cache allocation is supported and the user creates a new resctrl resource group, the allocations of the new resource group are initialized to all regions that it can possibly use. At this time these regions are all that are shareable by other resource groups as well as regions that are not currently used. The new resource group's mode is also initialized to reflect this initialization and set to "shareable". The new resource group's mode is currently repeatedly initialized within the loop that configures the hardware with the resource group's default allocations. Move the initialization of the resource group's mode outside the hardware configuration loop. The resource group's mode is now initialized only once as the final step to reflect that its configured allocations are "shareable". Fixes: 95f0b77efa57 ("x86/intel_rdt: Initialize new resource group with sane defaults") Signed-off-by: Xiaochen Shen Signed-off-by: Borislav Petkov Reviewed-by: Fenghua Yu Acked-by: Reinette Chatre Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: pei.p.jia@intel.com Cc: Thomas Gleixner Cc: Tony Luck Cc: x86-ml Link: https://lkml.kernel.org/r/1554839629-5448-1-git-send-email-xiaochen.shen@intel.com --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 54b9eef3eea9..85212a32b54d 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2610,9 +2610,10 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp) rdt_last_cmd_puts("Failed to initialize allocations\n"); return ret; } - rdtgrp->mode = RDT_MODE_SHAREABLE; } + rdtgrp->mode = RDT_MODE_SHAREABLE; + return 0; }