public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Jens Axboe <axboe@suse.de>, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: ionice kills vanilla 2.6.0-test9 was [Re: [PATCH] cfq + io priorities (fwd)]
Date: Fri, 21 Nov 2003 16:39:00 +0100	[thread overview]
Message-ID: <20031121153900.GA193@elf.ucw.cz> (raw)
In-Reply-To: <20031113124510.GZ643@openzaurus.ucw.cz>

Hi!

> > I'm attaching the simple ionice tool. It's used as follows:
> 
> Here's one that works, sorry about that. To compile:
> 
> # gcc -Wall -D__X86 -o ionice ionice.c
> 
> or other define for PPC or X86_64.

Well, did that, run it on vanilla kernel, and it kills the
machine. Can someone reproduce it?
							Pavel
[What is needed to start using cfq? Is your patch, this utility and
elevator=cfq enough?]

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <getopt.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <asm/unistd.h>

extern int sys_ioprio_set(int);
extern int sys_ioprio_get(void);

#ifdef __X86
#define __NR_ioprio_set		274
#define __NR_ioprio_get		275
#endif

#ifdef __X86_64
#define __NR_ioprio_set		237
#define __NR_ioprio_get		238
#endif

#ifdef __PPC
#define __NR_ioprio_set		255
#define __NR_ioprio_get		256
#endif

#ifndef __NR_ioprio_set
#error set arch
#endif

_syscall1(int, ioprio_set, int, ioprio);
_syscall0(int, ioprio_get);

int main(int argc, char *argv[])
{
	int ioprio = 2, set = 0;
	int c;

	while ((c = getopt(argc, argv, "+n:")) != EOF) {
		switch (c) {
		case 'n':
			ioprio = strtol(optarg, NULL, 10);
			set = 1;
			break;
		}
	}

	if (!set)
		printf("%d\n", ioprio_get());
	else if (argv[optind]) {
		if (ioprio_set(ioprio) == -1) {
			perror("ioprio_set");
			return 1;
		}

		execvp(argv[optind], &argv[optind]);
	}
	return 0;
}


----- End forwarded message -----

-- 
				Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...



-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

       reply	other threads:[~2003-11-21 19:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031113124510.GZ643@openzaurus.ucw.cz>
2003-11-21 15:39 ` Pavel Machek [this message]
2003-11-21 20:14   ` ionice kills vanilla 2.6.0-test9 was [Re: [PATCH] cfq + io priorities (fwd)] Jens Axboe
2003-11-24  3:44     ` Benjamin Herrenschmidt
2003-11-21 22:45   ` Linus Torvalds
2003-11-21 23:05     ` Linus Torvalds
2003-11-21 23:33       ` Linus Torvalds
2003-11-22 11:04         ` Jamie Lokier
2003-11-22  4:42       ` Alan Modra
2003-11-26 20:06       ` Nick Clifton
2003-11-26 20:23         ` Jakub Jelinek

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=20031121153900.GA193@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=axboe@suse.de \
    --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