Re: [PATCH] docs: block: update ioprio.txt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi Sami,

[You forgot to CC'd other developers and mailing list]

On Tue, Jun 19, 2012 at 10:54:41AM +0200, Sami Kerola wrote:
> Hi Zheng,
> 
> Wouldn't a patch such as below be better?

Looks good to me.  But, IMHO, if reader cannot access Internet, my patch
maybe is better for them.  The original writer is not me.  So I don't
understand the original idea that puts ionice source code in here.  I
think that Jens can do the final decision.

Hi Jens,

What's your opintion about Sami's and my patch?

Regards,
Zheng

> 
> From 800d7d46f8c1945d9c2e43912376c9b7d00a15ba Mon Sep 17 00:00:00 2001
> From: Sami Kerola <kerolasa@xxxxxx>
> Date: Tue, 19 Jun 2012 10:52:06 +0200
> Subject: [PATCH] docs: block: update ioprio.txt
> 
> Inform the ionice.c in ioprio.txt document is moved to util-linux
> package.
> 
> CC: Jens Axboe <axboe@xxxxxxxxx>
> CC: Rob Landley <rob@xxxxxxxxxxx>
> CC: Bernhard Voelker <mail@xxxxxxxxxxxxxxxxxxx>
> CC: Zheng Liu <wenqing.lz@xxxxxxxxxx>
> Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
> ---
>  Documentation/block/ioprio.txt |  126 ++--------------------------------------
>  1 file changed, 5 insertions(+), 121 deletions(-)
> 
> diff --git a/Documentation/block/ioprio.txt b/Documentation/block/ioprio.txt
> index 8ed8c59..9ccd3f0 100644
> --- a/Documentation/block/ioprio.txt
> +++ b/Documentation/block/ioprio.txt
> @@ -57,127 +57,11 @@ For a running process, you can give the pid instead:
> 
>  will change pid 100 to run at the realtime scheduling class, at priority 2.
> 
> ----> snip ionice.c tool <---
> -
> -#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, int, int);
> -extern int sys_ioprio_get(int, int);
> -
> -#if defined(__i386__)
> -#define __NR_ioprio_set		289
> -#define __NR_ioprio_get		290
> -#elif defined(__ppc__)
> -#define __NR_ioprio_set		273
> -#define __NR_ioprio_get		274
> -#elif defined(__x86_64__)
> -#define __NR_ioprio_set		251
> -#define __NR_ioprio_get		252
> -#elif defined(__ia64__)
> -#define __NR_ioprio_set		1274
> -#define __NR_ioprio_get		1275
> -#else
> -#error "Unsupported arch"
> -#endif
> -
> -static inline int ioprio_set(int which, int who, int ioprio)
> -{
> -	return syscall(__NR_ioprio_set, which, who, ioprio);
> -}
> -
> -static inline int ioprio_get(int which, int who)
> -{
> -	return syscall(__NR_ioprio_get, which, who);
> -}
> -
> -enum {
> -	IOPRIO_CLASS_NONE,
> -	IOPRIO_CLASS_RT,
> -	IOPRIO_CLASS_BE,
> -	IOPRIO_CLASS_IDLE,
> -};
> -
> -enum {
> -	IOPRIO_WHO_PROCESS = 1,
> -	IOPRIO_WHO_PGRP,
> -	IOPRIO_WHO_USER,
> -};
> -
> -#define IOPRIO_CLASS_SHIFT	13
> -
> -const char *to_prio[] = { "none", "realtime", "best-effort", "idle", };
> -
> -int main(int argc, char *argv[])
> -{
> -	int ioprio = 4, set = 0, ioprio_class = IOPRIO_CLASS_BE;
> -	int c, pid = 0;
> -
> -	while ((c = getopt(argc, argv, "+n:c:p:")) != EOF) {
> -		switch (c) {
> -		case 'n':
> -			ioprio = strtol(optarg, NULL, 10);
> -			set = 1;
> -			break;
> -		case 'c':
> -			ioprio_class = strtol(optarg, NULL, 10);
> -			set = 1;
> -			break;
> -		case 'p':
> -			pid = strtol(optarg, NULL, 10);
> -			break;
> -		}
> -	}
> -
> -	switch (ioprio_class) {
> -		case IOPRIO_CLASS_NONE:
> -			ioprio_class = IOPRIO_CLASS_BE;
> -			break;
> -		case IOPRIO_CLASS_RT:
> -		case IOPRIO_CLASS_BE:
> -			break;
> -		case IOPRIO_CLASS_IDLE:
> -			ioprio = 7;
> -			break;
> -		default:
> -			printf("bad prio class %d\n", ioprio_class);
> -			return 1;
> -	}
> -
> -	if (!set) {
> -		if (!pid && argv[optind])
> -			pid = strtol(argv[optind], NULL, 10);
> -
> -		ioprio = ioprio_get(IOPRIO_WHO_PROCESS, pid);
> -
> -		printf("pid=%d, %d\n", pid, ioprio);
> -
> -		if (ioprio == -1)
> -			perror("ioprio_get");
> -		else {
> -			ioprio_class = ioprio >> IOPRIO_CLASS_SHIFT;
> -			ioprio = ioprio & 0xff;
> -			printf("%s: prio %d\n", to_prio[ioprio_class], ioprio);
> -		}
> -	} else {
> -		if (ioprio_set(IOPRIO_WHO_PROCESS, pid, ioprio | ioprio_class <<
> IOPRIO_CLASS_SHIFT) == -1) {
> -			perror("ioprio_set");
> -			return 1;
> -		}
> -
> -		if (argv[optind])
> -			execvp(argv[optind], &argv[optind]);
> -	}
> -
> -	return 0;
> -}
> -
> ----> snip ionice.c tool <---
> +Tool source code
> +----------------
> 
> +Moved to util-linux package schedutils/ionice.c
> +
> +http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=blob;f=schedutils/ionice.c
> 
>  March 11 2005, Jens Axboe <jens.axboe@xxxxxxxxxx>
> -- 
> 1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[Other Archives]     [Linux Kernel Newbies]     [Linux Driver Development]     [Linux Kbuild]     [Fedora Kernel]     [Linux Kernel Testers]     [Linux SH]     [Linux Omap]     [Linux Tape]     [Linux Input]     [Linux Kernel Janitors]     [Linux Kernel Packagers]     [Linux Doc]     [Linux Man Pages]     [Linux API]     [Linux Memory Management]     [Linux Modules]     [Linux Standards]     [Kernel Announce]     [Netdev]     [Git]     [Linux PCI]     Linux CAN Development     [Linux I2C]     [Linux RDMA]     [Linux NUMA]     [Netfilter]     [Netfilter Devel]     [SELinux]     [Bugtraq]     [FIO]     [Linux Perf Users]     [Linux Serial]     [Linux PPP]     [Linux ISDN]     [Linux Next]     [Kernel Stable Commits]     [Linux Tip Commits]     [Kernel MM Commits]     [Linux Security Module]     [AutoFS]     [Filesystem Development]     [Ext3 Filesystem]     [Linux bcache]     [Ext4 Filesystem]     [Linux BTRFS]     [Linux CEPH Filesystem]     [Linux XFS]     [XFS]     [Linux NFS]     [Linux CIFS]     [Ecryptfs]     [Linux NILFS]     [Linux Cachefs]     [Reiser FS]     [Initramfs]     [Linux FB Devel]     [Linux OpenGL]     [DRI Devel]     [Fastboot]     [Linux RT Users]     [Linux RT Stable]     [eCos]     [Corosync]     [Linux Clusters]     [LVS Devel]     [Hot Plug]     [Linux Virtualization]     [KVM]     [KVM PPC]     [KVM ia64]     [Linux Containers]     [Linux Hexagon]     [Linux Cgroups]     [Util Linux]     [Wireless]     [Linux Bluetooth]     [Bluez Devel]     [Ethernet Bridging]     [Embedded Linux]     [Barebox]     [Linux MMC]     [Linux IIO]     [Sparse]     [Smatch]     [Linux Arch]     [x86 Platform Driver]     [Linux ACPI]     [Linux IBM ACPI]     [LM Sensors]     [CPU Freq]     [Linux Power Management]     [Linmodems]     [Linux DCCP]     [Linux SCTP]     [ALSA Devel]     [Linux USB]     [Linux PA RISC]     [Linux Samsung SOC]     [MIPS Linux]     [IBM S/390 Linux]     [ARM Linux]     [ARM Kernel]     [ARM MSM]     [Tegra Devel]     [Sparc Linux]     [Linux Security]     [Linux Sound]     [Linux Media]     [Video 4 Linux]     [Linux IRDA Users]     [Linux for the blind]     [Linux RAID]     [Linux ATA RAID]     [Device Mapper]     [Linux SCSI]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Linux IDE]     [Linux SMP]     [Linux AXP]     [Linux Alpha]     [Linux M68K]     [Linux ia64]     [Linux 8086]     [Linux x86_64]     [Linux Config]     [Linux Apps]     [Linux MSDOS]     [Linux X.25]     [Linux Crypto]     [DM Crypt]     [Linux Trace Users]     [Linux Btrace]     [Linux Watchdog]     [Utrace Devel]     [Linux C Programming]     [Linux Assembly]     [Dash]     [DWARVES]     [Hail Devel]     [Linux Kernel Debugger]     [Linux gcc]     [Gcc Help]     [X.Org]     [Wine]

Add to Google Powered by Linux

[Older Kernel Discussion]     [Yosemite National Park Forum]     [Large Format Photos]     [Gimp]     [Yosemite Photos]     [Stuff]