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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141107123836.GH10476@twins.programming.kicks-ass.net>
Date:	Fri, 7 Nov 2014 13:38:36 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Matt Fleming <matt@...sole-pimps.org>
Cc:	Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Andi Kleen <andi@...stfloor.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
	Kanaka Juvva <kanaka.d.juvva@...el.com>,
	Matt Fleming <matt.fleming@...el.com>
Subject: Re: [PATCH v3 10/11] perf/x86/intel: Perform rotation on Intel CQM
 RMIDs

On Fri, Nov 07, 2014 at 01:34:31PM +0100, Peter Zijlstra wrote:
> 
> enum rmid_cycle_state {
> 	RMID_AVAILABLE = 0,
> 	RMID_LIMBO,
> 	RMID_YOUNG,
> };
> 
> struct cqm_rmid_entry {
> 	...
> 	enum rmid_cycle_state state;
> };
> 
> static void __intel_sqm_stable(void *arg)
> {
> 	list_for_each_entry(entry, &cqm_rmid_limbo_lru, list) {
> 		if (entry->state == RMID_YOUNG)
> 			break;
> 
> 		if (__rmid_read(entry->rmid) > __threshold)
> 			entry->state = RMID_LIMBO;
> 	}
> }
> 
> static bool intel_cqm_rmid_stabilize()
> {
> 	unsigned long queue_time = jiffies + msecs_to_jiffies(__rotation_period);
> 	unsigned int nr_limbo = 0;
> 	...
> 
> 	list_for_each_entry(entry, &cqm_rmid_limbo_lru, list) {
> 		if (time_after(entry->queue_time, queue_time))
> 			break;
> 
> 		entry->state = RMID_AVAILABLE;
> 		nr_limbo++;

For optional goodness:

		if (nr_limbo > max_scan_size)
			break;

Which will limit the number of RMIDs you'll scan from the IPI, and
thereby limit the time taken there.

> 	}
> 
> 	if (!nr_limbo)
> 		return;
> 
> 	on_each_cpu_mask(&cqm_cpumask, __intel_cqm_stable, NULL, true);
> 
> 	list_for_each_entry_safe(entry, tmp, &cqm_rmid_limbo_lru, list) {
> 		if (entry->state == RMID_YOUNG)
> 			break;
> 
> 		if (entry->state == RMID_AVAILABLE)
> 			list_move(&cqm_rmid_free_list, &entry->list);
> 	}
> }
> 
> 
> Would not something like that work?
--
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