Le 11/01/2020 à 12:07, Thomas Gleixner a écrit :
Christophe Leroy writes:
With READ_ONCE() the 64 bits are being read:
Without the READ_ONCE() only 32 bits are read. That's the most optimal.
Without READ_ONCE() but with a barrier() after the read, we should get
the same result but GCC (GC
Christophe Leroy writes:
>
> With READ_ONCE() the 64 bits are being read:
>
> Without the READ_ONCE() only 32 bits are read. That's the most optimal.
>
> Without READ_ONCE() but with a barrier() after the read, we should get
> the same result but GCC (GCC 8.1) does less good:
>
> Assuming both pa
On 01/10/2020 09:12 PM, Thomas Gleixner wrote:
Christophe Leroy writes:
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index 17b4cff6e5f0..5a17a9d2e6cd 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -144,7 +144,7 @@ __cvdso_gettimeofday(const struct vd
Christophe Leroy writes:
>
> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
> index 17b4cff6e5f0..5a17a9d2e6cd 100644
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -144,7 +144,7 @@ __cvdso_gettimeofday(const struct vdso_data *vd, struct
> __kernel_old_timeva
> On Dec 24, 2019, at 7:12 PM, christophe leroy wrote:
>
>
>
>> Le 24/12/2019 à 02:58, Andy Lutomirski a écrit :
>>> On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy
>>> wrote:
>>>
>>> READ_ONCE() forces the read of the 64 bit value of
>>> vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec al
Le 24/12/2019 à 02:58, Andy Lutomirski a écrit :
On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy
wrote:
READ_ONCE() forces the read of the 64 bit value of
vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec allthough
only the lower part is needed.
Seems reasonable and very unlikely to be har
On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy
wrote:
>
> READ_ONCE() forces the read of the 64 bit value of
> vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec allthough
> only the lower part is needed.
Seems reasonable and very unlikely to be harmful. That being said,
this function really ough
READ_ONCE() forces the read of the 64 bit value of
vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec allthough
only the lower part is needed.
This results in a suboptimal code:
0af4 <__c_kernel_time>:
af4: 2c 03 00 00 cmpwi r3,0
af8: 81 44 00 20 lwz r10,32(r4)
afc: 81 64