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: <1349341186.4438.1.camel@twins>
Date:	Thu, 04 Oct 2012 10:59:46 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Andrea Righi <andrea@...terlinux.com>
Cc:	Paul Menage <paul@...lmenage.org>, Ingo Molnar <mingo@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 1/3] sched: introduce distinct per-cpu load average

On Thu, 2012-10-04 at 01:05 +0200, Andrea Righi wrote:
> +++ b/kernel/sched/core.c
> @@ -727,15 +727,17 @@ static void dequeue_task(struct rq *rq, struct task_struct *p, int flags)
>  void activate_task(struct rq *rq, struct task_struct *p, int flags)
>  {
>         if (task_contributes_to_load(p))
> -               rq->nr_uninterruptible--;
> +               cpu_rq(p->on_cpu_uninterruptible)->nr_uninterruptible--;
>  
>         enqueue_task(rq, p, flags);
>  }

That's completely broken, you cannot do non-atomic cross-cpu
modifications like that. Also, adding an atomic op to the wakeup/sleep
paths isn't going to be popular at all.

>  void deactivate_task(struct rq *rq, struct task_struct *p, int flags)
>  {
> -       if (task_contributes_to_load(p))
> -               rq->nr_uninterruptible++;
> +       if (task_contributes_to_load(p)) {
> +               task_rq(p)->nr_uninterruptible++;
> +               p->on_cpu_uninterruptible = task_cpu(p);
> +       }
>  
>         dequeue_task(rq, p, flags);
>  } 

This looks pointless, at deactivate time task_rq() had better be rq or
something is terribly broken.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ