mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@kernel.org>
To: x86@kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>, Andy Lutomirski <luto@kernel.org>
Subject: [PATCH 3/3] x86/vdso: Document vgtod_ts better
Date: Thu,  4 Oct 2018 14:44:45 -0700	[thread overview]
Message-ID: <f66f53d81150bbad47d7b282c9207a71a3ce1c16.1538689401.git.luto@kernel.org> (raw)
In-Reply-To: <cover.1538689401.git.luto@kernel.org>
In-Reply-To: <cover.1538689401.git.luto@kernel.org>

After reading do_hres() and do_course() and scratching my head a
bit, I figured out why the arithmetic is strange.  Document it.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/include/asm/vgtod.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
index d17b092b9f1b..69d05c6d47f5 100644
--- a/arch/x86/include/asm/vgtod.h
+++ b/arch/x86/include/asm/vgtod.h
@@ -13,6 +13,15 @@ typedef u64 gtod_long_t;
 typedef unsigned long gtod_long_t;
 #endif
 
+/*
+ * There is one of these objects in the vvar page for each
+ * vDSO-accelerated clockid.  For high-resolution clocks, this encodes
+ * the time corresponding to vsyscall_gtod_data.cycle_last.  For coarse
+ * clocks, this encodes the actual time.
+ *
+ * To confuse the reader, for high-resolution clocks, nsec is left-shifted
+ * by vsyscall_gtod_data.shift.
+ */
 struct vgtod_ts {
 	u64		sec;
 	u64		nsec;
-- 
2.17.1


  parent reply	other threads:[~2018-10-04 21:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 21:44 [PATCH 0/3] x86/vdso: Minor improvements Andy Lutomirski
2018-10-04 21:44 ` [PATCH 1/3] x86/vdso: Remove "memory" clobbers in the vDSO syscall fallbacks Andy Lutomirski
2018-10-05  8:27   ` [tip:x86/vdso] " tip-bot for Andy Lutomirski
2018-10-04 21:44 ` [PATCH 2/3] x86/vdso: Rearrange do_hres() to improve code generation Andy Lutomirski
2018-10-05  6:00   ` Thomas Gleixner
2018-10-05 13:05     ` Andy Lutomirski
2018-10-04 21:44 ` Andy Lutomirski [this message]
2018-10-05  8:28   ` [tip:x86/vdso] x86/vdso: Document vgtod_ts better tip-bot for Andy Lutomirski

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=f66f53d81150bbad47d7b282c9207a71a3ce1c16.1538689401.git.luto@kernel.org \
    --to=luto@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®