diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dcache.h | 2 | ||||
| -rw-r--r-- | include/linux/elevator.h | 8 | ||||
| -rw-r--r-- | include/linux/kernel.h | 7 | ||||
| -rw-r--r-- | include/linux/mm.h | 1 | ||||
| -rw-r--r-- | include/linux/pagemap.h | 8 | ||||
| -rw-r--r-- | include/linux/rwsem.h | 2 | ||||
| -rw-r--r-- | include/linux/sched.h | 5 | ||||
| -rw-r--r-- | include/linux/wait.h | 26 |
8 files changed, 50 insertions, 9 deletions
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 |
