public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Cc: Szabolcs Nagy <szabolcs.nagy@arm.com>
Subject: Re: [PATCH] elf: Fix fences in _dl_find_object_update (bug 28745)
Date: Thu, 06 Jan 2022 19:13:05 -0300	[thread overview]
Message-ID: <871r1k7bta.fsf@linux.ibm.com> (raw)
In-Reply-To: <87tueie1lf.fsf@oldenburg.str.redhat.com>

I haven't been able to reproduce the issue after applying this patch.
I've found a coding style issue:

Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> writes:

> diff --git a/elf/dl-find_object.c b/elf/dl-find_object.c
> index 721fed50d6..a2f7144a34 100644
> --- a/elf/dl-find_object.c
> +++ b/elf/dl-find_object.c
> @@ -293,8 +297,20 @@ _dlfo_mappings_end_update_no_switch (void)
>  static inline bool
>  _dlfo_read_success (uint64_t start_version)
>  {
> -  return _dlfo_read_start_version () == start_version;
> -}
> +  /* See Hans Boehm, Can Seqlocks Get Along with Programming Language
> +     Memory Models?, Section 4.  This is necessary so that loads in
> +     the TM region are not ordered passed the version check below.  */
> +  atomic_thread_fence_acquire ();
> +
> +  /* Synchronizes with stores in _dlfo_mappings_begin_update,
> +     _dlfo_mappings_end_update, _dlfo_mappings_end_update_no_switch.
> +     It is important that all stores from the last update have been
> +     visible, and stores from the next updates are not.
> +
> +     Unlike with seqlocks, there is no check for odd versions here
> +     because we have read the unmodified copy (confirmed to be
> +     unmodified by the unchanged version).  */
> + return _dlfo_read_start_version () == start_version; }

   ^ Wrong indentation here                              ^ Closing brackets here

Thanks!

-- 
Tulio Magno

      parent reply	other threads:[~2022-01-06 22:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 13:47 Florian Weimer
2022-01-05 14:00 ` Andreas Schwab
2022-01-05 14:03   ` Florian Weimer
2022-01-05 18:49 ` Szabolcs Nagy
2022-01-07 11:59   ` Florian Weimer
2022-01-06 22:13 ` Tulio Magno Quites Machado Filho [this message]

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=871r1k7bta.fsf@linux.ibm.com \
    --to=tuliom@linux.ibm.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=szabolcs.nagy@arm.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).