linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Yu, Fenghua" <fenghua.yu@intel.com>
Cc: Joseph Salisbury <joseph.salisbury@canonical.com>,
	"Shankar, Ravi V" <ravi.v.shankar@intel.com>,
	"vikas.shivappa@linux.intel.com" <vikas.shivappa@linux.intel.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Luck, Tony" <tony.luck@intel.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"eranian@google.com" <eranian@google.com>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	"davidcc@google.com" <davidcc@google.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"1733662@bugs.launchpad.net" <1733662@bugs.launchpad.net>,
	"Roderick W. Smith" <rod.smith@canonical.com>
Subject: RE: [REGRESSION][v4.14.y][v4.15] x86/intel_rdt/cqm: Improve limbo list processing
Date: Tue, 16 Jan 2018 19:59:59 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1801161957510.2366@nanos> (raw)
In-Reply-To: <3E5A0FA7E9CA944F9D5414FEC6C7122075908855@FMSMSX153.amr.corp.intel.com>

On Tue, 16 Jan 2018, Yu, Fenghua wrote:
> > From: Thomas Gleixner [mailto:tglx@linutronix.de]
> Is this a Haswell specific issue?
> 
> I run the following test forever without issue on Broadwell and 4.15.0-rc6 with rdt mounted:
> for ((;;)) do
>         for ((i=1;i<88;i++)) do
>                 echo 0 >/sys/devices/system/cpu/cpu$i/online
>         done
>         echo "online cpus:"
>         grep processor /proc/cpuinfo |wc
>         for ((i=1;i<88;i++)) do
>                 echo 1 >/sys/devices/system/cpu/cpu$i/online
>         done
>         echo "online cpus:"
>         grep processor /proc/cpuinfo|wc
> done
> 
> I'm finding a Haswell to reproduce the issue.

Come on. This is crystal clear from the KASAN trace. And the fix is simple enough.

You simply do not run into it because on your machine

    is_llc_occupancy_enabled() is false...

Thanks,

	tglx
	
8<--------------------	

diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c
index 88dcf8479013..99442370de40 100644
--- a/arch/x86/kernel/cpu/intel_rdt.c
+++ b/arch/x86/kernel/cpu/intel_rdt.c
@@ -525,10 +525,6 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)
 		 */
 		if (static_branch_unlikely(&rdt_mon_enable_key))
 			rmdir_mondata_subdir_allrdtgrp(r, d->id);
-		kfree(d->ctrl_val);
-		kfree(d->rmid_busy_llc);
-		kfree(d->mbm_total);
-		kfree(d->mbm_local);
 		list_del(&d->list);
 		if (is_mbm_enabled())
 			cancel_delayed_work(&d->mbm_over);
@@ -545,6 +541,10 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)
 			cancel_delayed_work(&d->cqm_limbo);
 		}
 
+		kfree(d->ctrl_val);
+		kfree(d->rmid_busy_llc);
+		kfree(d->mbm_total);
+		kfree(d->mbm_local);
 		kfree(d);
 		return;
 	}

  reply	other threads:[~2018-01-16 19:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 16:22 [REGRESSION][v4.14.y][v4.15] x86/intel_rdt/cqm: Improve limbo list processing Joseph Salisbury
2018-01-14 11:35 ` Thomas Gleixner
2018-01-16 13:09   ` Thomas Gleixner
     [not found]     ` <159B72D0-06FE-4925-A11A-1F8A7741BF70@intel.com>
2018-01-16 16:40       ` Joseph Salisbury
2018-01-16 18:09         ` Thomas Gleixner
2018-01-16 18:34           ` Yu, Fenghua
2018-01-16 18:59             ` Thomas Gleixner [this message]
2018-01-17 11:00               ` [tip:x86/urgent] x86/intel_rdt/cqm: Prevent use after free tip-bot for Thomas Gleixner
2018-01-17 20:35               ` [REGRESSION][v4.14.y][v4.15] x86/intel_rdt/cqm: Improve limbo list processing Joseph Salisbury
2018-01-17 22:16               ` Joseph Salisbury
2018-01-17 22:55                 ` Thomas Gleixner
2018-01-17 22:59                   ` Joseph Salisbury

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=alpine.DEB.2.20.1801161957510.2366@nanos \
    --to=tglx@linutronix.de \
    --cc=1733662@bugs.launchpad.net \
    --cc=ak@linux.intel.com \
    --cc=davidcc@google.com \
    --cc=eranian@google.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=joseph.salisbury@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ravi.v.shankar@intel.com \
    --cc=rod.smith@canonical.com \
    --cc=stable@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=vikas.shivappa@linux.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;
as well as URLs for NNTP newsgroup(s).