[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d0e9d6cd-16ea-173d-36ba-24ab814553b1@intel.com>
Date: Thu, 30 Sep 2021 17:40:24 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: Stefan Hajnoczi <stefanha@...hat.com>
CC: <x86@...nel.org>, Tony Luck <tony.luck@...el.com>,
Dave Hansen <dave.hansen@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Jens Axboe <axboe@...nel.dk>,
Christian Brauner <christian@...uner.io>,
Peter Zijlstra <peterz@...radead.org>,
Shuah Khan <shuah@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Jonathan Corbet <corbet@....net>,
Ashok Raj <ashok.raj@...el.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
"Gayatri Kammela" <gayatri.kammela@...el.com>,
Zeng Guang <guang.zeng@...el.com>,
"Dan Williams" <dan.j.williams@...el.com>,
Randy E Witt <randy.e.witt@...el.com>,
Ravi V Shankar <ravi.v.shankar@...el.com>,
Ramesh Thomas <ramesh.thomas@...el.com>,
<linux-api@...r.kernel.org>, <linux-arch@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>
Subject: Re: [RFC PATCH 00/13] x86 User Interrupts support
On 9/30/2021 9:26 AM, Stefan Hajnoczi wrote:
> On Mon, Sep 13, 2021 at 01:01:19PM -0700, Sohil Mehta wrote:
>> +------------+-------------------------+
>> | IPC type | Relative Latency |
>> | |(normalized to User IPI) |
>> +------------+-------------------------+
>> | User IPI | 1.0 |
>> | Signal | 14.8 |
>> | Eventfd | 9.7 |
> Is this the bi-directional eventfd benchmark?
> https://github.com/intel/uintr-ipc-bench/blob/linux-rfc-v1/source/eventfd/eventfd-bi.c
Yes. I have left it unmodified from the original source. But, I should
have looked at it more closely.
> Two things stand out:
>
> 1. The server and client threads are racing on the same eventfd.
> Eventfds aren't bi-directional! The eventfd_wait() function has code
> to write the value back, which is a waste of CPU cycles and hinders
> progress. I've never seen eventfd used this way in real applications.
> Can you use two separate eventfds?
Sure. I can do that.
> 2. The fd is in blocking mode and the task may be descheduled, so we're
> measuring eventfd read/write latency plus scheduler/context-switch
> latency. A fairer comparison against user interrupts would be to busy
> wait on a non-blocking fd so the scheduler/context-switch latency is
> mostly avoided. After all, the uintrfd-bi.c benchmark does this in
> uintrfd_wait():
>
> // Keep spinning until the interrupt is received
> while (!uintr_received[token]);
That makes sense. I'll give this a try and send out the updated results.
Thanks,
Sohil
Powered by blists - more mailing lists