From: Vincenzo Frascino <vincenzo.frascino@arm.com>
To: Anna-Maria Behnsen <anna-maria@linutronix.de>,
Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] vdso/gettimeofday: Clarify comment about open coded function
Date: Mon, 1 Jul 2024 15:58:13 +0100 [thread overview]
Message-ID: <ebba1959-53b3-4001-bf7d-30704cd3866d@arm.com> (raw)
In-Reply-To: <20240701-vdso-cleanup-v1-1-36eb64e7ece2@linutronix.de>
On 01/07/2024 15:47, Anna-Maria Behnsen wrote:
> The two comments state, that the following code open codes something but
> they lack to specify what exactly is open coded.
>
> Expand comments by mentioning the reference to the open coded function.
>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> ---
> lib/vdso/gettimeofday.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
> index 899850bd6f0b..c01eaafd8041 100644
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -140,14 +140,14 @@ static __always_inline int do_hres(const struct vdso_data *vd, clockid_t clk,
>
> do {
> /*
> - * Open coded to handle VDSO_CLOCKMODE_TIMENS. Time namespace
> - * enabled tasks have a special VVAR page installed which
> - * has vd->seq set to 1 and vd->clock_mode set to
> - * VDSO_CLOCKMODE_TIMENS. For non time namespace affected tasks
> - * this does not affect performance because if vd->seq is
> - * odd, i.e. a concurrent update is in progress the extra
> - * check for vd->clock_mode is just a few extra
> - * instructions while spin waiting for vd->seq to become
> + * Open coded function vdso_read_begin() to handle
> + * VDSO_CLOCKMODE_TIMENS. Time namespace enabled tasks have a
> + * special VVAR page installed which has vd->seq set to 1 and
> + * vd->clock_mode set to VDSO_CLOCKMODE_TIMENS. For non time
> + * namespace affected tasks this does not affect performance
> + * because if vd->seq is odd, i.e. a concurrent update is in
> + * progress the extra check for vd->clock_mode is just a few
> + * extra instructions while spin waiting for vd->seq to become
> * even again.
> */
> while (unlikely((seq = READ_ONCE(vd->seq)) & 1)) {
> @@ -223,8 +223,8 @@ static __always_inline int do_coarse(const struct vdso_data *vd, clockid_t clk,
>
> do {
> /*
> - * Open coded to handle VDSO_CLOCK_TIMENS. See comment in
> - * do_hres().
> + * Open coded function vdso_read_begin() to handle
> + * VDSO_CLOCK_TIMENS. See comment in do_hres().
> */
> while ((seq = READ_ONCE(vd->seq)) & 1) {
> if (IS_ENABLED(CONFIG_TIME_NS) &&
>
--
Regards,
Vincenzo
next prev parent reply other threads:[~2024-07-01 14:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 14:47 [PATCH 0/5] vdso (generic and x86): Misc minor cleanups Anna-Maria Behnsen
2024-07-01 14:47 ` [PATCH 1/5] vdso/gettimeofday: Clarify comment about open coded function Anna-Maria Behnsen
2024-07-01 14:58 ` Vincenzo Frascino [this message]
2024-07-03 19:36 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 14:47 ` [PATCH 2/5] vdso: Add comment about reason for vdso struct ordering Anna-Maria Behnsen
2024-07-01 15:10 ` Vincenzo Frascino
2024-07-01 15:31 ` Anna-Maria Behnsen
2024-07-01 16:17 ` Vincenzo Frascino
2024-07-03 19:36 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 14:47 ` [PATCH 3/5] x86/vdso: Fix function reference in comment Anna-Maria Behnsen
2024-07-01 15:11 ` Vincenzo Frascino
2024-07-03 19:36 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 14:47 ` [PATCH 4/5] x86/vgtod: Remove unused typedef gtod_long_t Anna-Maria Behnsen
2024-07-01 15:19 ` Vincenzo Frascino
2024-07-03 19:36 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 14:47 ` [PATCH 5/5] x86/vdso: Remove unused include Anna-Maria Behnsen
2024-07-01 16:19 ` Vincenzo Frascino
2024-07-03 19:36 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
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=ebba1959-53b3-4001-bf7d-30704cd3866d@arm.com \
--to=vincenzo.frascino@arm.com \
--cc=anna-maria@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=tglx@linutronix.de \
/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®