public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiaochen Shen <xiaochen.shen@intel.com>
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	[thread overview]
Message-ID: <1554839629-5448-1-git-send-email-xiaochen.shen@intel.com> (raw)

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 <xiaochen.shen@intel.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
---
 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


             reply	other threads:[~2019-04-09 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 19:53 Xiaochen Shen [this message]
2019-04-14 16:41 ` [tip:x86/urgent] x86/resctrl: Do not repeat rdtgroup mode initialization tip-bot for Xiaochen Shen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1554839629-5448-1-git-send-email-xiaochen.shen@intel.com \
    --to=xiaochen.shen@intel.com \
    --cc=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pei.p.jia@intel.com \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox