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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Nov 2019 14:53:54 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Marcelo Tosatti <mtosatti@...hat.com>,
        Zhenzhong Duan <zhenzhong.duan@...cle.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        joao.m.martins@...cle.com, rafael.j.wysocki@...el.com,
        rkrcmar@...hat.com
Subject: Re: [PATCH 3/5] KVM: ensure pool time is longer than block_ns

On 01/11/19 22:16, Marcelo Tosatti wrote:
>  		if (!vcpu_valid_wakeup(vcpu)) {
>  			shrink_halt_poll_ns(vcpu);
>  		} else if (halt_poll_ns) {
> -			if (block_ns <= vcpu->halt_poll_ns)
> +			if (block_ns < vcpu->halt_poll_ns)
>  				;
>  			/* we had a short halt and our poll time is too small */
>  			else if (block_ns < halt_poll_ns)

What about making this "if (!waited)"?  The result would be very readable:

                        if (!waited)
                                ;
                        /* we had a long block, shrink polling */
                        else if (block_ns > halt_poll_ns && vcpu->halt_poll_ns)
                                shrink_halt_poll_ns(vcpu);
                        /* we had a short halt and our poll time is too small */
                        else if (block_ns < halt_poll_ns && vcpu->halt_poll_ns < halt_poll_ns)
                                grow_halt_poll_ns(vcpu);

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ