Re: [PATCH] thp: reduce khugepaged freezing latency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, Anrea.

On Wed, Nov 09, 2011 at 06:29:42PM +0100, Andrea Arcangeli wrote:
> My point is if what happens is:
> 
>    freezer CPU		   khugepaged
>    ------
>    assert freezing
>    wake_up(interruptible)
> 			   __set_current_state(interruptible)
> 			   schedule()
> 
> are we still hanging then?

Yeap, you're right.  I was thinking INTERRUPTILBE was being set before
try_to_freeze().

> And I think it's silly to use wait_event_freezable_timeout if I
> don't have any waitqueue to wait on.

I'm confused.  You're doing add_wait_queue() before
schedule_timeout_interruptible().  prepare_to_wait() is essentially
add_wait_queue() + set_current_state().  What am I missing?  ie. why
not do the following?

	prepare_to_wait(INTERRUPTIBLE);
	try_to_freeze();
	schedule_timeout();
	try_to_freeze();
	finish_wait();

or even simpler,

	wait_event_freezable_timeout(wq, false, timeout);

In terms of overhead, there is no appreciable difference from

	add_wait_queue();
	schedule_timeout_interruptible();
	remove_wait_queue()

Or is the logic there scheduled to change?

> +signed long __sched schedule_timeout_freezable(signed long timeout)
> +{
> +	do
> +		set_current_state(TASK_INTERRUPTIBLE);
> +	while (try_to_freeze());
> +	return schedule_timeout(timeout);
> +}
> +EXPORT_SYMBOL(schedule_timeout_freezable);

Hmmm... I don't know.  I really hope all freezable tasks stick to
higher level interface.  It's way too easy to get things wrong and eat
either freezing or actual wakeup condition.

Thank you.

-- 
tejun

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]