linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Joe Korty <joe.korty@ccur.com>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org, rml@tech9.net
Subject: Re: [PATCH] protect migration/%d etc from sched_setaffinity
Date: Thu, 31 Jul 2003 16:17:03 -0700	[thread overview]
Message-ID: <20030731161703.210470ea.akpm@osdl.org> (raw)
In-Reply-To: <20030731231154.GB7852@rudolph.ccur.com>

Joe Korty <joe.korty@ccur.com> wrote:
>
> I'd like to be able to write shell scrips that operate on the set of
> /proc/[0-9]* without having to know which of the ever-changing list
> of processes need to be avoided and which not.

Like this?

#!/bin/sh

#
# can_set_affinity pid
#
can_set_affinity()
{
	if [ "$(cat /proc/$1/maps)" != "" ]
	then
		return 0
	fi
	if head -1 /proc/$1/status | egrep "events|migration"
	then
		return 1
	else
		return 0
	fi
}

if can_set_affinity $1
then
	echo can set affinity of pid $1
else
	echo cannot set affinity of pid $1
fi



  reply	other threads:[~2003-07-31 23:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-31 22:46 [PATCH] protect migration/%d etc from sched_setaffinity Joe Korty
2003-07-31 22:47 ` Andrew Morton
2003-07-31 23:11   ` Joe Korty
2003-07-31 23:17     ` Andrew Morton [this message]
2003-07-31 23:41       ` Robert Love
2003-08-01  0:01       ` Joe Korty
2003-07-31 23:02 ` Robert Love
2003-07-31 23:06   ` Joe Korty
2003-07-31 23:18     ` Robert Love
2003-07-31 23:16       ` Joe Korty
2003-07-31 23:27         ` Robert Love
2003-07-31 23:26           ` Joe Korty
2003-07-31 23:18       ` [OT] " J.A. Magallon
2003-07-31 23:37         ` Robert Love
2003-08-01 11:09           ` Eric W. Biederman
2003-08-01 16:15             ` Jamie Lokier
2003-08-01 17:31               ` Eric W. Biederman
2003-08-01 17:55                 ` Jamie Lokier
2003-08-01 18:39                   ` Sean Estabrooks
2003-08-01 17:37             ` Robert Love
     [not found] <20030731224604.GA24887@tsunami.ccur.com.suse.lists.linux.kernel>
2003-07-31 23:17 ` Andi Kleen
2003-07-31 23:30   ` Joe Korty
2003-08-01 10:26 Mikael Pettersson

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=20030731161703.210470ea.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=joe.korty@ccur.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    --cc=torvalds@osdl.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;
as well as URLs for NNTP newsgroup(s).