public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cfq + io priorities
Date: Sat, 8 Nov 2003 14:25:39 +0100	[thread overview]
Message-ID: <20031108132539.GU14728@suse.de> (raw)
In-Reply-To: <20031108124758.GQ14728@suse.de>

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

On Sat, Nov 08 2003, Jens Axboe wrote:
> 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.

-- 
Jens Axboe


[-- Attachment #2: ionice.c --]
[-- Type: text/plain, Size: 987 bytes --]

#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;
}

  reply	other threads:[~2003-11-08 13:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-08 12:47 [PATCH] cfq + io priorities Jens Axboe
2003-11-08 13:25 ` Jens Axboe [this message]
2003-11-08 14:06   ` Jens Axboe
2003-11-09 21:30 ` Shailabh Nagar
2003-11-09 21:34   ` Jens Axboe
2003-11-09 23:52     ` [ckrm-tech] " Shailabh Nagar
  -- strict thread matches above, loose matches on Subject: below --
2003-11-09 10:57 Guillaume Chazarain
2003-11-09 11:39 ` Jens Axboe
2003-11-13 12:54   ` Pavel Machek
2003-11-16 22:56     ` Jakob Oestergaard
2003-11-17  8:14     ` Jens Axboe
2003-11-18 13:26       ` Pavel Machek
2003-11-18 13:32         ` Jens Axboe
2003-11-18 13:38           ` Pavel Machek
2003-11-10  1:49 Albert Cahalan
2003-11-10 10:19 ` Herbert Xu
2003-11-10 13:07   ` Albert Cahalan
2003-11-10 13:31     ` P
2003-11-10 13:37       ` Jens Axboe
2003-11-10 13:57         ` P
2003-11-10 23:52         ` Albert Cahalan
2003-11-18  9:27           ` Pavel Machek
2003-11-11 17:46     ` Toon van der Pas

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=20031108132539.GU14728@suse.de \
    --to=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