Re: [PATCH v1 4/10] User Space Breakpoint Assistance Layer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Monday, March 22, 2010 - 6:40 pm

On Sat, 20 Mar 2010 19:55:41 +0530 Srikar Dronamraju <srikar@linux.vnet.ibm.com> wrote:


A quick scan, just to show I was paying attention ;)


You may as well finish off the kerneldoc on some of these functions.


copy_from_user() takes and returns an unsigned long arg but this
function is converting these to and from ints.  That's OK if we're 100%
sure that we'll never get or return an arg >2G.  Otherwise things could
get ghastly.  Please have a think.  (Dittoes for some other functionss
around here).


This looks like it has the wrong interface.  It should take a `void
__user *vaddr'.  If any casting is to be done, it should be done at the
highest level so that sparse can check that the thing is used correctly
in as many places as possible.


The inline is either unneeded or undesirable, I suspect.


It might be smarter to allocate this page outside the mmap_sem region. 
More scalable, less opportunity for weird deadlocks.


kmap_atomic() is preferred - it's faster.  kmap() is still deadlockable
I guess if a process ever kmaps two pages at the same time.  This code
doesn't do that, but kmap is still a bit sucky.


It used to be the case that the above linebreak is "wrong".  (Nobody
ever tests their kerneldoc output!) I have a vague feeling that this
might have been fixed lately.  Randy?


If this BUG_ON triggers, we won't know which of these pointers was NULL,
which makes us sad.


ditto.

Really, there's never much point in

	BUG_ON(!some_pointer);

Just go ahead and dereference the pointer.  If it's NULL then we'll get
an oops which gives all the information which the BUG_ON would have
given.


More dittoes.  It's just bloat.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v1 0/10] Uprobes patches., Srikar Dronamraju, (Sat Mar 20, 7:24 am)
[PATCH v1 1/10] Move Macro W to insn.h, Srikar Dronamraju, (Sat Mar 20, 7:25 am)
[PATCH v1 2/10] Move replace_page() to mm/memory.c, Srikar Dronamraju, (Sat Mar 20, 7:25 am)
[PATCH v1 3/10] Enhance replace_page() to support pagecache, Srikar Dronamraju, (Sat Mar 20, 7:25 am)
[PATCH v1 4/10] User Space Breakpoint Assistance Layer, Srikar Dronamraju, (Sat Mar 20, 7:25 am)
[PATCH v1 5/10] X86 details for user space breakpoint assi ..., Srikar Dronamraju, (Sat Mar 20, 7:25 am)
[PATCH v1 6/10] Slot allocation for Execution out of line, Srikar Dronamraju, (Sat Mar 20, 7:26 am)
[PATCH v1 7/10] Uprobes Implementation, Srikar Dronamraju, (Sat Mar 20, 7:26 am)
[PATCH v1 8/10] X86 details for uprobes., Srikar Dronamraju, (Sat Mar 20, 7:26 am)
[PATCH v1 9/10] Uprobes Documentation patch, Srikar Dronamraju, (Sat Mar 20, 7:26 am)
[PATCH v1 10/10] Uprobes samples., Srikar Dronamraju, (Sat Mar 20, 7:26 am)
Re: [PATCH v1 1/10] Move Macro W to insn.h, Masami Hiramatsu, (Sat Mar 20, 8:50 am)
Re: [PATCH v1 9/10] Uprobes Documentation patch, Randy Dunlap, (Sun Mar 21, 8:00 pm)
Re: [PATCH v1 9/10] Uprobes Documentation patch, Srikar Dronamraju, (Sun Mar 21, 10:34 pm)
Re: [PATCH v1 1/10] Move Macro W to insn.h, Srikar Dronamraju, (Sun Mar 21, 11:24 pm)
Re: [PATCH v1 1/10] Move Macro W to insn.h, Masami Hiramatsu, (Mon Mar 22, 7:11 am)
Re: [PATCH v1 9/10] Uprobes Documentation patch, Randy Dunlap, (Mon Mar 22, 7:51 am)
Re: [PATCH v1 0/10] Uprobes patches., Andrew Morton, (Mon Mar 22, 6:38 pm)
Re: [PATCH v1 4/10] User Space Breakpoint Assistance Layer, Andrew Morton, (Mon Mar 22, 6:40 pm)
Re: [PATCH v1 0/10] Uprobes patches., Srikar Dronamraju, (Tue Mar 23, 3:55 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Peter Zijlstra, (Tue Mar 23, 4:01 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Peter Zijlstra, (Tue Mar 23, 4:04 am)
Re: [PATCH v1 4/10] User Space Breakpoint Assistance Layer, Srikar Dronamraju, (Tue Mar 23, 4:26 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Srikar Dronamraju, (Tue Mar 23, 5:23 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Peter Zijlstra, (Tue Mar 23, 6:46 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Masami Hiramatsu, (Tue Mar 23, 7:20 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Ananth N Mavinakayan ..., (Tue Mar 23, 8:05 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Peter Zijlstra, (Tue Mar 23, 8:15 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Peter Zijlstra, (Tue Mar 23, 8:15 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Frank Ch. Eigler, (Tue Mar 23, 8:26 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Masami Hiramatsu, (Tue Mar 23, 10:36 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Ananth N Mavinakayan ..., (Tue Mar 23, 10:59 pm)
Re: [PATCH v1 7/10] Uprobes Implementation, Srikar Dronamraju, (Wed Mar 24, 12:58 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Srikar Dronamraju, (Wed Mar 24, 3:22 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Peter Zijlstra, (Wed Mar 24, 6:00 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Srikar Dronamraju, (Thu Mar 25, 12:56 am)
Re: [PATCH v1 7/10] Uprobes Implementation, Srikar Dronamraju, (Thu Mar 25, 1:41 am)