summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2002-09-25 07:28:05 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-25 07:28:05 -0700
commit2ce067b09aff22fcfe57e805e5abf409d4547dd1 (patch)
treec73baa99b8cedcccfc6f2cd14a006f94160175e3 /include
parent56d8b39d50e64ca5f9e20cfcd79870dd4109974f (diff)
parent4ab1a3e6a2904f6265c20ad0b1144092bbd2529a (diff)
Merge bk://ldm.bkbits.net/linux-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/io.h1
-rw-r--r--include/asm-i386/semaphore.h4
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/elevator.h8
-rw-r--r--include/linux/kernel.h7
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/pagemap.h8
-rw-r--r--include/linux/rwsem.h2
-rw-r--r--include/linux/sched.h5
-rw-r--r--include/linux/wait.h26
10 files changed, 52 insertions, 12 deletions
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index b2afa09c062f..41bc8ef0bdf8 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -40,7 +40,6 @@
#define XQUAD_PORTIO_BASE 0xfe400000
#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
-#define XQUAD_PORTIO_LEN 0x80000 /* Only remapping first 2 quads */
#ifdef __KERNEL__
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h
index a0ce1b8dba69..9c456727e8a3 100644
--- a/include/asm-i386/semaphore.h
+++ b/include/asm-i386/semaphore.h
@@ -116,7 +116,7 @@ static inline void down(struct semaphore * sem)
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
-
+ might_sleep();
__asm__ __volatile__(
"# atomic down operation\n\t"
LOCK "decl %0\n\t" /* --sem->count */
@@ -142,7 +142,7 @@ static inline int down_interruptible(struct semaphore * sem)
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
-
+ might_sleep();
__asm__ __volatile__(
"# atomic interruptible down operation\n\t"
LOCK "decl %1\n\t" /* --sem->count */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index f99a03f17e60..a64a657545fe 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -186,7 +186,7 @@ extern int shrink_dcache_memory(int, unsigned int);
extern void prune_dcache(int);
/* icache memory management (defined in linux/fs/inode.c) */
-extern int shrink_icache_memory(int, int);
+extern int shrink_icache_memory(int, unsigned int);
extern void prune_icache(int);
/* quota cache memory management (defined in linux/fs/dquot.c) */
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index e98168f92e67..c5cc69788530 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -52,12 +52,10 @@ extern inline struct list_head *elv_get_sort_head(request_queue_t *, struct requ
extern elevator_t elevator_noop;
/*
- * elevator linus. based on linus ideas of starvation control, using
- * sequencing to manage inserts and merges.
+ * deadline i/o scheduler. uses request time outs to prevent indefinite
+ * starvation
*/
-extern elevator_t elevator_linus;
-#define elv_linus_sequence(rq) ((long)(rq)->elevator_private)
-#define ELV_LINUS_SEEK_COST 16
+extern elevator_t iosched_deadline;
/*
* use the /proc/iosched interface, all the below is history ->
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 5efa540d55f8..44c38b134498 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -40,6 +40,13 @@
struct completion;
+#ifdef CONFIG_DEBUG_KERNEL
+void __might_sleep(char *file, int line);
+#define might_sleep() __might_sleep(__FILE__, __LINE__)
+#else
+#define might_sleep() do {} while(0)
+#endif
+
extern struct notifier_block *panic_notifier_list;
NORET_TYPE void panic(const char * fmt, ...)
__attribute__ ((NORET_AND format (printf, 1, 2)));
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c63e4947387f..482db998aca7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -524,6 +524,7 @@ extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned lon
extern struct page * vmalloc_to_page(void *addr);
extern unsigned long get_page_cache_size(void);
+extern unsigned int nr_used_zone_pages(void);
#endif /* __KERNEL__ */
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 43390b2e2ef4..bfc986131fe6 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -74,9 +74,15 @@ static inline void ___add_to_page_cache(struct page *page,
inc_page_state(nr_pagecache);
}
-extern void FASTCALL(lock_page(struct page *page));
+extern void FASTCALL(__lock_page(struct page *page));
extern void FASTCALL(unlock_page(struct page *page));
+static inline void lock_page(struct page *page)
+{
+ if (TestSetPageLocked(page))
+ __lock_page(page);
+}
+
/*
* This is exported only for wait_on_page_locked/wait_on_page_writeback.
* Never use this directly!
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 4a7e2bb0d7c4..bfb988885002 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -40,6 +40,7 @@ extern void FASTCALL(rwsemtrace(struct rw_semaphore *sem, const char *str));
*/
static inline void down_read(struct rw_semaphore *sem)
{
+ might_sleep();
rwsemtrace(sem,"Entering down_read");
__down_read(sem);
rwsemtrace(sem,"Leaving down_read");
@@ -62,6 +63,7 @@ static inline int down_read_trylock(struct rw_semaphore *sem)
*/
static inline void down_write(struct rw_semaphore *sem)
{
+ might_sleep();
rwsemtrace(sem,"Entering down_write");
__down_write(sem);
rwsemtrace(sem,"Leaving down_write");
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f1346010d73e..471dcb9c108d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -100,8 +100,9 @@ extern unsigned long nr_uninterruptible(void);
#define TASK_RUNNING 0
#define TASK_INTERRUPTIBLE 1
#define TASK_UNINTERRUPTIBLE 2
-#define TASK_ZOMBIE 4
-#define TASK_STOPPED 8
+#define TASK_STOPPED 4
+#define TASK_ZOMBIE 8
+#define TASK_DEAD 16
#define __set_task_state(tsk, state_value) \
do { (tsk)->state = (state_value); } while (0)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 8664b02f230d..b6ce459f8792 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -119,6 +119,32 @@ static inline void __remove_wait_queue(wait_queue_head_t *head,
_raced; \
})
+/*
+ * Waitqueue's which are removed from the waitqueue_head at wakeup time
+ */
+void FASTCALL(prepare_to_wait(wait_queue_head_t *q,
+ wait_queue_t *wait, int state));
+void FASTCALL(prepare_to_wait_exclusive(wait_queue_head_t *q,
+ wait_queue_t *wait, int state));
+void FASTCALL(finish_wait(wait_queue_head_t *q, wait_queue_t *wait));
+int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync);
+
+#define DEFINE_WAIT(name) \
+ wait_queue_t name = { \
+ .task = current, \
+ .func = autoremove_wake_function, \
+ .task_list = { .next = &name.task_list, \
+ .prev = &name.task_list, \
+ }, \
+ }
+
+#define init_wait(wait) \
+ do { \
+ wait->task = current; \
+ wait->func = autoremove_wake_function; \
+ INIT_LIST_HEAD(&wait->task_list); \
+ } while (0)
+
#endif /* __KERNEL__ */
#endif