Re: current->state after kmalloc

From: arjan@fenrus.demon.nl
Date: Mon Feb 04 2002 - 19:23:16 EST


In article <16Xt8Y-1SQ44eC@fwd04.sul.t-online.com> you wrote:

> set_current_state(TASK_INTERRUPTIBLE);
> kmalloc(sizeof(struct x), GFP_KERNEL);

> what is current->state after kmalloc ?

undefined. If kmalloc slept and you survived (due to setting
TASK_INTERRUPTIBLE that's not guaranteed) then it'll most likely be
TASK_RUNNING.
If you depend on this your kernel code is broken in that has subtle
dependencies on unspecified behavior and will break whenever kmalloc changes
internal behavior.

Greetings,
   Arjan van de Ven

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



This archive was generated by hypermail 2b29 : Thu Feb 07 2002 - 21:00:39 EST