[lkml]   [2007]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/7] Freezer: Read PF_BORROWED_MM in a nonracy way
On 05/11, Linus Torvalds wrote:
> On Sat, 12 May 2007, Oleg Nesterov wrote:
> >
> > things change, ->mm is not stable if the kernel thread does use_mm/unuse_mm.
> ->mm is not stable *regardless*!
> Trivial examples:
> - kernel thread does execve()
> - user thread does exit().

Yes sure. Quoting myself,
> true->false means daemonize() or do_exit(), seems harmless.
> false->true means exec from kernel space. That is why FREEZER_KERNEL_THREADS
> in fact means all tasks, not only kernel threads.

> The use "use_mm()" and "unuse_mm()" things are total red herrings.
> If the freezer depends on the difference between user and kernel threads,
> then THAT PATCH IS BUGGY. It's that simple.

This is another story, I can't comment because I am not educated enough.

However, in my opininon THAT PATCH has nothing to do with this problem.
It just improves the code that we already have.

> > However, the return value == 0 does not change in that particular case,
> > exactly because is_user_space() takes task_lock().
> As does exit_mm() etc.

Note the "in that particular case".

> See? The locking was pointless. Exactly because you release the lock
> before the user can actually do anything about the return value!

Yes. See the "Quoting myself" above.

> Anyway, I think the whole freezer thing is broken. There's no reason to
> freeze kernel threads.

It is not perfect. Rafael tries to improve it.

Do we need freezer? Should we freeze kernel threads? I can't judge. I tried
to read a long thread about suspend, and failed to understand it.

I personally think we can simplify things if CPU-hotplug use freezer, at least.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-05-12 02:43    [W:0.106 / U:0.692 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site