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: <20070621105152.8daf87ad.pj@sgi.com>
Date:	Thu, 21 Jun 2007 10:51:52 -0700
From:	Paul Jackson <pj@....com>
To:	vatsa@...ux.vnet.ibm.com
Cc:	mingo@...e.hu, clameter@....com, linux-kernel@...r.kernel.org,
	dino@...ibm.com, akpm@...ux-foundation.org
Subject: Re: cpuset attach_task to touch per-cpu kernel threads?

> Yeah .."allow movement if it doesn't result in changing kernel-threads's cpu 
> affinity" sounds good, except it is hard to implement in cpuset's
> context I think. For ex: we now have to take additional steps when
> changing 'cpus_allowed' of a cpuset such that it doesn't violate any cpu
> affinity of kernel threads bound to the cpuset. That itself makes the
> implementation complex I think.

Yes, that would be more complex than we need.  You're right.

The only problem comes with kernel tasks that are pinned to less than
the entire system, and that are in the top cpuset.

They should remain in the top cpuset.  Since the top cpuset is never
allowed to have less than all the cpus in the system, such kernel
threads can then be assured of being allowed to use the cpus they need
to use.

Could you try coding something like the following in kernel/cpuset.c,
Srivatsa?

/* Call with task_lock held on tsk */
is_pinned_kernel_thread(tsk)
{
	/* "pinned" means constrained to a strict subset of online cpus */
	int is_pinned = !cpus_subset(cpus_online_map, tsk->cpus_allowed);
	int is_kthread = !tsk->mm || (tsk->flags & PF_BORROWED_MM);

	return is_pinned && is_kthread;
}

Then call it from kernel/cpuset.c:attach_task() with:

	/* Don't moved pinned kernel threads out of top cpuset */
	if (is_pinned_kernel_thread(tsk) && oldcs == &top_cpuset && cs != oldcs) {
                task_unlock(tsk);
                mutex_unlock(&callback_mutex);
                put_task_struct(tsk);
		return -EINVAL;
	}

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@....com> 1.925.600.0401
-
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