From: Chris Wright <chrisw@osdl.org>
To: "Andrew A." <aathan-linux-kernel-1542@cloakmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
roland@topspin.com, Andrew Morton <akpm@osdl.org>
Subject: Re: Consistent lock up 2.6.10-rc1-bk7 (mutex/SCHED_RR bug?)
Date: Fri, 29 Oct 2004 10:06:46 -0700 [thread overview]
Message-ID: <20041029100646.F14339@build.pdx.osdl.net> (raw)
In-Reply-To: <OMEGLKPBDPDHAGCIBHHJGEMIFCAA.aathan-linux-kernel-1542@cloakmail.com>; from aathan-linux-kernel-1542@cloakmail.com on Fri, Oct 29, 2004 at 12:43:11PM -0400
* Andrew A. (aathan-linux-kernel-1542@cloakmail.com) wrote:
> I suspect what is happening here is that my process is essentially in a
>
> while(1)
> {
> lock();
> unlock();
> }
>
> loop from two or mode SCHED_RR threads running at nice -15. They seem to be unkillable.
Give yourself a shell that's SCHED_RR with a higher priority. I've used
the small hack below to debug userspace SCHED_RR problems (newer distros
have a chrt utility to do this).
thanks,
-chris
--
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sched.h>
#include <string.h>
#include <errno.h>
main(int argc, char *argv[])
{
pid_t pid = 0;
int priority = 99;
int policy = SCHED_RR;
struct sched_param sched;
if (argc > 1) {
pid = atoi(argv[1]);
if (argc > 2) {
priority = atoi(argv[2]);
if (argc > 3)
policy = atoi(argv[3]);
}
}
memset(&sched, 0, sizeof(sched));
sched.sched_priority = priority;
if (sched_setscheduler(pid, policy, &sched) < 0) {
printf("setscheduler: %s\n", strerror(errno));
exit(1);
}
if (!pid) { /* turn this into a shell */
argv[0] = "/bin/bash";
argv[1] = NULL;
execv(argv[0], argv);
}
}
next prev parent reply other threads:[~2004-10-29 17:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <OMEGLKPBDPDHAGCIBHHJMEIDFCAA.aathan-linux-kernel-1542@cloakmail.com>
2004-10-29 14:26 ` Consistent lock up 2.6.10-rc1-bk7 (mutex/SCHED_RR bug?) Andrew
2004-10-29 15:07 ` Alan Cox
2004-10-29 16:43 ` Andrew A.
2004-10-29 17:06 ` Chris Wright [this message]
2004-10-29 17:44 ` Andrew A.
2004-10-29 20:32 ` Chris Wright
2004-10-29 15:36 ` Andrew A.
2004-10-29 15:52 ` Andrew A.
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=20041029100646.F14339@build.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=aathan-linux-kernel-1542@cloakmail.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@topspin.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