Patch from Robert Love There are a couple uses of 'p->state=foo' in mm/ which are open coded. This patch converts them to the proper [__]set_current_state() function. At least one of them (the one mm/highmem.c usage) is potentially unsafe on out-of-order store processors. This patch fixes it up. mm/highmem.c | 2 +- mm/memory.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff -puN mm/highmem.c~set_current_state-mm mm/highmem.c --- 25/mm/highmem.c~set_current_state-mm 2003-03-11 00:30:30.000000000 -0800 +++ 25-akpm/mm/highmem.c 2003-03-11 00:30:30.000000000 -0800 @@ -120,7 +120,7 @@ start: { DECLARE_WAITQUEUE(wait, current); - current->state = TASK_UNINTERRUPTIBLE; + __set_current_state(TASK_UNINTERRUPTIBLE); add_wait_queue(&pkmap_map_wait, &wait); spin_unlock(&kmap_lock); schedule(); diff -puN mm/memory.c~set_current_state-mm mm/memory.c --- 25/mm/memory.c~set_current_state-mm 2003-03-11 00:30:30.000000000 -0800 +++ 25-akpm/mm/memory.c 2003-03-11 00:30:30.000000000 -0800 @@ -1517,7 +1517,7 @@ int handle_mm_fault(struct mm_struct *mm pgd_t *pgd; pmd_t *pmd; - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); pgd = pgd_offset(mm, address); inc_page_state(pgfault); _