Thread (19 messages) 19 messages, 5 authors, 2020-01-22

Re: [PATCH v8 5/5] locking/qspinlock: Introduce the shuffle reduction optimization into CNA

From: Peter Zijlstra <peterz@infradead.org>
Date: 2020-01-22 09:56:47
Also in: linux-arch, lkml

On Mon, Dec 30, 2019 at 02:40:42PM -0500, Alex Kogan wrote:
quoted hunk ↗ jump to hunk
@@ -251,8 +281,11 @@ __always_inline u32 cna_pre_scan(struct qspinlock *lock,
 	struct cna_node *cn = (struct cna_node *)node;
 
 	cn->pre_scan_result =
-		cn->intra_count == intra_node_handoff_threshold ?
-			FLUSH_SECONDARY_QUEUE : cna_scan_main_queue(node, node);
+		(node->locked <= 1 && probably(SHUFFLE_REDUCTION_PROB_ARG)) ?
+			PASS_LOCK_IMMEDIATELY :
+			cn->intra_count == intra_node_handoff_threshold ?
+				FLUSH_SECONDARY_QUEUE :
+				cna_scan_main_queue(node, node);
 
 	return 0;
 }
Let me just, once again, remind people that the Linux Kernel is not part
of the Obfuscated C code contest.
Reviewed-by: Steve Sistare <redacted>
Seriously, in what universe is that actually readable code? Steve quick,
say what it does.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help