[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111109180900.GF1260@google.com>
Date: Wed, 9 Nov 2011 10:09:00 -0800
From: Tejun Heo <tj@...nel.org>
To: Andrea Arcangeli <aarcange@...hat.com>
Cc: Oleg Nesterov <oleg@...hat.com>,
"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
"Rafael J. Wysocki" <rjw@...e.com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, Jiri Slaby <jirislaby@...il.com>,
linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] thp: reduce khugepaged freezing latency
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists