On Mon, 2011-04-18 at 13:25 -0700, David Rientjes wrote: > - provide a statically-allocated buffer to use for get_task_comm() and > copy current->comm over before printing it, or > > - take task_lock(current) to protect against /proc/pid/comm. > > The latter probably isn't safe because we could potentially already be > holding task_lock(current) during a GFP_ATOMIC page allocation. I'm not sure get_task_comm() is suitable, either. It takes the task lock: char *get_task_comm(char *buf, struct task_struct *tsk) { /* buf must be at least sizeof(tsk->comm) in size */ task_lock(tsk); strncpy(buf, tsk->comm, sizeof(tsk->comm)); task_unlock(tsk); return buf; } -- Dave -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx 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>