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]
Message-ID: <777b7674-4811-dac4-17df-29bd028d6b26@linux.intel.com>
Date:   Thu, 2 May 2019 17:06:22 -0700
From:   Tim Chen <tim.c.chen@...ux.intel.com>
To:     Aaron Lu <aaron.lu@...ux.alibaba.com>,
        Vineeth Remanan Pillai <vpillai@...italocean.com>
Cc:     Nishanth Aravamudan <naravamudan@...italocean.com>,
        Julien Desfossez <jdesfossez@...italocean.com>,
        Peter Zijlstra <peterz@...radead.org>, mingo@...nel.org,
        tglx@...utronix.de, pjt@...gle.com, torvalds@...ux-foundation.org,
        linux-kernel@...r.kernel.org, subhra.mazumdar@...cle.com,
        fweisbec@...il.com, keescook@...omium.org, kerrnel@...gle.com,
        Phil Auld <pauld@...hat.com>, Aaron Lu <aaron.lwe@...il.com>,
        Aubrey Li <aubrey.intel@...il.com>,
        Valentin Schneider <valentin.schneider@....com>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks

On 5/1/19 4:27 PM, Tim Chen wrote:
> On 4/28/19 11:15 PM, Aaron Lu wrote:
>> On Tue, Apr 23, 2019 at 04:18:16PM +0000, Vineeth Remanan Pillai wrote:
>>> +/*
>>> + * Find left-most (aka, highest priority) task matching @cookie.
>>> + */
>>> +struct task_struct *sched_core_find(struct rq *rq, unsigned long cookie)
>>> +{
>>> +	struct rb_node *node = rq->core_tree.rb_node;
>>> +	struct task_struct *node_task, *match;
>>> +
>>> +	/*
>>> +	 * The idle task always matches any cookie!
>>> +	 */
>>> +	match = idle_sched_class.pick_task(rq);
>>> +
>>> +	while (node) {
>>> +		node_task = container_of(node, struct task_struct, core_node);
>>> +
>>> +		if (node_task->core_cookie < cookie) {
>>> +			node = node->rb_left;
>>
>> Should go right here?
>>
> 
> I think Aaron is correct.  We order the rb tree where tasks with smaller core cookies
> go to the left part of the tree.
> 
> In this case, the cookie we are looking for is larger than the current node's cookie.
> It seems like we should move to the right to look for a node with matching cookie.
> 
> At least making the following change still allow us to run the system stably for sysbench.
> Need to gather more data to see how performance changes.

Pawan ran an experiment setting up 2 VMs, with one VM doing a parallel kernel build and one VM doing sysbench,
limiting both VMs to run on 16 cpu threads (8 physical cores), with 8 vcpu for each VM.
Making the fix did improve kernel build time by 7%.

Tim


> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 25638a47c408..ed4cfa49e3f2 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -208,9 +208,9 @@ static struct task_struct *sched_core_find(struct rq *rq, unsigned long cookie)
>         while (node) {
>                 node_task = container_of(node, struct task_struct, core_node);
>  
> -               if (node_task->core_cookie < cookie) {
> +               if (cookie < node_task->core_cookie) {
>                         node = node->rb_left;
> -               } else if (node_task->core_cookie > cookie) {
> +               } else if (cookie > node_task->core_cookie) {
>                         node = node->rb_right;
>                 } else {
>                         match = node_task;
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ