Commit ef29bf03 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Rename PF_IOTHREAD to PF_NOFREEZE

From: Nigel Cunningham <ncunningham@users.sourceforge.net>

A few weeks ago, Pavel and I agreed that PF_IOTHREAD should be renamed to
PF_NOFREEZE.  This reflects the fact that some threads so marked aren't
actually used for IO while suspending, but simply shouldn't be frozen.
This patch, against 2.6.5 vanilla, applies that change.  In the
refrigerator calls, the actual value doesn't matter (so long as it's
non-zero) and it makes more sense to use PF_FREEZE so I've used that.
parent 8488dd95
......@@ -1701,7 +1701,7 @@ static int apm(void *unused)
daemonize("kapmd");
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
#ifdef CONFIG_SMP
/* 2002/08/01 - WT
......
......@@ -483,7 +483,7 @@ static int loop_thread(void *data)
* hence, it mustn't be stopped at all
* because it could be indirectly used during suspension
*/
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
set_user_nice(current, -20);
......
......@@ -154,7 +154,7 @@ static int serio_thread(void *nothing)
serio_handle_events();
wait_event_interruptible(serio_wait, !list_empty(&serio_event_list));
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
} while (!signal_pending(current));
printk(KERN_DEBUG "serio: kseriod exiting\n");
......
......@@ -2712,7 +2712,7 @@ int md_thread(void * arg)
wait_event_interruptible(thread->wqueue,
test_bit(THREAD_WAKEUP, &thread->flags));
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
clear_bit(THREAD_WAKEUP, &thread->flags);
......
......@@ -1619,7 +1619,7 @@ static int rtl8139_thread (void *data)
timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout);
/* make swsusp happy with our thread */
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
} while (!signal_pending (current) && (timeout > 0));
if (signal_pending (current)) {
......
......@@ -137,7 +137,7 @@ static int irda_thread(void *startup)
/* make swsusp happy with our thread */
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
run_irda_queue();
}
......
......@@ -774,7 +774,7 @@ static int stir_transmit_thread(void *arg)
write_reg(stir, REG_CTRL1, CTRL1_TXPWD|CTRL1_RXPWD);
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
if (change_speed(stir, stir->speed))
break;
......
......@@ -2883,7 +2883,7 @@ static int airo_thread(void *data) {
/* make swsusp happy with our thread */
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
if (test_bit(JOB_DIE, &ai->flags))
break;
......
......@@ -720,7 +720,7 @@ static int pccardd(void *__skt)
schedule();
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
if (!skt->thread)
break;
......
......@@ -2759,7 +2759,7 @@ static int ata_thread (void *data)
flush_signals(current);
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
if ((timeout < 0) || (ap->time_to_die))
......
......@@ -1628,7 +1628,7 @@ int scsi_error_handler(void *data)
daemonize("scsi_eh_%d", shost->host_no);
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
shost->eh_wait = &sem;
shost->ehandler = current;
......
......@@ -1259,7 +1259,7 @@ static int hub_thread(void *__hub)
hub_events();
wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
} while (!signal_pending(current));
pr_debug ("%s: khubd exiting\n", usbcore_name);
......
......@@ -277,7 +277,7 @@ static int usb_stor_control_thread(void * __us)
*/
daemonize("usb-storage");
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
unlock_kernel();
......
......@@ -172,7 +172,7 @@ int kjournald(void *arg)
*/
jbd_debug(1, "Now suspending kjournald\n");
spin_unlock(&journal->j_state_lock);
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
spin_lock(&journal->j_state_lock);
} else {
/*
......
......@@ -2328,7 +2328,7 @@ int jfsIOWait(void *arg)
}
if (current->flags & PF_FREEZE) {
spin_unlock_irq(&log_redrive_lock);
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
} else {
add_wait_queue(&jfs_IO_thread_wait, &wq);
set_current_state(TASK_INTERRUPTIBLE);
......
......@@ -2813,7 +2813,7 @@ int jfs_lazycommit(void *arg)
if (current->flags & PF_FREEZE) {
LAZY_UNLOCK(flags);
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
} else {
DECLARE_WAITQUEUE(wq, current);
......@@ -3024,7 +3024,7 @@ int jfs_sync(void *arg)
if (current->flags & PF_FREEZE) {
TXN_UNLOCK();
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
} else {
DECLARE_WAITQUEUE(wq, current);
......
......@@ -1632,7 +1632,7 @@ pagebuf_daemon(
do {
/* swsusp */
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(xfs_flush_interval);
......
......@@ -464,7 +464,7 @@ syncd(void *arg)
schedule_timeout(xfs_syncd_interval);
/* swsusp */
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
if (vfsp->vfs_flag & VFS_UMOUNT)
break;
if (vfsp->vfs_flag & VFS_RDONLY)
......
......@@ -532,7 +532,7 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
#define PF_FLUSHER 0x00002000 /* responsible for disk writeback */
#define PF_FREEZE 0x00004000 /* this task should be frozen for suspend */
#define PF_IOTHREAD 0x00008000 /* this thread is needed for doing I/O to swap */
#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
#define PF_FROZEN 0x00010000 /* frozen for system suspend */
#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
#define PF_KSWAPD 0x00040000 /* I am kswapd */
......
......@@ -28,7 +28,7 @@
static inline int freezeable(struct task_struct * p)
{
if ((p == current) ||
(p->flags & PF_IOTHREAD) ||
(p->flags & PF_NOFREEZE) ||
(p->state == TASK_ZOMBIE) ||
(p->state == TASK_DEAD) ||
(p->state == TASK_STOPPED))
......
......@@ -2779,7 +2779,7 @@ static int migration_thread(void * data)
migration_req_t *req;
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
spin_lock_irq(&rq->lock);
head = &rq->migration_queue;
......
......@@ -323,7 +323,7 @@ void __init softirq_init(void)
static int ksoftirqd(void * __bind_cpu)
{
set_user_nice(current, 19);
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
set_current_state(TASK_INTERRUPTIBLE);
......
......@@ -181,7 +181,7 @@ static int worker_thread(void *__cwq)
struct k_sigaction sa;
sigset_t blocked;
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
set_user_nice(current, -10);
......
......@@ -107,7 +107,7 @@ static int __pdflush(struct pdflush_work *my_work)
schedule();
if (current->flags & PF_FREEZE) {
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
spin_lock_irq(&pdflush_lock);
continue;
}
......
......@@ -1067,7 +1067,7 @@ int kswapd(void *p)
struct page_state ps;
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
schedule();
finish_wait(&pgdat->kswapd_wait, &wait);
......
......@@ -458,7 +458,7 @@ static int bnep_session(void *arg)
daemonize("kbnepd %s", dev->name);
set_user_nice(current, -15);
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
set_fs(KERNEL_DS);
......
......@@ -293,7 +293,7 @@ static int cmtp_session(void *arg)
daemonize("kcmtpd_ctr_%d", session->num);
set_user_nice(current, -15);
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
set_fs(KERNEL_DS);
......
......@@ -1819,7 +1819,7 @@ static int rfcomm_run(void *unused)
daemonize("krfcommd");
set_user_nice(current, -10);
current->flags |= PF_IOTHREAD;
current->flags |= PF_NOFREEZE;
set_fs(KERNEL_DS);
......
......@@ -1127,7 +1127,7 @@ rpciod(void *ptr)
__rpc_schedule();
if (current->flags & PF_FREEZE) {
spin_unlock_bh(&rpc_queue_lock);
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
spin_lock_bh(&rpc_queue_lock);
}
......
......@@ -1232,7 +1232,7 @@ svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout)
schedule_timeout(timeout);
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
refrigerator(PF_FREEZE);
spin_lock_bh(&serv->sv_lock);
remove_wait_queue(&rqstp->rq_wait, &wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment