public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Ferber <aferber@techfak.uni-bielefeld.de>
To: Robert Love <rml@tech9.net>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] syscall interface for cpu affinity
Date: Mon, 11 Mar 2002 01:38:53 +0100	[thread overview]
Message-ID: <20020311013853.A1545@devcon.net> (raw)
In-Reply-To: <1015784104.1261.8.camel@phantasy>
In-Reply-To: <1015784104.1261.8.camel@phantasy>; from rml@tech9.net on Sun, Mar 10, 2002 at 01:15:03PM -0500

On Sun, Mar 10, 2002 at 01:15:03PM -0500, Robert Love wrote:
> 
> This patch implements
> 
>         int sched_set_affinity(pid_t pid, unsigned int len,
>                                unsigned long *new_mask_ptr);
> 
>         int sched_get_affinity(pid_t pid, unsigned int *user_len_ptr,
>                                unsigned long *user_mask_ptr)
> 
> which set and get the cpu affinity (task->cpus_allowed) for a task,
> using the set_cpus_allowed function in Ingo's scheduler.  The functions
> properly support changes to cpus_allowed, implement security, and are
> well-tested.

Setting the affinity of a whole process group also makes sense IMHO.
Therefore I think an interface more like the setpriority syscall
for sched_set_affinity (with two parameters which/who instead of a
single PID) would be more flexible, eg.

    int sched_set_affinity(int which, int who, unsigned int len,
                           unsigned long *new_mask_ptr);

with who one of {PRIO_PROCESS,PRIO_PGRP,PRIO_USER} and which according
to the value of who.


Getting the mask of a group of processes doesn't make sense though
(what if they differ?), so the current interface of sched_get_affinity
is just fine IMHO.

Andreas
-- 
       Andreas Ferber - dev/consulting GmbH - Bielefeld, FRG
     ---------------------------------------------------------
         +49 521 1365800 - af@devcon.net - www.devcon.net

  parent reply	other threads:[~2002-03-11  0:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-10 18:15 [PATCH] syscall interface for cpu affinity Robert Love
2002-03-10 20:29 ` Andreas Jaeger
2002-03-10 20:53   ` Robert Love
2002-03-10 21:03     ` Andreas Jaeger
2002-03-10 22:23       ` Andreas Schwab
2002-03-10 23:56       ` Andreas Ferber
2002-03-10 23:45     ` Jeff Garzik
1976-03-03 15:58       ` Tim Hockin
2002-03-11  0:08         ` Jeff Garzik
2002-03-11  0:32           ` Tim Hockin
2002-03-10 22:05 ` Chris Wedgwood
2002-03-10 22:11   ` Robert Love
2002-03-11  0:38 ` Andreas Ferber [this message]
2002-03-15 22:06   ` Stephen Samuel
2002-03-16  0:43     ` Andreas Ferber
2002-03-16  4:24       ` Stephen Samuel

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=20020311013853.A1545@devcon.net \
    --to=aferber@techfak.uni-bielefeld.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    --cc=torvalds@transmeta.com \
    /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