aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c20
-rw-r--r--mm/ksm.c8
2 files changed, 5 insertions, 23 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index dafb06f70a09..d175917e2411 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -241,18 +241,6 @@ void delete_from_page_cache(struct page *page)
241} 241}
242EXPORT_SYMBOL(delete_from_page_cache); 242EXPORT_SYMBOL(delete_from_page_cache);
243 243
244static int sleep_on_page(void *word)
245{
246 io_schedule();
247 return 0;
248}
249
250static int sleep_on_page_killable(void *word)
251{
252 sleep_on_page(word);
253 return fatal_signal_pending(current) ? -EINTR : 0;
254}
255
256static int filemap_check_errors(struct address_space *mapping) 244static int filemap_check_errors(struct address_space *mapping)
257{ 245{
258 int ret = 0; 246 int ret = 0;
@@ -692,7 +680,7 @@ void wait_on_page_bit(struct page *page, int bit_nr)
692 DEFINE_WAIT_BIT(wait, &page->flags, bit_nr); 680 DEFINE_WAIT_BIT(wait, &page->flags, bit_nr);
693 681
694 if (test_bit(bit_nr, &page->flags)) 682 if (test_bit(bit_nr, &page->flags))
695 __wait_on_bit(page_waitqueue(page), &wait, sleep_on_page, 683 __wait_on_bit(page_waitqueue(page), &wait, bit_wait_io,
696 TASK_UNINTERRUPTIBLE); 684 TASK_UNINTERRUPTIBLE);
697} 685}
698EXPORT_SYMBOL(wait_on_page_bit); 686EXPORT_SYMBOL(wait_on_page_bit);
@@ -705,7 +693,7 @@ int wait_on_page_bit_killable(struct page *page, int bit_nr)
705 return 0; 693 return 0;
706 694
707 return __wait_on_bit(page_waitqueue(page), &wait, 695 return __wait_on_bit(page_waitqueue(page), &wait,
708 sleep_on_page_killable, TASK_KILLABLE); 696 bit_wait_io, TASK_KILLABLE);
709} 697}
710 698
711/** 699/**
@@ -806,7 +794,7 @@ void __lock_page(struct page *page)
806{ 794{
807 DEFINE_WAIT_BIT(wait, &page->flags, PG_locked); 795 DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
808 796
809 __wait_on_bit_lock(page_waitqueue(page), &wait, sleep_on_page, 797 __wait_on_bit_lock(page_waitqueue(page), &wait, bit_wait_io,
810 TASK_UNINTERRUPTIBLE); 798 TASK_UNINTERRUPTIBLE);
811} 799}
812EXPORT_SYMBOL(__lock_page); 800EXPORT_SYMBOL(__lock_page);
@@ -816,7 +804,7 @@ int __lock_page_killable(struct page *page)
816 DEFINE_WAIT_BIT(wait, &page->flags, PG_locked); 804 DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
817 805
818 return __wait_on_bit_lock(page_waitqueue(page), &wait, 806 return __wait_on_bit_lock(page_waitqueue(page), &wait,
819 sleep_on_page_killable, TASK_KILLABLE); 807 bit_wait_io, TASK_KILLABLE);
820} 808}
821EXPORT_SYMBOL_GPL(__lock_page_killable); 809EXPORT_SYMBOL_GPL(__lock_page_killable);
822 810
diff --git a/mm/ksm.c b/mm/ksm.c
index 346ddc9e4c0d..fb7590222706 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1978,18 +1978,12 @@ void ksm_migrate_page(struct page *newpage, struct page *oldpage)
1978#endif /* CONFIG_MIGRATION */ 1978#endif /* CONFIG_MIGRATION */
1979 1979
1980#ifdef CONFIG_MEMORY_HOTREMOVE 1980#ifdef CONFIG_MEMORY_HOTREMOVE
1981static int just_wait(void *word)
1982{
1983 schedule();
1984 return 0;
1985}
1986
1987static void wait_while_offlining(void) 1981static void wait_while_offlining(void)
1988{ 1982{
1989 while (ksm_run & KSM_RUN_OFFLINE) { 1983 while (ksm_run & KSM_RUN_OFFLINE) {
1990 mutex_unlock(&ksm_thread_mutex); 1984 mutex_unlock(&ksm_thread_mutex);
1991 wait_on_bit(&ksm_run, ilog2(KSM_RUN_OFFLINE), 1985 wait_on_bit(&ksm_run, ilog2(KSM_RUN_OFFLINE),
1992 just_wait, TASK_UNINTERRUPTIBLE); 1986 TASK_UNINTERRUPTIBLE);
1993 mutex_lock(&ksm_thread_mutex); 1987 mutex_lock(&ksm_thread_mutex);
1994 } 1988 }
1995} 1989}