Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2031d0f5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge Christoph's freeze cleanup patch

parents 98e7f294 3e1d1d28
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -12,8 +12,7 @@ refrigerator. Code to do this looks like this:
	do {
	do {
		hub_events();
		hub_events();
		wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
		wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
		if (current->flags & PF_FREEZE)
		try_to_freeze();
			refrigerator(PF_FREEZE);
	} while (!signal_pending(current));
	} while (!signal_pending(current));


from drivers/usb/core/hub.c::hub_thread()
from drivers/usb/core/hub.c::hub_thread()
+1 −1
Original line number Original line Diff line number Diff line
@@ -164,7 +164,7 @@ place where the thread is safe to be frozen (no kernel semaphores
should be held at that point and it must be safe to sleep there), and
should be held at that point and it must be safe to sleep there), and
add:
add:


	try_to_freeze(PF_FREEZE);
       try_to_freeze();


If the thread is needed for writing the image to storage, you should
If the thread is needed for writing the image to storage, you should
instead set the PF_NOFREEZE process flag when creating the thread (and
instead set the PF_NOFREEZE process flag when creating the thread (and
+1 −3
Original line number Original line Diff line number Diff line
@@ -536,10 +536,8 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
	if (!user_mode(regs))
	if (!user_mode(regs))
		return 1;
		return 1;


	if (current->flags & PF_FREEZE) {
	if (try_to_freeze())
		refrigerator(0);
		goto no_signal;
		goto no_signal;
	}


	if (!oldset)
	if (!oldset)
		oldset = &current->blocked;
		oldset = &current->blocked;
+1 −3
Original line number Original line Diff line number Diff line
@@ -517,10 +517,8 @@ asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset)
	if ((regs->ccr & 0x10))
	if ((regs->ccr & 0x10))
		return 1;
		return 1;


	if (current->flags & PF_FREEZE) {
	if (try_to_freeze())
		refrigerator(0);
		goto no_signal;
		goto no_signal;
	}


	current->thread.esp0 = (unsigned long) regs;
	current->thread.esp0 = (unsigned long) regs;


+1 −1
Original line number Original line Diff line number Diff line
@@ -573,7 +573,7 @@ static int balanced_irq(void *unused)
	for ( ; ; ) {
	for ( ; ; ) {
		set_current_state(TASK_INTERRUPTIBLE);
		set_current_state(TASK_INTERRUPTIBLE);
		time_remaining = schedule_timeout(time_remaining);
		time_remaining = schedule_timeout(time_remaining);
		try_to_freeze(PF_FREEZE);
		try_to_freeze();
		if (time_after(jiffies,
		if (time_after(jiffies,
				prev_balance_time+balanced_irq_interval)) {
				prev_balance_time+balanced_irq_interval)) {
			preempt_disable();
			preempt_disable();
Loading