lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87bk3pakio.fsf@oracle.com>
Date: Mon, 24 Jun 2024 18:17:19 -0700
From: Ankur Arora <ankur.a.arora@...cle.com>
To: Sudeep Holla <sudeep.holla@....com>
Cc: Ankur Arora <ankur.a.arora@...cle.com>, linux-pm@...r.kernel.org,
        kvm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, catalin.marinas@....com, will@...nel.org,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, x86@...nel.org,
        hpa@...or.com, pbonzini@...hat.com, wanpengli@...cent.com,
        vkuznets@...hat.com, rafael@...nel.org, daniel.lezcano@...aro.org,
        peterz@...radead.org, arnd@...db.de, lenb@...nel.org,
        mark.rutland@....com, harisokn@...zon.com, joao.m.martins@...cle.com,
        boris.ostrovsky@...cle.com, konrad.wilk@...cle.com
Subject: Re: [PATCH 8/9] arm64: support cpuidle-haltpoll


Sudeep Holla <sudeep.holla@....com> writes:

> On Fri, Jun 21, 2024 at 04:59:22PM -0700, Ankur Arora wrote:
>>
>> Sudeep Holla <sudeep.holla@....com> writes:
>>
>> > On Tue, Apr 30, 2024 at 11:37:29AM -0700, Ankur Arora wrote:
>> >> Add architectural support for the cpuidle-haltpoll driver by defining
>> >> arch_haltpoll_*(). Also select ARCH_HAS_OPTIMIZED_POLL since we have
>> >> an optimized polling mechanism via smp_cond_load*().
>> >>
>> >> Add the configuration option, ARCH_CPUIDLE_HALTPOLL to allow
>> >> cpuidle-haltpoll to be selected.
>> >>
>> >> Note that we limit cpuidle-haltpoll support to when the event-stream is
>> >> available. This is necessary because polling via smp_cond_load_relaxed()
>> >> uses WFE to wait for a store which might not happen for an prolonged
>> >> period of time. So, ensure the event-stream is around to provide a
>> >> terminating condition.
>> >>
>> >
>> > Currently the event stream is configured 10kHz(1 signal per 100uS IIRC).
>> > But the information in the cpuidle states for exit latency and residency
>> > is set to 0(as per drivers/cpuidle/poll_state.c). Will this not cause any
>> > performance issues ?
>>
>> No I don't think there's any performance issue.
>>
>
> Thanks for the confirmation, that was my assumption as well.
>
>> When the core is waiting in WFE for &thread_info->flags to
>> change, and set_nr_if_polling() happens, the CPU will come out
>> of the wait quickly.
>> So, the exit latency, residency can be reasonably set to 0.
>>
>
> Sure
>
>> If, however, there is no store to &thread_info->flags, then the event
>> stream is what would cause us to come out of the WFE and check if
>> the poll timeout has been exceeded.
>> In that case, there was no work to be done, so there was nothing
>> to wake up from.
>>
>
> This is exactly what I was referring when I asked about performance, but
> it looks like it is not a concern for the reason specified about.
>
>> So, in either circumstance there's no performance loss.
>>
>> However, when we are polling under the haltpoll governor, this might
>> mean that we spend more time polling than determined based on the
>> guest_halt_poll_ns. But, that would only happen in the last polling
>> iteration.
>>
>> So, I'd say, at worst no performance loss. But, we would sometimes
>> poll for longer than necessary before exiting to the host.
>>
>
> Does it make sense to add some comment that implies briefly what we
> have discussed here ? Mainly why 0 exit and target residency values
> are fine and how worst case WFE wakeup doesn't impact the performance.

Yeah let me thresh out the commit message for this patch a bit more.

Thanks for the review!

--
ankur

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ