Re: [PATCH 0/3] v4 Improve task->comm locking situation

From: Tetsuo Handa
Date: Wed May 18 2011 - 01:27:23 EST


John Stultz wrote:
> So I think this approach is definitely worth trying. However, I think
> converting to RCU will be much easier once we've first converted all
> current comm users to making use of the get_task_comm accessor
> functions. In this way my hope is my current proposal will serve as a
> cleanup step before further optimizations can be done.

OK. But I guess converting all current comm users to making use of the
get_task_comm accessor is not easy because using get_task_comm() changes
locking dependency.

I think replacing

"%s", tsk->comm

with

"%ptc", tsk

(without using get_task_comm() inside pointer() because introducing a new lock
might cause problem since callers can be inside a delicate condition based on
the assumption that vsnprintf() will not block) should come first in order to
minimize direct ->comm users who may not be ready for this change.

After that, trying to replace

task->comm

with

char buf[TASK_COMM_LEN];
get_task_comm(task, buf)

(with cautions for already held locks) may be considered.



By the way,

sprintf(current->comm, "drbd%d_receiver", minor);

in drivers/block/drbd/drbd_receiver.c may be off-by-one
because DRBD_MINOR_COUNT_MAX is 256.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/