Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4174394yba; Tue, 9 Apr 2019 12:48:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2uj/c7UBcHgYlXzgXhi9k7WQhN4T+MNAWladUuUupDVmnbj9d0ly9WSn+0lVyGPd094Ei X-Received: by 2002:a17:902:4681:: with SMTP id p1mr38892848pld.42.1554839283206; Tue, 09 Apr 2019 12:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554839283; cv=none; d=google.com; s=arc-20160816; b=ffVwVKUcyIIoAZldJCG/Nlbybtd1EZq8TUm8nl+YTJhHxhA1Zp8XY/eWDE7WfJfYDN QWg2Xey8K+JoJvI5keKYp1K95xOWSxaj8tGbcUqWItaab8/9Q0tooUMpK10FJEMf5mbY F9SfsRWP2KAcNqGDBnDEwn8qeD0iHbtatm7KtXh0ypWUGMMJG9tQPIYSCA4mcf8LTAvf Ap9po0iN+Hd/yCz73J96/Op7DENcFMT9P8S/RlGMkNBqpQJIz2ZBeHp5sqgt9f4bh7i4 jddQsISYLm8x37fvFb3Igl1GIP7e7eW+UfkDQS1wXCzEcE/P/yR6+RwUHoHUMT7ZaHDD qjig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=bvmKgX9dkyzJJDEFZK26RA3urq71vak9KoqfBeDyAZI=; b=e/7JmD+DK47L6208MkqBOpzNbGjyk9Q+I3/C1UAxU1CNQphaCl0+YQnrgc66y5GyRh VGbxRFhns6IZYkrGI65qc0mgBWldMdAwR/V484ku0MftONrsOTozQ62gpBbNz2/q7vwx hORSPlKZjoyuKqT2mzUpP/2xUGlOi4M5BU5mBKtPOhAUkgCTQdI+Gcgov2XOm95cwSK8 aoEirmAJEAAtl235Iq5XLbWykTaF1VgUDOTQp10KgndvPnEG2yOowNmea0Xs4lt4twYo S5QafCsVzf0gYk0lOsBBERt7c/suMYE8tJXip+NosIX8TapJg5Iic2ikSQVr6iwCjuci UpNA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si29758522pfm.179.2019.04.09.12.47.45; Tue, 09 Apr 2019 12:48:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726536AbfDITq6 (ORCPT + 99 others); Tue, 9 Apr 2019 15:46:58 -0400 Received: from mga12.intel.com ([192.55.52.136]:44232 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbfDITq6 (ORCPT ); Tue, 9 Apr 2019 15:46:58 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2019 12:46:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,330,1549958400"; d="scan'208";a="162822602" Received: from unknown (HELO xshen14-linux.bj.intel.com) ([10.238.155.105]) by fmsmga001.fm.intel.com with ESMTP; 09 Apr 2019 12:46:55 -0700 From: Xiaochen Shen To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, tony.luck@intel.com, fenghua.yu@intel.com, reinette.chatre@intel.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, pei.p.jia@intel.com, xiaochen.shen@intel.com Subject: [PATCH 1/2] x86/resctrl: Fix repeating rdtgroup mode initialization Date: Wed, 10 Apr 2019 03:53:49 +0800 Message-Id: <1554839629-5448-1-git-send-email-xiaochen.shen@intel.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Reinette Chatre Reviewed-by: Fenghua Yu --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 54b9eef..08e0333 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2610,8 +2610,8 @@ 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; } -- 1.8.3.1