* [PATCH] MIPS: vdso: flush the vdso data page to update it on all processes
@ 2016-02-21 12:57 Hauke Mehrtens
2016-02-21 13:18 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Hauke Mehrtens @ 2016-02-21 12:57 UTC (permalink / raw)
To: linux-mips, ralf; +Cc: alex.smith, Hauke Mehrtens, # v4 . 4+
Without flushing the vdso data page the vdso call is working on dated
or unsynced data. This resulted in problems where the clock_gettime
vdso call returned a time 6 seconds later after a 3 sounds sleep,
while the syscall reported a time 3 sounds later like expected. This
happened very often and I got these ping results for example:
root@OpenWrt:/# ping 192.168.1.255
PING 192.168.1.255 (192.168.1.255): 56 data bytes
64 bytes from 192.168.1.3: seq=0 ttl=64 time=0.688 ms
64 bytes from 192.168.1.3: seq=1 ttl=64 time=4294172.045 ms
64 bytes from 192.168.1.3: seq=2 ttl=64 time=4293968.105 ms
64 bytes from 192.168.1.3: seq=3 ttl=64 time=4294055.920 ms
64 bytes from 192.168.1.3: seq=4 ttl=64 time=4294671.913 ms
The flush is now done like it is done on the arm architecture code.
This was tested on a Lantiq/Intel VRX288 (MIPS BE 34Kc V5.6 CPU with
two VPEs)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: <stable@vger.kernel.org> # v4.4+
---
arch/mips/kernel/vdso.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c
index 975e997..78fb05e 100644
--- a/arch/mips/kernel/vdso.c
+++ b/arch/mips/kernel/vdso.c
@@ -20,6 +20,8 @@
#include <linux/timekeeper_internal.h>
#include <asm/abi.h>
+#include <asm/cacheflush.h>
+#include <asm/page.h>
#include <asm/vdso.h>
/* Kernel-provided data used by the VDSO. */
@@ -85,6 +87,7 @@ void update_vsyscall(struct timekeeper *tk)
}
vdso_data_write_end(&vdso_data);
+ flush_dcache_page(virt_to_page(&vdso_data));
}
void update_vsyscall_tz(void)
@@ -93,6 +96,7 @@ void update_vsyscall_tz(void)
vdso_data.tz_minuteswest = sys_tz.tz_minuteswest;
vdso_data.tz_dsttime = sys_tz.tz_dsttime;
}
+ flush_dcache_page(virt_to_page(&vdso_data));
}
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
--
2.7.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: vdso: flush the vdso data page to update it on all processes
2016-02-21 12:57 [PATCH] MIPS: vdso: flush the vdso data page to update it on all processes Hauke Mehrtens
@ 2016-02-21 13:18 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2016-02-21 13:18 UTC (permalink / raw)
To: Hauke Mehrtens, linux-mips, ralf; +Cc: alex.smith, # v4 . 4+
Hello.
On 2/21/2016 3:57 PM, Hauke Mehrtens wrote:
> Without flushing the vdso data page the vdso call is working on dated
> or unsynced data. This resulted in problems where the clock_gettime
> vdso call returned a time 6 seconds later after a 3 sounds sleep,
> while the syscall reported a time 3 sounds later like expected. This
s/sounds/seconds/ perhaps?
> happened very often and I got these ping results for example:
>
> root@OpenWrt:/# ping 192.168.1.255
> PING 192.168.1.255 (192.168.1.255): 56 data bytes
> 64 bytes from 192.168.1.3: seq=0 ttl=64 time=0.688 ms
> 64 bytes from 192.168.1.3: seq=1 ttl=64 time=4294172.045 ms
> 64 bytes from 192.168.1.3: seq=2 ttl=64 time=4293968.105 ms
> 64 bytes from 192.168.1.3: seq=3 ttl=64 time=4294055.920 ms
> 64 bytes from 192.168.1.3: seq=4 ttl=64 time=4294671.913 ms
>
> The flush is now done like it is done on the arm architecture code.
>
> This was tested on a Lantiq/Intel VRX288 (MIPS BE 34Kc V5.6 CPU with
> two VPEs)
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> Cc: <stable@vger.kernel.org> # v4.4+
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-21 19:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-21 12:57 [PATCH] MIPS: vdso: flush the vdso data page to update it on all processes Hauke Mehrtens
2016-02-21 13:18 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).