fio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Fu <vincentfu@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, fio@vger.kernel.org
Cc: Vincent Fu <vincent.fu@samsung.com>
Subject: Re: [PATCH] gettime: fix cpuclock-test on AMD platforms
Date: Tue, 27 Feb 2024 12:38:05 -0500	[thread overview]
Message-ID: <eec27771-3934-42a2-becf-c45501a84e0d@gmail.com> (raw)
In-Reply-To: <dd061da8-a3e0-4824-a650-8db42300af99@kernel.dk>

On 2/27/24 11:34, Jens Axboe wrote:
> On 2/27/24 8:26 AM, Vincent Fu wrote:
>> Starting with gcc 11 __sync_synchronize() compiles to
>>
>> lock or QWORD PTR [rsp], 0
>>
>> on x86_64 platforms. Previously it compiled to an mfence instruction.
>>
>> See line 47 of https://godbolt.org/z/xfE18K7b4 for an example.
>>
>> On Intel platforms this change does not affect the result of fio's CPU
>> clock test. But on AMD platforms, this change causes fio's CPU clock
>> test to fail and fio to fall back to clock_gettime() instead of using
>> the CPU clock for timing.
>>
>> This patch has fio explicitly use an mfence instruction instead of
>> __sync_synchornize() in the CPU clock test code on x86_64 platforms in
>> order to allow the CPU clock test to pass on AMD platforms.
> 
> Looks good:
> 
> Reviewed-by: Jens Axboe <axboe@kernel.dk>
> 
Applied. Thanks.

      reply	other threads:[~2024-02-27 17:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 15:26 [PATCH] gettime: fix cpuclock-test on AMD platforms Vincent Fu
2024-02-27 16:34 ` Jens Axboe
2024-02-27 17:38   ` Vincent Fu [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=eec27771-3934-42a2-becf-c45501a84e0d@gmail.com \
    --to=vincentfu@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=vincent.fu@samsung.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).