aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lameter <christoph@lameter.com>2005-06-25 02:13:50 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 20:10:13 -0400
commit3e1d1d28d99dabe63c64f7f40f1ca1d646de1f73 (patch)
treed1e7c1e2e8902072042aefc3a7976b271cf76021
parentb3e112bcc19abd8e9657dca34a87316786e096f3 (diff)
[PATCH] Cleanup patch for process freezing
1. Establish a simple API for process freezing defined in linux/include/sched.h: frozen(process) Check for frozen process freezing(process) Check if a process is being frozen freeze(process) Tell a process to freeze (go to refrigerator) thaw_process(process) Restart process frozen_process(process) Process is frozen now 2. Remove all references to PF_FREEZE and PF_FROZEN from all kernel sources except sched.h 3. Fix numerous locations where try_to_freeze is manually done by a driver 4. Remove the argument that is no longer necessary from two function calls. 5. Some whitespace cleanup 6. Clear potential race in refrigerator (provides an open window of PF_FREEZE cleared before setting PF_FROZEN, recalc_sigpending does not check PF_FROZEN). This patch does not address the problem of freeze_processes() violating the rule that a task may only modify its own flags by setting PF_FREEZE. This is not clean in an SMP environment. freeze(process) is therefore not SMP safe! Signed-off-by: Christoph Lameter <christoph@lameter.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--Documentation/power/kernel_threads.txt3
-rw-r--r--Documentation/power/swsusp.txt3
-rw-r--r--arch/frv/kernel/signal.c4
-rw-r--r--arch/h8300/kernel/signal.c4
-rw-r--r--arch/i386/kernel/io_apic.c2
-rw-r--r--arch/i386/kernel/signal.c4
-rw-r--r--arch/m32r/kernel/signal.c4
-rw-r--r--arch/ppc/kernel/signal.c3
-rw-r--r--arch/x86_64/kernel/signal.c2
-rw-r--r--drivers/block/pktcdvd.c3
-rw-r--r--drivers/ieee1394/ieee1394_core.c4
-rw-r--r--drivers/ieee1394/nodemgr.c2
-rw-r--r--drivers/input/gameport/gameport.c2
-rw-r--r--drivers/input/serio/serio.c2
-rw-r--r--drivers/macintosh/therm_adt746x.c4
-rw-r--r--drivers/md/md.c3
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c3
-rw-r--r--drivers/media/video/msp3400.c3
-rw-r--r--drivers/media/video/video-buf-dvb.c3
-rw-r--r--drivers/net/8139too.c2
-rw-r--r--drivers/net/irda/sir_kthread.c3
-rw-r--r--drivers/net/irda/stir4200.c4
-rw-r--r--drivers/net/wireless/airo.c2
-rw-r--r--drivers/pcmcia/cs.c2
-rw-r--r--drivers/pnp/pnpbios/core.c2
-rw-r--r--drivers/usb/core/hub.c2
-rw-r--r--drivers/usb/gadget/file_storage.c3
-rw-r--r--drivers/usb/storage/usb.c4
-rw-r--r--drivers/w1/w1.c4
-rw-r--r--fs/afs/kafsasyncd.c2
-rw-r--r--fs/afs/kafstimod.c2
-rw-r--r--fs/jbd/journal.c4
-rw-r--r--fs/jfs/jfs_logmgr.c4
-rw-r--r--fs/jfs/jfs_txnmgr.c8
-rw-r--r--fs/lockd/clntproc.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c2
-rw-r--r--include/linux/sched.h73
-rw-r--r--kernel/power/process.c26
-rw-r--r--kernel/sched.c3
-rw-r--r--kernel/signal.c5
-rw-r--r--mm/pdflush.c2
-rw-r--r--mm/vmscan.c4
-rw-r--r--net/rxrpc/krxiod.c2
-rw-r--r--net/rxrpc/krxsecd.c2
-rw-r--r--net/rxrpc/krxtimod.c2
-rw-r--r--net/sunrpc/svcsock.c6
47 files changed, 126 insertions, 113 deletions
diff --git a/Documentation/power/kernel_threads.txt b/Documentation/power/kernel_threads.txt
index 60b548105edf..fb57784986b1 100644
--- a/Documentation/power/kernel_threads.txt
+++ b/Documentation/power/kernel_threads.txt
@@ -12,8 +12,7 @@ refrigerator. Code to do this looks like this:
12 do { 12 do {
13 hub_events(); 13 hub_events();
14 wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list)); 14 wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
15 if (current->flags & PF_FREEZE) 15 try_to_freeze();
16 refrigerator(PF_FREEZE);
17 } while (!signal_pending(current)); 16 } while (!signal_pending(current));
18 17
19from drivers/usb/core/hub.c::hub_thread() 18from drivers/usb/core/hub.c::hub_thread()
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index c7c3459fde43..4e1627cc5b51 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -164,8 +164,7 @@ place where the thread is safe to be frozen (no kernel semaphores
164should be held at that point and it must be safe to sleep there), and 164should be held at that point and it must be safe to sleep there), and
165add: 165add:
166 166
167 if (current->flags & PF_FREEZE) 167 try_to_freeze();
168 refrigerator(PF_FREEZE);
169 168
170If the thread is needed for writing the image to storage, you should 169If the thread is needed for writing the image to storage, you should
171instead set the PF_NOFREEZE process flag when creating the thread. 170instead set the PF_NOFREEZE process flag when creating the thread.
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index d8d8f3d4304d..36a2dffc8ebd 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -536,10 +536,8 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
536 if (!user_mode(regs)) 536 if (!user_mode(regs))
537 return 1; 537 return 1;
538 538
539 if (current->flags & PF_FREEZE) { 539 if (try_to_freeze())
540 refrigerator(0);
541 goto no_signal; 540 goto no_signal;
542 }
543 541
544 if (!oldset) 542 if (!oldset)
545 oldset = &current->blocked; 543 oldset = &current->blocked;
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c
index a4799d633ef4..5aab87eae1f9 100644
--- a/arch/h8300/kernel/signal.c
+++ b/arch/h8300/kernel/signal.c
@@ -517,10 +517,8 @@ asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset)
517 if ((regs->ccr & 0x10)) 517 if ((regs->ccr & 0x10))
518 return 1; 518 return 1;
519 519
520 if (current->flags & PF_FREEZE) { 520 if (try_to_freeze())
521 refrigerator(0);
522 goto no_signal; 521 goto no_signal;
523 }
524 522
525 current->thread.esp0 = (unsigned long) regs; 523 current->thread.esp0 = (unsigned long) regs;
526 524
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 08540bc4ba3e..2451a3a99440 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -573,7 +573,7 @@ static int balanced_irq(void *unused)
573 for ( ; ; ) { 573 for ( ; ; ) {
574 set_current_state(TASK_INTERRUPTIBLE); 574 set_current_state(TASK_INTERRUPTIBLE);
575 time_remaining = schedule_timeout(time_remaining); 575 time_remaining = schedule_timeout(time_remaining);
576 try_to_freeze(PF_FREEZE); 576 try_to_freeze();
577 if (time_after(jiffies, 577 if (time_after(jiffies,
578 prev_balance_time+balanced_irq_interval)) { 578 prev_balance_time+balanced_irq_interval)) {
579 do_irq_balance(); 579 do_irq_balance();
diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index b9b8f4e20fad..ac5b1e975c5c 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -608,10 +608,8 @@ int fastcall do_signal(struct pt_regs *regs, sigset_t *oldset)
608 if (!user_mode(regs)) 608 if (!user_mode(regs))
609 return 1; 609 return 1;
610 610
611 if (current->flags & PF_FREEZE) { 611 if (try_to_freeze)
612 refrigerator(0);
613 goto no_signal; 612 goto no_signal;
614 }
615 613
616 if (!oldset) 614 if (!oldset)
617 oldset = &current->blocked; 615 oldset = &current->blocked;
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 50311eb07a24..5aef7e406ef5 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -371,10 +371,8 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
371 if (!user_mode(regs)) 371 if (!user_mode(regs))
372 return 1; 372 return 1;
373 373
374 if (current->flags & PF_FREEZE) { 374 if (try_to_freeze())
375 refrigerator(0);
376 goto no_signal; 375 goto no_signal;
377 }
378 376
379 if (!oldset) 377 if (!oldset)
380 oldset = &current->blocked; 378 oldset = &current->blocked;
diff --git a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c
index 7c8437da09d5..8aaeb6f4e750 100644
--- a/arch/ppc/kernel/signal.c
+++ b/arch/ppc/kernel/signal.c
@@ -705,8 +705,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
705 unsigned long frame, newsp; 705 unsigned long frame, newsp;
706 int signr, ret; 706 int signr, ret;
707 707
708 if (current->flags & PF_FREEZE) { 708 if (try_to_freeze()) {
709 refrigerator(PF_FREEZE);
710 signr = 0; 709 signr = 0;
711 if (!signal_pending(current)) 710 if (!signal_pending(current))
712 goto no_signal; 711 goto no_signal;
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c
index 98b7ba95d581..98590a989f3d 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86_64/kernel/signal.c
@@ -425,7 +425,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
425 if (!user_mode(regs)) 425 if (!user_mode(regs))
426 return 1; 426 return 1;
427 427
428 if (try_to_freeze(0)) 428 if (try_to_freeze())
429 goto no_signal; 429 goto no_signal;
430 430
431 if (!oldset) 431 if (!oldset)
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 7f3d78de265c..7b838342f0a3 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1251,8 +1251,7 @@ static int kcdrwd(void *foobar)
1251 VPRINTK("kcdrwd: wake up\n"); 1251 VPRINTK("kcdrwd: wake up\n");
1252 1252
1253 /* make swsusp happy with our thread */ 1253 /* make swsusp happy with our thread */
1254 if (current->flags & PF_FREEZE) 1254 try_to_freeze();
1255 refrigerator(PF_FREEZE);
1256 1255
1257 list_for_each_entry(pkt, &pd->cdrw.pkt_active_list, list) { 1256 list_for_each_entry(pkt, &pd->cdrw.pkt_active_list, list) {
1258 if (!pkt->sleep_time) 1257 if (!pkt->sleep_time)
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
index 2d9a9b74e687..629070b83a33 100644
--- a/drivers/ieee1394/ieee1394_core.c
+++ b/drivers/ieee1394/ieee1394_core.c
@@ -1041,10 +1041,8 @@ static int hpsbpkt_thread(void *__hi)
1041 1041
1042 while (1) { 1042 while (1) {
1043 if (down_interruptible(&khpsbpkt_sig)) { 1043 if (down_interruptible(&khpsbpkt_sig)) {
1044 if (current->flags & PF_FREEZE) { 1044 if (try_to_freeze())
1045 refrigerator(0);
1046 continue; 1045 continue;
1047 }
1048 printk("khpsbpkt: received unexpected signal?!\n" ); 1046 printk("khpsbpkt: received unexpected signal?!\n" );
1049 break; 1047 break;
1050 } 1048 }
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 32abb6dda888..9a46c3b44bf8 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1510,7 +1510,7 @@ static int nodemgr_host_thread(void *__hi)
1510 1510
1511 if (down_interruptible(&hi->reset_sem) || 1511 if (down_interruptible(&hi->reset_sem) ||
1512 down_interruptible(&nodemgr_serialize)) { 1512 down_interruptible(&nodemgr_serialize)) {
1513 if (try_to_freeze(PF_FREEZE)) 1513 if (try_to_freeze())
1514 continue; 1514 continue;
1515 printk("NodeMgr: received unexpected signal?!\n" ); 1515 printk("NodeMgr: received unexpected signal?!\n" );
1516 break; 1516 break;
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index e152d0fa0cdd..c77a82e46055 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -439,7 +439,7 @@ static int gameport_thread(void *nothing)
439 do { 439 do {
440 gameport_handle_events(); 440 gameport_handle_events();
441 wait_event_interruptible(gameport_wait, !list_empty(&gameport_event_list)); 441 wait_event_interruptible(gameport_wait, !list_empty(&gameport_event_list));
442 try_to_freeze(PF_FREEZE); 442 try_to_freeze();
443 } while (!signal_pending(current)); 443 } while (!signal_pending(current));
444 444
445 printk(KERN_DEBUG "gameport: kgameportd exiting\n"); 445 printk(KERN_DEBUG "gameport: kgameportd exiting\n");
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index feab4970406e..341824c48529 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -344,7 +344,7 @@ static int serio_thread(void *nothing)
344 do { 344 do {
345 serio_handle_events(); 345 serio_handle_events();
346 wait_event_interruptible(serio_wait, !list_empty(&serio_event_list)); 346 wait_event_interruptible(serio_wait, !list_empty(&serio_event_list));
347 try_to_freeze(PF_FREEZE); 347 try_to_freeze();
348 } while (!signal_pending(current)); 348 } while (!signal_pending(current));
349 349
350 printk(KERN_DEBUG "serio: kseriod exiting\n"); 350 printk(KERN_DEBUG "serio: kseriod exiting\n");
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 5ba190ce14a0..c9ca1118e449 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -328,9 +328,7 @@ static int monitor_task(void *arg)
328 struct thermostat* th = arg; 328 struct thermostat* th = arg;
329 329
330 while(!kthread_should_stop()) { 330 while(!kthread_should_stop()) {
331 if (current->flags & PF_FREEZE) 331 try_to_freeze();
332 refrigerator(PF_FREEZE);
333
334 msleep_interruptible(2000); 332 msleep_interruptible(2000);
335 333
336#ifndef DEBUG 334#ifndef DEBUG
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0c6b5b6baff6..3802f7a17f16 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2976,8 +2976,7 @@ static int md_thread(void * arg)
2976 wait_event_interruptible_timeout(thread->wqueue, 2976 wait_event_interruptible_timeout(thread->wqueue,
2977 test_bit(THREAD_WAKEUP, &thread->flags), 2977 test_bit(THREAD_WAKEUP, &thread->flags),
2978 thread->timeout); 2978 thread->timeout);
2979 if (current->flags & PF_FREEZE) 2979 try_to_freeze();
2980 refrigerator(PF_FREEZE);
2981 2980
2982 clear_bit(THREAD_WAKEUP, &thread->flags); 2981 clear_bit(THREAD_WAKEUP, &thread->flags);
2983 2982
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index d6b7a9de471e..f11daae91cd4 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -391,8 +391,7 @@ static int dvb_frontend_thread(void *data)
391 break; 391 break;
392 } 392 }
393 393
394 if (current->flags & PF_FREEZE) 394 try_to_freeze();
395 refrigerator(PF_FREEZE);
396 395
397 if (down_interruptible(&fepriv->sem)) 396 if (down_interruptible(&fepriv->sem))
398 break; 397 break;
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
index 1b7d38e96f14..b4ee9dfe6d42 100644
--- a/drivers/media/video/msp3400.c
+++ b/drivers/media/video/msp3400.c
@@ -750,8 +750,7 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout)
750#endif 750#endif
751 } 751 }
752 } 752 }
753 if (current->flags & PF_FREEZE) 753 try_to_freeze();
754 refrigerator(PF_FREEZE);
755 remove_wait_queue(&msp->wq, &wait); 754 remove_wait_queue(&msp->wq, &wait);
756 return msp->restart; 755 return msp->restart;
757} 756}
diff --git a/drivers/media/video/video-buf-dvb.c b/drivers/media/video/video-buf-dvb.c
index 5f870075b55e..15f5bb486963 100644
--- a/drivers/media/video/video-buf-dvb.c
+++ b/drivers/media/video/video-buf-dvb.c
@@ -62,8 +62,7 @@ static int videobuf_dvb_thread(void *data)
62 break; 62 break;
63 if (kthread_should_stop()) 63 if (kthread_should_stop())
64 break; 64 break;
65 if (current->flags & PF_FREEZE) 65 try_to_freeze();
66 refrigerator(PF_FREEZE);
67 66
68 /* feed buffer data to demux */ 67 /* feed buffer data to demux */
69 if (buf->state == STATE_DONE) 68 if (buf->state == STATE_DONE)
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 047202c4d9a8..5a4a08a7c951 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -1606,7 +1606,7 @@ static int rtl8139_thread (void *data)
1606 do { 1606 do {
1607 timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout); 1607 timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout);
1608 /* make swsusp happy with our thread */ 1608 /* make swsusp happy with our thread */
1609 try_to_freeze(PF_FREEZE); 1609 try_to_freeze();
1610 } while (!signal_pending (current) && (timeout > 0)); 1610 } while (!signal_pending (current) && (timeout > 0));
1611 1611
1612 if (signal_pending (current)) { 1612 if (signal_pending (current)) {
diff --git a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c
index 18cea1099530..c65054364bca 100644
--- a/drivers/net/irda/sir_kthread.c
+++ b/drivers/net/irda/sir_kthread.c
@@ -135,8 +135,7 @@ static int irda_thread(void *startup)
135 remove_wait_queue(&irda_rq_queue.kick, &wait); 135 remove_wait_queue(&irda_rq_queue.kick, &wait);
136 136
137 /* make swsusp happy with our thread */ 137 /* make swsusp happy with our thread */
138 if (current->flags & PF_FREEZE) 138 try_to_freeze();
139 refrigerator(PF_FREEZE);
140 139
141 run_irda_queue(); 140 run_irda_queue();
142 } 141 }
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c
index 66f488c13717..15f207323d97 100644
--- a/drivers/net/irda/stir4200.c
+++ b/drivers/net/irda/stir4200.c
@@ -763,7 +763,7 @@ static int stir_transmit_thread(void *arg)
763 { 763 {
764#ifdef CONFIG_PM 764#ifdef CONFIG_PM
765 /* if suspending, then power off and wait */ 765 /* if suspending, then power off and wait */
766 if (unlikely(current->flags & PF_FREEZE)) { 766 if (unlikely(freezing(current))) {
767 if (stir->receiving) 767 if (stir->receiving)
768 receive_stop(stir); 768 receive_stop(stir);
769 else 769 else
@@ -771,7 +771,7 @@ static int stir_transmit_thread(void *arg)
771 771
772 write_reg(stir, REG_CTRL1, CTRL1_TXPWD|CTRL1_RXPWD); 772 write_reg(stir, REG_CTRL1, CTRL1_TXPWD|CTRL1_RXPWD);
773 773
774 refrigerator(PF_FREEZE); 774 refrigerator();
775 775
776 if (change_speed(stir, stir->speed)) 776 if (change_speed(stir, stir->speed))
777 break; 777 break;
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index fb10a2db63ad..d72e0385e4f2 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2918,7 +2918,7 @@ static int airo_thread(void *data) {
2918 flush_signals(current); 2918 flush_signals(current);
2919 2919
2920 /* make swsusp happy with our thread */ 2920 /* make swsusp happy with our thread */
2921 try_to_freeze(PF_FREEZE); 2921 try_to_freeze();
2922 2922
2923 if (test_bit(JOB_DIE, &ai->flags)) 2923 if (test_bit(JOB_DIE, &ai->flags))
2924 break; 2924 break;
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index d136b3c8fac9..48e4f04530d8 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -718,7 +718,7 @@ static int pccardd(void *__skt)
718 } 718 }
719 719
720 schedule(); 720 schedule();
721 try_to_freeze(PF_FREEZE); 721 try_to_freeze();
722 722
723 if (!skt->thread) 723 if (!skt->thread)
724 break; 724 break;
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index e939c93a931c..778a324028f4 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -182,7 +182,7 @@ static int pnp_dock_thread(void * unused)
182 msleep_interruptible(2000); 182 msleep_interruptible(2000);
183 183
184 if(signal_pending(current)) { 184 if(signal_pending(current)) {
185 if (try_to_freeze(PF_FREEZE)) 185 if (try_to_freeze())
186 continue; 186 continue;
187 break; 187 break;
188 } 188 }
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index d2d648ee8640..a8d879a85d04 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2808,7 +2808,7 @@ static int hub_thread(void *__unused)
2808 do { 2808 do {
2809 hub_events(); 2809 hub_events();
2810 wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list)); 2810 wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
2811 try_to_freeze(PF_FREEZE); 2811 try_to_freeze();
2812 } while (!signal_pending(current)); 2812 } while (!signal_pending(current));
2813 2813
2814 pr_debug ("%s: khubd exiting\n", usbcore_name); 2814 pr_debug ("%s: khubd exiting\n", usbcore_name);
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 037a7f163822..a9be85103d23 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -1554,8 +1554,7 @@ static int sleep_thread(struct fsg_dev *fsg)
1554 rc = wait_event_interruptible(fsg->thread_wqh, 1554 rc = wait_event_interruptible(fsg->thread_wqh,
1555 fsg->thread_wakeup_needed); 1555 fsg->thread_wakeup_needed);
1556 fsg->thread_wakeup_needed = 0; 1556 fsg->thread_wakeup_needed = 0;
1557 if (current->flags & PF_FREEZE) 1557 try_to_freeze();
1558 refrigerator(PF_FREEZE);
1559 return (rc ? -EINTR : 0); 1558 return (rc ? -EINTR : 0);
1560} 1559}
1561 1560
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 35c1ca6b5a8e..77e7fc258aa2 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -847,10 +847,8 @@ retry:
847 wait_event_interruptible_timeout(us->delay_wait, 847 wait_event_interruptible_timeout(us->delay_wait,
848 test_bit(US_FLIDX_DISCONNECTING, &us->flags), 848 test_bit(US_FLIDX_DISCONNECTING, &us->flags),
849 delay_use * HZ); 849 delay_use * HZ);
850 if (current->flags & PF_FREEZE) { 850 if (try_to_freeze())
851 refrigerator(PF_FREEZE);
852 goto retry; 851 goto retry;
853 }
854 } 852 }
855 853
856 /* If the device is still connected, perform the scanning */ 854 /* If the device is still connected, perform the scanning */
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index b460927ec32a..312cf3220f12 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -646,7 +646,7 @@ static int w1_control(void *data)
646 while (!control_needs_exit || have_to_wait) { 646 while (!control_needs_exit || have_to_wait) {
647 have_to_wait = 0; 647 have_to_wait = 0;
648 648
649 try_to_freeze(PF_FREEZE); 649 try_to_freeze();
650 msleep_interruptible(w1_timeout * 1000); 650 msleep_interruptible(w1_timeout * 1000);
651 651
652 if (signal_pending(current)) 652 if (signal_pending(current))
@@ -725,7 +725,7 @@ int w1_process(void *data)
725 allow_signal(SIGTERM); 725 allow_signal(SIGTERM);
726 726
727 while (!test_bit(W1_MASTER_NEED_EXIT, &dev->flags)) { 727 while (!test_bit(W1_MASTER_NEED_EXIT, &dev->flags)) {
728 try_to_freeze(PF_FREEZE); 728 try_to_freeze();
729 msleep_interruptible(w1_timeout * 1000); 729 msleep_interruptible(w1_timeout * 1000);
730 730
731 if (signal_pending(current)) 731 if (signal_pending(current))
diff --git a/fs/afs/kafsasyncd.c b/fs/afs/kafsasyncd.c
index 6fc88ae8ad94..7ac07d0d47b9 100644
--- a/fs/afs/kafsasyncd.c
+++ b/fs/afs/kafsasyncd.c
@@ -116,7 +116,7 @@ static int kafsasyncd(void *arg)
116 remove_wait_queue(&kafsasyncd_sleepq, &myself); 116 remove_wait_queue(&kafsasyncd_sleepq, &myself);
117 set_current_state(TASK_RUNNING); 117 set_current_state(TASK_RUNNING);
118 118
119 try_to_freeze(PF_FREEZE); 119 try_to_freeze();
120 120
121 /* discard pending signals */ 121 /* discard pending signals */
122 afs_discard_my_signals(); 122 afs_discard_my_signals();
diff --git a/fs/afs/kafstimod.c b/fs/afs/kafstimod.c
index 86e710dd057e..65bc05ab8182 100644
--- a/fs/afs/kafstimod.c
+++ b/fs/afs/kafstimod.c
@@ -91,7 +91,7 @@ static int kafstimod(void *arg)
91 complete_and_exit(&kafstimod_dead, 0); 91 complete_and_exit(&kafstimod_dead, 0);
92 } 92 }
93 93
94 try_to_freeze(PF_FREEZE); 94 try_to_freeze();
95 95
96 /* discard pending signals */ 96 /* discard pending signals */
97 afs_discard_my_signals(); 97 afs_discard_my_signals();
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 1e6f2e2ad4a3..5e7b43949517 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -167,7 +167,7 @@ loop:
167 } 167 }
168 168
169 wake_up(&journal->j_wait_done_commit); 169 wake_up(&journal->j_wait_done_commit);
170 if (current->flags & PF_FREEZE) { 170 if (freezing(current)) {
171 /* 171 /*
172 * The simpler the better. Flushing journal isn't a 172 * The simpler the better. Flushing journal isn't a
173 * good idea, because that depends on threads that may 173 * good idea, because that depends on threads that may
@@ -175,7 +175,7 @@ loop:
175 */ 175 */
176 jbd_debug(1, "Now suspending kjournald\n"); 176 jbd_debug(1, "Now suspending kjournald\n");
177 spin_unlock(&journal->j_state_lock); 177 spin_unlock(&journal->j_state_lock);
178 refrigerator(PF_FREEZE); 178 refrigerator();
179 spin_lock(&journal->j_state_lock); 179 spin_lock(&journal->j_state_lock);
180 } else { 180 } else {
181 /* 181 /*
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 7c8387ed4192..79d07624bfe1 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -2359,9 +2359,9 @@ int jfsIOWait(void *arg)
2359 lbmStartIO(bp); 2359 lbmStartIO(bp);
2360 spin_lock_irq(&log_redrive_lock); 2360 spin_lock_irq(&log_redrive_lock);
2361 } 2361 }
2362 if (current->flags & PF_FREEZE) { 2362 if (freezing(current)) {
2363 spin_unlock_irq(&log_redrive_lock); 2363 spin_unlock_irq(&log_redrive_lock);
2364 refrigerator(PF_FREEZE); 2364 refrigerator();
2365 } else { 2365 } else {
2366 add_wait_queue(&jfs_IO_thread_wait, &wq); 2366 add_wait_queue(&jfs_IO_thread_wait, &wq);
2367 set_current_state(TASK_INTERRUPTIBLE); 2367 set_current_state(TASK_INTERRUPTIBLE);
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 8cbaaff1d5fa..121c981ff453 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -2788,9 +2788,9 @@ int jfs_lazycommit(void *arg)
2788 /* In case a wakeup came while all threads were active */ 2788 /* In case a wakeup came while all threads were active */
2789 jfs_commit_thread_waking = 0; 2789 jfs_commit_thread_waking = 0;
2790 2790
2791 if (current->flags & PF_FREEZE) { 2791 if (freezing(current)) {
2792 LAZY_UNLOCK(flags); 2792 LAZY_UNLOCK(flags);
2793 refrigerator(PF_FREEZE); 2793 refrigerator();
2794 } else { 2794 } else {
2795 DECLARE_WAITQUEUE(wq, current); 2795 DECLARE_WAITQUEUE(wq, current);
2796 2796
@@ -2987,9 +2987,9 @@ int jfs_sync(void *arg)
2987 /* Add anon_list2 back to anon_list */ 2987 /* Add anon_list2 back to anon_list */
2988 list_splice_init(&TxAnchor.anon_list2, &TxAnchor.anon_list); 2988 list_splice_init(&TxAnchor.anon_list2, &TxAnchor.anon_list);
2989 2989
2990 if (current->flags & PF_FREEZE) { 2990 if (freezing(current)) {
2991 TXN_UNLOCK(); 2991 TXN_UNLOCK();
2992 refrigerator(PF_FREEZE); 2992 refrigerator();
2993 } else { 2993 } else {
2994 DECLARE_WAITQUEUE(wq, current); 2994 DECLARE_WAITQUEUE(wq, current);
2995 2995
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index fd77ed1d710d..14b3ce87fa29 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -313,7 +313,7 @@ static int nlm_wait_on_grace(wait_queue_head_t *queue)
313 prepare_to_wait(queue, &wait, TASK_INTERRUPTIBLE); 313 prepare_to_wait(queue, &wait, TASK_INTERRUPTIBLE);
314 if (!signalled ()) { 314 if (!signalled ()) {
315 schedule_timeout(NLMCLNT_GRACE_WAIT); 315 schedule_timeout(NLMCLNT_GRACE_WAIT);
316 try_to_freeze(PF_FREEZE); 316 try_to_freeze();
317 if (!signalled ()) 317 if (!signalled ())
318 status = 0; 318 status = 0;
319 } 319 }
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index c60e69431e11..df0cba239dd5 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1771,9 +1771,9 @@ xfsbufd(
1771 1771
1772 INIT_LIST_HEAD(&tmp); 1772 INIT_LIST_HEAD(&tmp);
1773 do { 1773 do {
1774 if (unlikely(current->flags & PF_FREEZE)) { 1774 if (unlikely(freezing(current))) {
1775 xfsbufd_force_sleep = 1; 1775 xfsbufd_force_sleep = 1;
1776 refrigerator(PF_FREEZE); 1776 refrigerator();
1777 } else { 1777 } else {
1778 xfsbufd_force_sleep = 0; 1778 xfsbufd_force_sleep = 0;
1779 } 1779 }
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 5fe9af38aa20..f6dd7de25927 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -483,7 +483,7 @@ xfssyncd(
483 set_current_state(TASK_INTERRUPTIBLE); 483 set_current_state(TASK_INTERRUPTIBLE);
484 timeleft = schedule_timeout(timeleft); 484 timeleft = schedule_timeout(timeleft);
485 /* swsusp */ 485 /* swsusp */
486 try_to_freeze(PF_FREEZE); 486 try_to_freeze();
487 if (vfsp->vfs_flag & VFS_UMOUNT) 487 if (vfsp->vfs_flag & VFS_UMOUNT)
488 break; 488 break;
489 489
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2c69682b0444..e7fd09b0557f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1245,33 +1245,78 @@ extern void normalize_rt_tasks(void);
1245 1245
1246#endif 1246#endif
1247 1247
1248/* try_to_freeze
1249 *
1250 * Checks whether we need to enter the refrigerator
1251 * and returns 1 if we did so.
1252 */
1253#ifdef CONFIG_PM 1248#ifdef CONFIG_PM
1254extern void refrigerator(unsigned long); 1249/*
1250 * Check if a process has been frozen
1251 */
1252static inline int frozen(struct task_struct *p)
1253{
1254 return p->flags & PF_FROZEN;
1255}
1256
1257/*
1258 * Check if there is a request to freeze a process
1259 */
1260static inline int freezing(struct task_struct *p)
1261{
1262 return p->flags & PF_FREEZE;
1263}
1264
1265/*
1266 * Request that a process be frozen
1267 * FIXME: SMP problem. We may not modify other process' flags!
1268 */
1269static inline void freeze(struct task_struct *p)
1270{
1271 p->flags |= PF_FREEZE;
1272}
1273
1274/*
1275 * Wake up a frozen process
1276 */
1277static inline int thaw_process(struct task_struct *p)
1278{
1279 if (frozen(p)) {
1280 p->flags &= ~PF_FROZEN;
1281 wake_up_process(p);
1282 return 1;
1283 }
1284 return 0;
1285}
1286
1287/*
1288 * freezing is complete, mark process as frozen
1289 */
1290static inline void frozen_process(struct task_struct *p)
1291{
1292 p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
1293}
1294
1295extern void refrigerator(void);
1255extern int freeze_processes(void); 1296extern int freeze_processes(void);
1256extern void thaw_processes(void); 1297extern void thaw_processes(void);
1257 1298
1258static inline int try_to_freeze(unsigned long refrigerator_flags) 1299static inline int try_to_freeze(void)
1259{ 1300{
1260 if (unlikely(current->flags & PF_FREEZE)) { 1301 if (freezing(current)) {
1261 refrigerator(refrigerator_flags); 1302 refrigerator();
1262 return 1; 1303 return 1;
1263 } else 1304 } else
1264 return 0; 1305 return 0;
1265} 1306}
1266#else 1307#else
1267static inline void refrigerator(unsigned long flag) {} 1308static inline int frozen(struct task_struct *p) { return 0; }
1309static inline int freezing(struct task_struct *p) { return 0; }
1310static inline void freeze(struct task_struct *p) { BUG(); }
1311static inline int thaw_process(struct task_struct *p) { return 1; }
1312static inline void frozen_process(struct task_struct *p) { BUG(); }
1313
1314static inline void refrigerator(void) {}
1268static inline int freeze_processes(void) { BUG(); return 0; } 1315static inline int freeze_processes(void) { BUG(); return 0; }
1269static inline void thaw_processes(void) {} 1316static inline void thaw_processes(void) {}
1270 1317
1271static inline int try_to_freeze(unsigned long refrigerator_flags) 1318static inline int try_to_freeze(void) { return 0; }
1272{ 1319
1273 return 0;
1274}
1275#endif /* CONFIG_PM */ 1320#endif /* CONFIG_PM */
1276#endif /* __KERNEL__ */ 1321#endif /* __KERNEL__ */
1277 1322
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 78d92dc6a1ed..0a086640bcfc 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -32,7 +32,7 @@ static inline int freezeable(struct task_struct * p)
32} 32}
33 33
34/* Refrigerator is place where frozen processes are stored :-). */ 34/* Refrigerator is place where frozen processes are stored :-). */
35void refrigerator(unsigned long flag) 35void refrigerator(void)
36{ 36{
37 /* Hmm, should we be allowed to suspend when there are realtime 37 /* Hmm, should we be allowed to suspend when there are realtime
38 processes around? */ 38 processes around? */
@@ -41,14 +41,13 @@ void refrigerator(unsigned long flag)
41 current->state = TASK_UNINTERRUPTIBLE; 41 current->state = TASK_UNINTERRUPTIBLE;
42 pr_debug("%s entered refrigerator\n", current->comm); 42 pr_debug("%s entered refrigerator\n", current->comm);
43 printk("="); 43 printk("=");
44 current->flags &= ~PF_FREEZE;
45 44
45 frozen_process(current);
46 spin_lock_irq(&current->sighand->siglock); 46 spin_lock_irq(&current->sighand->siglock);
47 recalc_sigpending(); /* We sent fake signal, clean it up */ 47 recalc_sigpending(); /* We sent fake signal, clean it up */
48 spin_unlock_irq(&current->sighand->siglock); 48 spin_unlock_irq(&current->sighand->siglock);
49 49
50 current->flags |= PF_FROZEN; 50 while (frozen(current))
51 while (current->flags & PF_FROZEN)
52 schedule(); 51 schedule();
53 pr_debug("%s left refrigerator\n", current->comm); 52 pr_debug("%s left refrigerator\n", current->comm);
54 current->state = save; 53 current->state = save;
@@ -57,10 +56,10 @@ void refrigerator(unsigned long flag)
57/* 0 = success, else # of processes that we failed to stop */ 56/* 0 = success, else # of processes that we failed to stop */
58int freeze_processes(void) 57int freeze_processes(void)
59{ 58{
60 int todo; 59 int todo;
61 unsigned long start_time; 60 unsigned long start_time;
62 struct task_struct *g, *p; 61 struct task_struct *g, *p;
63 62
64 printk( "Stopping tasks: " ); 63 printk( "Stopping tasks: " );
65 start_time = jiffies; 64 start_time = jiffies;
66 do { 65 do {
@@ -70,14 +69,12 @@ int freeze_processes(void)
70 unsigned long flags; 69 unsigned long flags;
71 if (!freezeable(p)) 70 if (!freezeable(p))
72 continue; 71 continue;
73 if ((p->flags & PF_FROZEN) || 72 if ((frozen(p)) ||
74 (p->state == TASK_TRACED) || 73 (p->state == TASK_TRACED) ||
75 (p->state == TASK_STOPPED)) 74 (p->state == TASK_STOPPED))
76 continue; 75 continue;
77 76
78 /* FIXME: smp problem here: we may not access other process' flags 77 freeze(p);
79 without locking */
80 p->flags |= PF_FREEZE;
81 spin_lock_irqsave(&p->sighand->siglock, flags); 78 spin_lock_irqsave(&p->sighand->siglock, flags);
82 signal_wake_up(p, 0); 79 signal_wake_up(p, 0);
83 spin_unlock_irqrestore(&p->sighand->siglock, flags); 80 spin_unlock_irqrestore(&p->sighand->siglock, flags);
@@ -91,7 +88,7 @@ int freeze_processes(void)
91 return todo; 88 return todo;
92 } 89 }
93 } while(todo); 90 } while(todo);
94 91
95 printk( "|\n" ); 92 printk( "|\n" );
96 BUG_ON(in_atomic()); 93 BUG_ON(in_atomic());
97 return 0; 94 return 0;
@@ -106,10 +103,7 @@ void thaw_processes(void)
106 do_each_thread(g, p) { 103 do_each_thread(g, p) {
107 if (!freezeable(p)) 104 if (!freezeable(p))
108 continue; 105 continue;
109 if (p->flags & PF_FROZEN) { 106 if (!thaw_process(p))
110 p->flags &= ~PF_FROZEN;
111 wake_up_process(p);
112 } else
113 printk(KERN_INFO " Strange, %s not stopped\n", p->comm ); 107 printk(KERN_INFO " Strange, %s not stopped\n", p->comm );
114 } while_each_thread(g, p); 108 } while_each_thread(g, p);
115 109
diff --git a/kernel/sched.c b/kernel/sched.c
index 76080d142e3d..6fa9ea4ae44c 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4174,8 +4174,7 @@ static int migration_thread(void * data)
4174 struct list_head *head; 4174 struct list_head *head;
4175 migration_req_t *req; 4175 migration_req_t *req;
4176 4176
4177 if (current->flags & PF_FREEZE) 4177 try_to_freeze();
4178 refrigerator(PF_FREEZE);
4179 4178
4180 spin_lock_irq(&rq->lock); 4179 spin_lock_irq(&rq->lock);
4181 4180
diff --git a/kernel/signal.c b/kernel/signal.c
index d1258729a5f9..ca1186eef938 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -213,7 +213,7 @@ static inline int has_pending_signals(sigset_t *signal, sigset_t *blocked)
213fastcall void recalc_sigpending_tsk(struct task_struct *t) 213fastcall void recalc_sigpending_tsk(struct task_struct *t)
214{ 214{
215 if (t->signal->group_stop_count > 0 || 215 if (t->signal->group_stop_count > 0 ||
216 (t->flags & PF_FREEZE) || 216 (freezing(t)) ||
217 PENDING(&t->pending, &t->blocked) || 217 PENDING(&t->pending, &t->blocked) ||
218 PENDING(&t->signal->shared_pending, &t->blocked)) 218 PENDING(&t->signal->shared_pending, &t->blocked))
219 set_tsk_thread_flag(t, TIF_SIGPENDING); 219 set_tsk_thread_flag(t, TIF_SIGPENDING);
@@ -2231,8 +2231,7 @@ sys_rt_sigtimedwait(const sigset_t __user *uthese,
2231 current->state = TASK_INTERRUPTIBLE; 2231 current->state = TASK_INTERRUPTIBLE;
2232 timeout = schedule_timeout(timeout); 2232 timeout = schedule_timeout(timeout);
2233 2233
2234 if (current->flags & PF_FREEZE) 2234 try_to_freeze();
2235 refrigerator(PF_FREEZE);
2236 spin_lock_irq(&current->sighand->siglock); 2235 spin_lock_irq(&current->sighand->siglock);
2237 sig = dequeue_signal(current, &these, &info); 2236 sig = dequeue_signal(current, &these, &info);
2238 current->blocked = current->real_blocked; 2237 current->blocked = current->real_blocked;
diff --git a/mm/pdflush.c b/mm/pdflush.c
index 38ce279cc8cd..d6781951267e 100644
--- a/mm/pdflush.c
+++ b/mm/pdflush.c
@@ -105,7 +105,7 @@ static int __pdflush(struct pdflush_work *my_work)
105 spin_unlock_irq(&pdflush_lock); 105 spin_unlock_irq(&pdflush_lock);
106 106
107 schedule(); 107 schedule();
108 if (try_to_freeze(PF_FREEZE)) { 108 if (try_to_freeze()) {
109 spin_lock_irq(&pdflush_lock); 109 spin_lock_irq(&pdflush_lock);
110 continue; 110 continue;
111 } 111 }
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4b8e62a19370..1fa312a8db77 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1216,8 +1216,8 @@ static int kswapd(void *p)
1216 order = 0; 1216 order = 0;
1217 for ( ; ; ) { 1217 for ( ; ; ) {
1218 unsigned long new_order; 1218 unsigned long new_order;
1219 if (current->flags & PF_FREEZE) 1219
1220 refrigerator(PF_FREEZE); 1220 try_to_freeze();
1221 1221
1222 prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE); 1222 prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
1223 new_order = pgdat->kswapd_max_order; 1223 new_order = pgdat->kswapd_max_order;
diff --git a/net/rxrpc/krxiod.c b/net/rxrpc/krxiod.c
index 2b537f425a17..dada34a77b21 100644
--- a/net/rxrpc/krxiod.c
+++ b/net/rxrpc/krxiod.c
@@ -138,7 +138,7 @@ static int rxrpc_krxiod(void *arg)
138 138
139 _debug("### End Work"); 139 _debug("### End Work");
140 140
141 try_to_freeze(PF_FREEZE); 141 try_to_freeze();
142 142
143 /* discard pending signals */ 143 /* discard pending signals */
144 rxrpc_discard_my_signals(); 144 rxrpc_discard_my_signals();
diff --git a/net/rxrpc/krxsecd.c b/net/rxrpc/krxsecd.c
index 6020c89d9228..1aadd026d354 100644
--- a/net/rxrpc/krxsecd.c
+++ b/net/rxrpc/krxsecd.c
@@ -107,7 +107,7 @@ static int rxrpc_krxsecd(void *arg)
107 107
108 _debug("### End Inbound Calls"); 108 _debug("### End Inbound Calls");
109 109
110 try_to_freeze(PF_FREEZE); 110 try_to_freeze();
111 111
112 /* discard pending signals */ 112 /* discard pending signals */
113 rxrpc_discard_my_signals(); 113 rxrpc_discard_my_signals();
diff --git a/net/rxrpc/krxtimod.c b/net/rxrpc/krxtimod.c
index 249c2b0290bb..3ac81cdd1211 100644
--- a/net/rxrpc/krxtimod.c
+++ b/net/rxrpc/krxtimod.c
@@ -90,7 +90,7 @@ static int krxtimod(void *arg)
90 complete_and_exit(&krxtimod_dead, 0); 90 complete_and_exit(&krxtimod_dead, 0);
91 } 91 }
92 92
93 try_to_freeze(PF_FREEZE); 93 try_to_freeze();
94 94
95 /* discard pending signals */ 95 /* discard pending signals */
96 rxrpc_discard_my_signals(); 96 rxrpc_discard_my_signals();
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 05907035bc96..56db8f13e6cb 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1185,8 +1185,8 @@ svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout)
1185 arg->page_len = (pages-2)*PAGE_SIZE; 1185 arg->page_len = (pages-2)*PAGE_SIZE;
1186 arg->len = (pages-1)*PAGE_SIZE; 1186 arg->len = (pages-1)*PAGE_SIZE;
1187 arg->tail[0].iov_len = 0; 1187 arg->tail[0].iov_len = 0;
1188 1188
1189 try_to_freeze(PF_FREEZE); 1189 try_to_freeze();
1190 if (signalled()) 1190 if (signalled())
1191 return -EINTR; 1191 return -EINTR;
1192 1192
@@ -1227,7 +1227,7 @@ svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout)
1227 1227
1228 schedule_timeout(timeout); 1228 schedule_timeout(timeout);
1229 1229
1230 try_to_freeze(PF_FREEZE); 1230 try_to_freeze();
1231 1231
1232 spin_lock_bh(&serv->sv_lock); 1232 spin_lock_bh(&serv->sv_lock);
1233 remove_wait_queue(&rqstp->rq_wait, &wait); 1233 remove_wait_queue(&rqstp->rq_wait, &wait);