[oe-commits] org.oe.dreambox linux-dm800: add missing patches

tmbinc commit openembedded-commits at lists.openembedded.org
Mon Mar 17 08:43:16 UTC 2008


linux-dm800: add missing patches

Author: tmbinc at openembedded.org
Branch: org.openembedded.dreambox
Revision: 49d9cb4472a9efd94501068a54a8396236df701d
ViewMTN: http://monotone.openembedded.org/revision/info/49d9cb4472a9efd94501068a54a8396236df701d
Files:
1
packages/linux/linux-dm800/linux-2.6.12-add-ioprio.patch
packages/linux/linux-dm800/linux-2.6.12-dream-misc.patch
packages/linux/linux-dm800/linux-2.6.12-fix-serial.patch
packages/linux/linux-dm800/linuxmips-2.6.12-fix-fadvise.patch
packages/linux/linux-dm800/linuxmips-2.6.12-fix-futex.patch
packages/linux/linux-dm800/linuxmips-2.6.12-gcc4-compile-fix.patch
packages/linux/linux-dm800/linuxmips-2.6.12-gdb-fix.patch
Diffs:

#
# mt diff -r4352b96e406854c75865311633836efeffbb3e0f -r49d9cb4472a9efd94501068a54a8396236df701d
#
#
#
# add_file "packages/linux/linux-dm800/linux-2.6.12-add-ioprio.patch"
#  content [93742dd930aec2e6199cd5291638dfde3faab673]
# 
# add_file "packages/linux/linux-dm800/linux-2.6.12-dream-misc.patch"
#  content [bfe3cf9692d2db5fd3651fdf6e8db4a5c13a55a3]
# 
# add_file "packages/linux/linux-dm800/linux-2.6.12-fix-serial.patch"
#  content [293bfd0bfb19fad0a53f11b2ce85d6a240e1d854]
# 
# add_file "packages/linux/linux-dm800/linuxmips-2.6.12-fix-fadvise.patch"
#  content [f6cebc94bcf5cce2c4e975bab28deaaa67b80d11]
# 
# add_file "packages/linux/linux-dm800/linuxmips-2.6.12-fix-futex.patch"
#  content [83f05990a95db2dd71dba6ba7027f6516dd43374]
# 
# add_file "packages/linux/linux-dm800/linuxmips-2.6.12-gcc4-compile-fix.patch"
#  content [657fbf4df57881078efc806bb500d5977a2067e7]
# 
# add_file "packages/linux/linux-dm800/linuxmips-2.6.12-gdb-fix.patch"
#  content [b0891bedd12acb377d632a14748b54e8b2545a9e]
#
============================================================
--- packages/linux/linux-dm800/linux-2.6.12-add-ioprio.patch	93742dd930aec2e6199cd5291638dfde3faab673
+++ packages/linux/linux-dm800/linux-2.6.12-add-ioprio.patch	93742dd930aec2e6199cd5291638dfde3faab673
@@ -0,0 +1,4148 @@
+diff -Naur 2.6.12-5.0-org/Documentation/block/ioprio.txt 2.6.12-5.0-patched/Documentation/block/ioprio.txt
+--- 2.6.12-5.0-org/Documentation/block/ioprio.txt	1970-01-01 01:00:00.000000000 +0100
++++ 2.6.12-5.0-patched/Documentation/block/ioprio.txt	2007-12-11 12:34:52.000000000 +0100
+@@ -0,0 +1,179 @@
++Block io priorities
++===================
++
++
++Intro
++-----
++
++With the introduction of cfq v3 (aka cfq-ts or time sliced cfq), basic io
++priorities is supported for reads on files. This enables users to io nice
++processes or process groups, similar to what has been possible to cpu
++scheduling for ages. This document mainly details the current possibilites
++with cfq, other io schedulers do not support io priorities so far.
++
++Scheduling classes
++------------------
++
++CFQ implements three generic scheduling classes that determine how io is
++served for a process.
++
++IOPRIO_CLASS_RT: This is the realtime io class. This scheduling class is given
++higher priority than any other in the system, processes from this class are
++given first access to the disk every time. Thus it needs to be used with some
++care, one io RT process can starve the entire system. Within the RT class,
++there are 8 levels of class data that determine exactly how much time this
++process needs the disk for on each service. In the future this might change
++to be more directly mappable to performance, by passing in a wanted data
++rate instead.
++
++IOPRIO_CLASS_BE: This is the best-effort scheduling class, which is the default
++for any process that hasn't set a specific io priority. The class data
++determines how much io bandwidth the process will get, it's directly mappable
++to the cpu nice levels just more coarsely implemented. 0 is the highest
++BE prio level, 7 is the lowest. The mapping between cpu nice level and io
++nice level is determined as: io_nice = (cpu_nice + 20) / 5.
++
++IOPRIO_CLASS_IDLE: This is the idle scheduling class, processes running at this
++level only get io time when no one else needs the disk. The idle class has no
++class data, since it doesn't really apply here.
++
++Tools
++-----
++
++See below for a sample ionice tool. Usage:
++
++# ionice -c<class> -n<level> -p<pid>
++
++If pid isn't given, the current process is assumed. IO priority settings
++are inherited on fork, so you can use ionice to start the process at a given
++level:
++
++# ionice -c2 -n0 /bin/ls
++
++will run ls at the best-effort scheduling class at the highest priority.
++For a running process, you can give the pid instead:
++
++# ionice -c1 -n2 -p100
++
++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
++#elif defined(__mips__)
++#define __NR_ioprio_set		4284
++#define __NR_ioprio_get		4285
++#else
++#error "Unsupported arch"
++#endif
++
++_syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
++_syscall2(int, ioprio_get, int, which, int, 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 <---
++
++
++March 11 2005, Jens Axboe <axboe at suse.de>
+diff -Naur 2.6.12-5.0-org/drivers/block/as-iosched.c 2.6.12-5.0-patched/drivers/block/as-iosched.c
+--- 2.6.12-5.0-org/drivers/block/as-iosched.c	2007-07-26 00:53:20.000000000 +0200
++++ 2.6.12-5.0-patched/drivers/block/as-iosched.c	2007-12-11 12:34:52.000000000 +0100
+@@ -1806,7 +1806,8 @@
+ 	rq->elevator_private = NULL;
+ }
+ 
+-static int as_set_request(request_queue_t *q, struct request *rq, int gfp_mask)
++static int as_set_request(request_queue_t *q, struct request *rq,
++			  struct bio *bio, int gfp_mask)
+ {
+ 	struct as_data *ad = q->elevator->elevator_data;
+ 	struct as_rq *arq = mempool_alloc(ad->arq_pool, gfp_mask);
+@@ -1827,7 +1828,7 @@
+ 	return 1;
+ }
+ 
+-static int as_may_queue(request_queue_t *q, int rw)
++static int as_may_queue(request_queue_t *q, int rw, struct bio *bio)
+ {
+ 	int ret = ELV_MQUEUE_MAY;
+ 	struct as_data *ad = q->elevator->elevator_data;
+diff -Naur 2.6.12-5.0-org/drivers/block/cfq-iosched.c 2.6.12-5.0-patched/drivers/block/cfq-iosched.c
+--- 2.6.12-5.0-org/drivers/block/cfq-iosched.c	2007-07-26 00:53:20.000000000 +0200
++++ 2.6.12-5.0-patched/drivers/block/cfq-iosched.c	2007-12-11 12:34:52.000000000 +0100
+@@ -21,22 +21,34 @@
+ #include <linux/hash.h>
+ #include <linux/rbtree.h>
+ #include <linux/mempool.h>
+-
+-static unsigned long max_elapsed_crq;
+-static unsigned long max_elapsed_dispatch;
++#include <linux/ioprio.h>
++#include <linux/writeback.h>
+ 
+ /*
+  * tunables
+  */
+ static int cfq_quantum = 4;		/* max queue in one round of service */
+ static int cfq_queued = 8;		/* minimum rq allocate limit per-queue*/
+-static int cfq_service = HZ;		/* period over which service is avg */
+-static int cfq_fifo_expire_r = HZ / 2;	/* fifo timeout for sync requests */
+-static int cfq_fifo_expire_w = 5 * HZ;	/* fifo timeout for async requests */
+-static int cfq_fifo_rate = HZ / 8;	/* fifo expiry rate */
++static int cfq_fifo_expire[2] = { HZ / 4, HZ / 8 };
+ static int cfq_back_max = 16 * 1024;	/* maximum backwards seek, in KiB */
+ static int cfq_back_penalty = 2;	/* penalty of a backwards seek */
+ 
++static int cfq_slice_sync = HZ / 10;
++static int cfq_slice_async = HZ / 25;
++static int cfq_slice_async_rq = 2;
++static int cfq_slice_idle = HZ / 100;
++
++#define CFQ_IDLE_GRACE		(HZ / 10)
++#define CFQ_SLICE_SCALE		(5)
++
++#define CFQ_KEY_ASYNC		(0)
++#define CFQ_KEY_ANY		(0xffff)
++
++/*
++ * disable queueing at the driver/hardware level
++ */
++static int cfq_max_depth = 2;
++
+ /*
+  * for the hash of cfqq inside the cfqd
+  */
+@@ -55,6 +67,7 @@
+ #define list_entry_hash(ptr)	hlist_entry((ptr), struct cfq_rq, hash)
+ 
+ #define list_entry_cfqq(ptr)	list_entry((ptr), struct cfq_queue, cfq_list)
++#define list_entry_fifo(ptr)	list_entry((ptr), struct request, queuelist)
+ 
+ #define RQ_DATA(rq)		(rq)->elevator_private
+ 
+@@ -75,78 +88,110 @@
+ #define rb_entry_crq(node)	rb_entry((node), struct cfq_rq, rb_node)
+ #define rq_rb_key(rq)		(rq)->sector
+ 
+-/*
+- * threshold for switching off non-tag accounting
+- */
+-#define CFQ_MAX_TAG		(4)
+-
+-/*
+- * sort key types and names
+- */
+-enum {
+-	CFQ_KEY_PGID,
+-	CFQ_KEY_TGID,
+-	CFQ_KEY_UID,
+-	CFQ_KEY_GID,
+-	CFQ_KEY_LAST,
+-};
+-
+-static char *cfq_key_types[] = { "pgid", "tgid", "uid", "gid", NULL };
+-
+ static kmem_cache_t *crq_pool;
+ static kmem_cache_t *cfq_pool;
+ static kmem_cache_t *cfq_ioc_pool;
+ 
++#define CFQ_PRIO_LISTS		IOPRIO_BE_NR
++#define cfq_class_idle(cfqq)	((cfqq)->ioprio_class == IOPRIO_CLASS_IDLE)
++#define cfq_class_be(cfqq)	((cfqq)->ioprio_class == IOPRIO_CLASS_BE)
++#define cfq_class_rt(cfqq)	((cfqq)->ioprio_class == IOPRIO_CLASS_RT)
++
++#define ASYNC			(0)
++#define SYNC			(1)
++
++#define cfq_cfqq_dispatched(cfqq)	\
++	((cfqq)->on_dispatch[ASYNC] + (cfqq)->on_dispatch[SYNC])
++
++#define cfq_cfqq_class_sync(cfqq)	((cfqq)->key != CFQ_KEY_ASYNC)
++
++#define cfq_cfqq_sync(cfqq)		\
++	(cfq_cfqq_class_sync(cfqq) || (cfqq)->on_dispatch[SYNC])
++
++/*
++ * Per block device queue structure
++ */
+ struct cfq_data {
+-	struct list_head rr_list;
++	atomic_t ref;
++	request_queue_t *queue;
++
++	/*
++	 * rr list of queues with requests and the count of them
++	 */
++	struct list_head rr_list[CFQ_PRIO_LISTS];
++	struct list_head busy_rr;
++	struct list_head cur_rr;
++	struct list_head idle_rr;
++	unsigned int busy_queues;
++
++	/*
++	 * non-ordered list of empty cfqq's
++	 */
+ 	struct list_head empty_list;
+ 
++	/*
++	 * cfqq lookup hash
++	 */
+ 	struct hlist_head *cfq_hash;
+-	struct hlist_head *crq_hash;
+ 
+-	/* queues on rr_list (ie they have pending requests */
+-	unsigned int busy_queues;
++	/*
++	 * global crq hash for all queues
++	 */
++	struct hlist_head *crq_hash;
+ 
+ 	unsigned int max_queued;
+ 
+-	atomic_t ref;
++	mempool_t *crq_pool;
+ 
+-	int key_type;
++	int rq_in_driver;
+ 
+-	mempool_t *crq_pool;
++	/*
++	 * schedule slice state info
++	 */
++	/*
++	 * idle window management
++	 */
++	struct timer_list idle_slice_timer;
++	struct work_struct unplug_work;
+ 
+-	request_queue_t *queue;
++	struct cfq_queue *active_queue;
++	struct cfq_io_context *active_cic;
++	int cur_prio, cur_end_prio;
++	unsigned int dispatch_slice;
++
++	struct timer_list idle_class_timer;
+ 
+ 	sector_t last_sector;
++	unsigned long last_end_request;
+ 
+-	int rq_in_driver;
++	unsigned int rq_starved;
+ 
+ 	/*
+ 	 * tunables, see top of file
+ 	 */
+ 	unsigned int cfq_quantum;
+ 	unsigned int cfq_queued;
+-	unsigned int cfq_fifo_expire_r;
+-	unsigned int cfq_fifo_expire_w;
+-	unsigned int cfq_fifo_batch_expire;
++	unsigned int cfq_fifo_expire[2];
+ 	unsigned int cfq_back_penalty;
+ 	unsigned int cfq_back_max;
+-	unsigned int find_best_crq;
+-
+-	unsigned int cfq_tagged;
++	unsigned int cfq_slice[2];
++	unsigned int cfq_slice_async_rq;
++	unsigned int cfq_slice_idle;
++	unsigned int cfq_max_depth;
+ };
+ 
++/*
++ * Per process-grouping structure
++ */
+ struct cfq_queue {
+ 	/* reference count */
+ 	atomic_t ref;
+ 	/* parent cfq_data */
+ 	struct cfq_data *cfqd;
+-	/* hash of mergeable requests */
++	/* cfqq lookup hash */
+ 	struct hlist_node cfq_hash;
+ 	/* hash key */
+-	unsigned long key;
+-	/* whether queue is on rr (or empty) list */
+-	int on_rr;
++	unsigned int key;
+ 	/* on either rr or empty list of cfqd */
+ 	struct list_head cfq_list;
+ 	/* sorted list of pending requests */
+@@ -158,21 +203,22 @@
+ 	/* currently allocated requests */
+ 	int allocated[2];
+ 	/* fifo list of requests in sort_list */
+-	struct list_head fifo[2];
+-	/* last time fifo expired */
+-	unsigned long last_fifo_expire;
++	struct list_head fifo;
+ 
+-	int key_type;
++	unsigned long slice_start;
++	unsigned long slice_end;
++	unsigned long slice_left;
++	unsigned long service_last;
++
++	/* number of requests that are on the dispatch list */
++	int on_dispatch[2];
++
++	/* io prio of this group */
++	unsigned short ioprio, org_ioprio;
++	unsigned short ioprio_class, org_ioprio_class;
+ 
+-	unsigned long service_start;
+-	unsigned long service_used;
+-
+-	unsigned int max_rate;
+-
+-	/* number of requests that have been handed to the driver */
+-	int in_flight;
+-	/* number of currently allocated requests */
+-	int alloc_limit[2];
++	/* various state flags, see below */
++	unsigned int flags;
+ };
+ 
+ struct cfq_rq {
+@@ -184,42 +230,78 @@
+ 	struct cfq_queue *cfq_queue;
+ 	struct cfq_io_context *io_context;
+ 
+-	unsigned long service_start;
+-	unsigned long queue_start;
++	unsigned int crq_flags;
++};
++
++enum cfqq_state_flags {
++	CFQ_CFQQ_FLAG_on_rr = 0,
++	CFQ_CFQQ_FLAG_wait_request,
++	CFQ_CFQQ_FLAG_must_alloc,
++	CFQ_CFQQ_FLAG_must_alloc_slice,
++	CFQ_CFQQ_FLAG_must_dispatch,
++	CFQ_CFQQ_FLAG_fifo_expire,
++	CFQ_CFQQ_FLAG_idle_window,
++	CFQ_CFQQ_FLAG_prio_changed,
++	CFQ_CFQQ_FLAG_expired,
++};
++
++#define CFQ_CFQQ_FNS(name)						\
++static inline void cfq_mark_cfqq_##name(struct cfq_queue *cfqq)		\
++{									\
++	cfqq->flags |= (1 << CFQ_CFQQ_FLAG_##name);			\
++}									\
++static inline void cfq_clear_cfqq_##name(struct cfq_queue *cfqq)	\
++{									\
++	cfqq->flags &= ~(1 << CFQ_CFQQ_FLAG_##name);			\
++}									\
++static inline int cfq_cfqq_##name(const struct cfq_queue *cfqq)		\
++{									\
++	return (cfqq->flags & (1 << CFQ_CFQQ_FLAG_##name)) != 0;	\
++}
+ 
+-	unsigned int in_flight : 1;
+-	unsigned int accounted : 1;
+-	unsigned int is_sync   : 1;
+-	unsigned int is_write  : 1;
++CFQ_CFQQ_FNS(on_rr);
++CFQ_CFQQ_FNS(wait_request);
++CFQ_CFQQ_FNS(must_alloc);
++CFQ_CFQQ_FNS(must_alloc_slice);
++CFQ_CFQQ_FNS(must_dispatch);
++CFQ_CFQQ_FNS(fifo_expire);
++CFQ_CFQQ_FNS(idle_window);
++CFQ_CFQQ_FNS(prio_changed);
++CFQ_CFQQ_FNS(expired);
++#undef CFQ_CFQQ_FNS
++
++enum cfq_rq_state_flags {
++	CFQ_CRQ_FLAG_in_flight = 0,
++	CFQ_CRQ_FLAG_in_driver,
++	CFQ_CRQ_FLAG_is_sync,
++	CFQ_CRQ_FLAG_requeued,
+ };
+ 
+-static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *, unsigned long);
++#define CFQ_CRQ_FNS(name)						\
++static inline void cfq_mark_crq_##name(struct cfq_rq *crq)		\
++{									\
++	crq->crq_flags |= (1 << CFQ_CRQ_FLAG_##name);			\
++}									\
++static inline void cfq_clear_crq_##name(struct cfq_rq *crq)		\
++{									\
++	crq->crq_flags &= ~(1 << CFQ_CRQ_FLAG_##name);			\
++}									\
++static inline int cfq_crq_##name(const struct cfq_rq *crq)		\
++{									\
++	return (crq->crq_flags & (1 << CFQ_CRQ_FLAG_##name)) != 0;	\
++}
++
++CFQ_CRQ_FNS(in_flight);
++CFQ_CRQ_FNS(in_driver);
++CFQ_CRQ_FNS(is_sync);
++CFQ_CRQ_FNS(requeued);
++#undef CFQ_CRQ_FNS
++
++static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *, unsigned int, unsigned short);
+ static void cfq_dispatch_sort(request_queue_t *, struct cfq_rq *);
+-static void cfq_update_next_crq(struct cfq_rq *);
+ static void cfq_put_cfqd(struct cfq_data *cfqd);
+ 
+-/*
+- * what the fairness is based on (ie how processes are grouped and
+- * differentiated)
+- */
+-static inline unsi%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list