LKML Archive on
help / color / mirror / Atom feed
From: Michael Rodin <>
	Michael Rodin <>
Subject: [PATCH] arch/x86/entry/vsyscall/vsyscall_gtod.c: remove __read_mostly from vclocks_used
Date: Mon,  4 Jun 2018 19:27:11 +0200	[thread overview]
Message-ID: <> (raw)

The variable "vclocks_used" doesn't appear to be "read mostly".
Measurements of the access frequency with perf stat [1] and
perf report show, that approximately half of the accesses to
this variable are write accesses and happen in update_vsyscall()
in the file arch/x86/entry/vsyscall/vsyscall_gtod.c.
The measurements were done with the kernel 4.13.0-43-generic used by
ubuntu as well as with the stable kernel 4.16.7 with a custom config.
I've used "perf bench sched" and iperf3 as workloads.

This was discovered during my master thesis in the CADOS project [2].

[1] perf stat --all-cpus --group --event="{mem:addr/4:rw:k,mem:addr/4:w:k}"

Signed-off-by: Michael Rodin <>
 arch/x86/entry/vsyscall/vsyscall_gtod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vsyscall/vsyscall_gtod.c b/arch/x86/entry/vsyscall/vsyscall_gtod.c
index e1216dd95c04..fc39f701fe4a 100644
--- a/arch/x86/entry/vsyscall/vsyscall_gtod.c
+++ b/arch/x86/entry/vsyscall/vsyscall_gtod.c
@@ -17,7 +17,7 @@
 #include <asm/vgtod.h>
 #include <asm/vvar.h>
-int vclocks_used __read_mostly;
+int vclocks_used;
 DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data);

             reply	other threads:[~2018-06-04 17:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 17:27 Michael Rodin [this message]
2018-06-22 22:47 ` Thomas Gleixner
2018-06-22 23:25   ` Andy Lutomirski
2018-06-23  9:04     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] arch/x86/entry/vsyscall/vsyscall_gtod.c: remove __read_mostly from vclocks_used' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).