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:   Fri, 23 Jun 2017 12:05:35 +0800
From:   Yang Zhang <yang.zhang.wz@...il.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     mingo@...hat.com, hpa@...or.com, pbonzini@...hat.com,
        x86@...nel.org, corbet@....net, tony.luck@...el.com, bp@...en8.de,
        peterz@...radead.org, mchehab@...nel.org,
        akpm@...ux-foundation.org, krzk@...nel.org, jpoimboe@...hat.com,
        luto@...nel.org, borntraeger@...ibm.com, thgarnie@...gle.com,
        rgerst@...il.com, minipli@...glemail.com,
        douly.fnst@...fujitsu.com, nicstange@...il.com, fweisbec@...il.com,
        dvlasenk@...hat.com, bristot@...hat.com,
        yamada.masahiro@...ionext.com, mika.westerberg@...ux.intel.com,
        yu.c.chen@...el.com, aaron.lu@...el.com, rostedt@...dmis.org,
        me@...ehuey.com, len.brown@...el.com, prarit@...hat.com,
        hidehiro.kawai.ez@...achi.com, fengtiantian@...wei.com,
        pmladek@...e.com, jeyu@...hat.com, Larry.Finger@...inger.net,
        zijun_hu@....com, luisbg@....samsung.com, johannes.berg@...el.com,
        niklas.soderlund+renesas@...natech.se, zlpnobody@...il.com,
        adobriyan@...il.com, fgao@...ai8.com, ebiederm@...ssion.com,
        subashab@...eaurora.org, arnd@...db.de, matt@...eblueprint.co.uk,
        mgorman@...hsingularity.net, linux-kernel@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-edac@...r.kernel.org,
        kvm@...r.kernel.org
Subject: Re: [PATCH 1/2] x86/idle: add halt poll for halt idle

On 2017/6/22 22:23, Thomas Gleixner wrote:
> On Thu, 22 Jun 2017, root wrote:
>> --- a/arch/x86/kernel/process.c
>> +++ b/arch/x86/kernel/process.c
>> @@ -39,6 +39,10 @@
>>  #include <asm/desc.h>
>>  #include <asm/prctl.h>
>>
>> +#ifdef CONFIG_HYPERVISOR_GUEST
>> +unsigned long poll_threshold_ns;
>> +#endif
>> +
>>  /*
>>   * per-CPU TSS segments. Threads are completely 'soft' on Linux,
>>   * no more per-task TSS's. The TSS size is kept cacheline-aligned
>> @@ -313,6 +317,23 @@ static inline void play_dead(void)
>>  }
>>  #endif
>>
>> +#ifdef CONFIG_HYPERVISOR_GUEST
>> +void arch_cpu_idle_poll(void)
>> +{
>> +	ktime_t start, cur, stop;
>> +
>> +	if (poll_threshold_ns) {
>> +		start = cur = ktime_get();
>> +		stop = ktime_add_ns(ktime_get(), poll_threshold_ns);
>> +		do {
>> +			if (need_resched())
>> +				break;
>> +			cur = ktime_get();
>> +		} while (ktime_before(cur, stop));
>> +	}
>> +}
>> +#endif
>
> Aside of the whole approach being debatable, what's the reason to make this
> depend on CONFIG_HYPERVISOR_GUEST and to move it into x86. If that
> mechanism is worthwhile then it should go into the generic code and not
> into x86. There is absolutely nothing x86 specific in that patch.
>
> Also the CONFIG_HYPERVISOR_GUEST dependency is silly. Distro kernels ship
> with CONFIG_HYPERVISOR_GUEST=y so this also gets into affect on bare metal.

You are right. As Paolo suggested, i will integrate it with 
paravalization code.

>
> Thanks,
>
> 	tglx
>


-- 
Yang
Alibaba Cloud Computing

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ