Thread (74 messages) 74 messages, 18 authors, 2021-01-11

RE: [patch 14/30] drm/i915/pmu: Replace open coded kstat_irqs() copy

From: David Laight <hidden>
Date: 2020-12-11 23:00:39
Also in: dri-devel, intel-gfx, linux-gpio, linux-pci, linux-rdma, linux-s390, lkml, xen-devel

From: Thomas Gleixner
Sent: 11 December 2020 21:11

On Fri, Dec 11 2020 at 14:19, David Laight wrote:
quoted
From: Thomas Gleixner
quoted
You can't catch that. If this really becomes an issue you need a
sequence counter around it.
Or just two copies of the high word.
Provided the accesses are sequenced:
writer:
	load high:low
	add small_value,high:low
	store high
	store low
	store high_copy
reader:
	load high_copy
	load low
	load high
	if (high != high_copy)
		low = 0;
And low = 0 is solving what? You need to loop back and retry until it's
consistent and then it's nothing else than an open coded sequence count.
If it is a counter or timestamp then the high:0 value happened
some time between when you started trying to read the value and
when you finished trying to read it.

As such it is a perfectly reasonable return value.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help