On Wed 10-09-14 00:23:36, Tejun Heo wrote:
> On Tue, Sep 09, 2014 at 05:16:55PM +0200, Michal Hocko wrote:
> > But OOM killer doesn't kill kernel threads as they do not own any
> > memory. So the check should be safe, no?
> 
> Even for userland tasks, try_to_freeze() can currently be anywhere in
> the kernel.  The frequently used ones are few but there are some odd

I always thought that user space tasks can be in the fridge only on the
way out from the kernel (get_signal_to_deliver). I have quickly greped
the code and the only place I can see seems to be run_guest but that
one bails out quickly when there are signals pending so it should be
safe in this context.
cifs is doing something suspicious (cifs_reconnect) but I didn't check
more closely all the contexts it is called from.

> ones out, and, again, there's nothing enforcing any structure on
> try_to_freeze() usage. 

Would it make sense to have try_to_freeze_user_task or similar and check
for kernel thread in try_to_freeze and complain loudly if called from
user task context? I mean does it even make sense to call try_to_freeze
in the middle of kernel operation for a user task?

> The other thing is that we may do quite a bit during exiting including
> allocating memory. 

yes, we can allocate memory and even page fault on the exit path. But
TIF_MEMDIE will make sure that the allocation will be successful if
there is some memory left.

> Are those safe for system PM?  Rafael, what exactly are the rules for
> PM?  What shouldn't change?
> 
> Thanks.
> 
> -- 
> tejun

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to