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, 04 Dec 2009 11:40:59 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Tejun Heo <tj@...nel.org>
Cc:	tglx@...utronix.de, mingo@...e.hu, avi@...hat.com, efault@....de,
	rusty@...tcorp.com.au, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/7] sched: implement force_cpus_allowed()

On Wed, 2009-12-02 at 12:56 +0900, Tejun Heo wrote:
> set_cpus_allowed_ptr() modifies the allowed cpu mask of a task.  The
> function performs the following checks before applying new mask.
> 
> * Check whether PF_THREAD_BOUND is set.  This is set for bound
>   kthreads so that they can't be moved around.
> 
> * Check whether the target cpu is still marked active - cpu_active().
>   Active state is cleared early while downing a cpu.
> 
> This patch adds force_cpus_allowed() which bypasses the above two
> checks.  The caller is responsible for guaranteeing that the
> destination cpu doesn't go down until force_cpus_allowed() finishes.
> 
> The first check is bypassed by factoring out actual migration part
> into __set_cpus_allowed() from set_cpus_allowed_ptr() and calling the
> inner function from force_cpus_allowed().
> 
> The second check is buried deep down in __migrate_task() which is
> executed by migration threads.  @force parameter is added to
> __migrate_task().  As the only way to pass parameters from
> __set_cpus_allowed() is through migration_req, migration_req->force is
> added and the @force parameter is passed down to __migrate_task().
> 
> Please note the naming discrepancy between set_cpus_allowed_ptr() and
> the new functions.  The _ptr suffix is from the days when cpumask api
> wasn't mature and future changes should drop it from
> set_cpus_allowed_ptr() too.
> 
> force_cpus_allowed() will be used for concurrency-managed workqueue.

Would still like to know why all this is needed.

--
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