Re: [PATCH 1/2] break out page allocation warning code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 27 Apr 2011, john stultz wrote:

> So thinking further, this can be simplified by adding the seqlock first,
> and then retaining the task_locking only in the set_task_comm path until
> all comm accessors are converted to using get_task_comm.
> 

On second thought, I think it would be better to just retain using a 
spinlock but instead of using alloc_lock, introduce a new spinlock to 
task_struct for the sole purpose of protecting comm.

And, instead, of using get_task_comm() to write into a preallocated 
buffer, I think it would be easier in the vast majority of cases that 
you'll need to convert to just provide task_comm_lock(p) and 
task_comm_unlock(p) so that p->comm can be dereferenced safely.  
get_task_comm() could use that interface itself and then write into a 
preallocated buffer.

The problem with using get_task_comm() everywhere is it requires 16 
additional bytes to be allocated on the stack in hundreds of locations 
around the kernel which may or may not be safe.

--
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>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]