lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3E5A0FA7E9CA944F9D5414FEC6C712205DF4CDC1@ORSMSX106.amr.corp.intel.com>
Date:	Wed, 16 Dec 2015 22:00:30 +0000
From:	"Yu, Fenghua" <fenghua.yu@...el.com>
To:	Marcelo Tosatti <mtosatti@...hat.com>
CC:	H Peter Anvin <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	x86 <x86@...nel.org>,
	"Vikas Shivappa" <vikas.shivappa@...ux.intel.com>,
	"Luck, Tony" <tony.luck@...el.com>,
	"Shankar, Ravi V" <ravi.v.shankar@...el.com>
Subject: RE: [PATCH V15 11/11] x86,cgroup/intel_rdt : Add a cgroup interface
 to manage Intel cache allocation

> From: Marcelo Tosatti [mailto:mtosatti@...hat.com]
> Sent: Wednesday, November 18, 2015 1:27 PM
> To: Yu, Fenghua <fenghua.yu@...el.com>
> Cc: H Peter Anvin <hpa@...or.com>; Ingo Molnar <mingo@...hat.com>;
> Thomas Gleixner <tglx@...utronix.de>; Peter Zijlstra
> <peterz@...radead.org>; linux-kernel <linux-kernel@...r.kernel.org>; x86
> <x86@...nel.org>; Vikas Shivappa <vikas.shivappa@...ux.intel.com>
> Subject: Re: [PATCH V15 11/11] x86,cgroup/intel_rdt : Add a cgroup interface
> to manage Intel cache allocation
> 
> On Thu, Oct 01, 2015 at 11:09:45PM -0700, Fenghua Yu wrote:
> > Add a new cgroup 'intel_rdt' to manage cache allocation. Each cgroup
> +	/*
> +	 * Try to get a reference for a different CLOSid and release the
> +	 * reference to the current CLOSid.
> +	 * Need to put down the reference here and get it back in case we
> +	 * run out of closids. Otherwise we run into a problem when
> +	 * we could be using the last closid that could have been available.
> +	 */
> +	closid_put(ir->closid);
> +	if (cbm_search(cbmvalue, &closid)) {
> 
> Can't you move closid_put here?

No. This cannot be moved here.

If it's moved here, it won't work in the case of the current rdt is the only usage of the closid.
In this case, the closid will released from the cbm table and a new cbm will be allocated.
So the closid_put() is in the right place and can handle both the only usage of closid or recycling
case, I think.

> 
> +		ir->closid = closid;
> +		closid_get(closid);
> +	} else {
> +		closid = ir->closid;
> 
> Variable unused.

You are right. I'll remove this statement.

> 
> +		err = closid_alloc(&ir->closid);
> +		if (err) {
> +			closid_get(ir->closid);
> +			goto out;
> +		}
> 
> This makes you cycle closid when changing the cbm, not necessary.
> (not very important, but closid_put is nerving because it can possibly set
> l3_cbm to zero).

I think the current code is ok. If closid_put sets l3_cbm to zero (i.e. the closid only has this usage),
a new closid allocaation will be started to get a new closid.

Thanks.

-Fenghua
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ