Thread (3 messages) flat view 3 messages, 2 authors, 2020-05-25

Re: [PATCH v2 5/7] connector/cn_proc: Protect send_msg() with a local lock

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2020-05-25 14:51:44
Also in: lkml

On 2020-05-25 09:18:19 [+0200], Ingo Molnar wrote:
quoted
+static DEFINE_PER_CPU(struct local_evt, local_evt) = {
+	.counts = 0,
I don't think zero initializations need to be written out explicitly.
yes.
quoted
+	.lock = INIT_LOCAL_LOCK(lock),
+};
 
 static inline void send_msg(struct cn_msg *msg)
 {
-	preempt_disable();
+	local_lock(&local_evt.lock);
 
-	msg->seq = __this_cpu_inc_return(proc_event_counts) - 1;
+	msg->seq = __this_cpu_inc_return(local_evt.counts) - 1;
Naming nit: renaming this from 'proc_event_counts' to 
'local_evt.counts' is a step back IMO - what's an 'evt',
did we run out of e's? ;-)

Should be something like local_event.count? (Singular.)
okay.
Thanks,

	Ingo
Sebastian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help