Thread (91 messages) 91 messages, 11 authors, 2018-12-13

Re: [RFC v2 13/13] keys/mktme: Support CPU Hotplug for MKTME keys

From: Peter Zijlstra <peterz@infradead.org>
Date: 2018-12-04 09:31:24
Also in: keyrings, linux-mm

On Mon, Dec 03, 2018 at 11:40:00PM -0800, Alison Schofield wrote:
 static int mktme_program_system(struct mktme_key_program *key_program,
-				cpumask_var_t mktme_cpumask)
+				cpumask_var_t mktme_cpumask, int hotplug)
 {
 	struct mktme_hw_program_info info = {
 		.key_program = key_program,
 		.status = MKTME_PROG_SUCCESS,
 	};
-	get_online_cpus();
-	on_each_cpu_mask(mktme_cpumask, mktme_program_package, &info, 1);
-	put_online_cpus();
+
+	if (!hotplug) {
+		get_online_cpus();
+		on_each_cpu_mask(mktme_cpumask, mktme_program_package,
+				 &info, 1);
+		put_online_cpus();
+	} else {
+		on_each_cpu_mask(mktme_cpumask, mktme_program_package,
+				 &info, 1);
+	}
 
 	return info.status;
 }
That is pretty horrible; and I think easily avoided.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help