From: "Albert D. Cahalan" <acahalan@cs.uml.edu>
To: colpatch@us.ibm.com (Matthew Dobson)
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc-based cpu affinity user interface
Date: Mon, 10 Dec 2001 03:33:05 -0500 (EST) [thread overview]
Message-ID: <200112100833.fBA8X6m209019@saturn.cs.uml.edu> (raw)
In-Reply-To: <3C03F647.5F23193@us.ibm.com> from "Matthew Dobson" at Nov 27, 2001 12:23:35 PM
> I've been working on a patch that is a roll up of Andrew Morton's patch, and
> also of some work by Nick Pollitt to use a prctl() interface to the
> cpus_allowed bitmask. It also includes a new bitmask 'launch_policy' which
> allows a process to set a launch policy which is used to determine it's
> childrens' cpus_allowed bitmasks prior to launch.
It looks like you are limiting the number of CPUs to sizeof(long).
Must you? Using "%lx" would be better in any case. Considering that
you may outgrow the format, maybe this info doesn't belong in the
/proc/*/stat files at all. For "ps" usage, a simple flag to indicate
if the process is locked to a CPU would be OK. There are 3 cases
of interest:
1. can run on all CPUs
2. can run on only the currently used CPU
3. can run on some subset of the available CPUs
(defined sanely for 1-CPU and 2-CPU systems of course)
> diff -Nur linux-2.4.10/fs/proc/array.c linux-2.4.10-launch_policy/fs/proc/array.c
> --- linux-2.4.10/fs/proc/array.c Fri Oct 26 15:07:16 2001
> +++ linux-2.4.10-launch_policy/fs/proc/array.c Thu Nov 15 13:38:57 2001
> @@ -50,6 +50,10 @@
> * Al Viro & Jeff Garzik : moved most of the thing into base.c and
> * : proc_misc.c. The rest may eventually go into
> * : base.c too.
> + *
> + * Andrew Morton : cpus_allowed
> + *
> + * Matthew Dobson : launch_policy (Thanks to Andrew Morton for inspiraton)
> */
>
> #include <linux/config.h>
> @@ -343,7 +347,7 @@
> read_unlock(&tasklist_lock);
> res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
> %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu %lu \
> -%lu %lu %lu %lu %lu %lu %lu %lu %d %d\n",
> +%lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n",
> task->pid,
> task->comm,
> state,
> @@ -386,7 +390,9 @@
> task->nswap,
> task->cnswap,
> task->exit_signal,
> - task->processor);
> + task->processor,
> + task->cpus_allowed,
> + task->launch_policy);
next prev parent reply other threads:[~2001-12-10 8:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-27 20:23 Matthew Dobson
2001-12-10 8:33 ` Albert D. Cahalan [this message]
2001-12-10 8:40 ` Robert Love
2001-12-10 9:37 ` Albert D. Cahalan
-- strict thread matches above, loose matches on Subject: below --
2001-11-27 3:31 Robert Love
2001-11-27 3:52 ` Davide Libenzi
2001-11-27 4:14 ` Robert Love
2001-11-27 4:39 ` Davide Libenzi
2001-11-27 4:48 ` Davide Libenzi
2001-11-27 14:17 ` Ingo Molnar
2001-11-27 16:49 ` Davide Libenzi
2001-11-27 18:46 ` Ingo Molnar
2001-11-27 4:37 ` Anton Blanchard
2001-11-27 5:42 ` Tim Hockin
2001-11-27 5:08 ` Robert Love
2001-11-27 6:25 ` Andreas Dilger
2001-11-27 6:40 ` Robert Love
2001-11-27 11:52 ` Ingo Molnar
2001-11-27 10:10 ` Alan Cox
2001-11-27 14:21 ` Ingo Molnar
2001-11-27 20:44 ` Robert Love
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200112100833.fBA8X6m209019@saturn.cs.uml.edu \
--to=acahalan@cs.uml.edu \
--cc=colpatch@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®