Re: [PATCH 1/1] SGI UV: TLB shootdown using broadcast assist unit

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Molnar
Date: Monday, June 2, 2008 - 8:01 am

* Cliff Wickman <cpw@sgi.com> wrote:


looks mostly good to me, but there are a few code structure and 
stylistic nits:


one tab too many.


shouldnt these be __read_mostly ?


'fw' is int here, while uv_write_local_mmr() takes 'unsigned long', so 
'fw' will be sign-extended. It's better to use the natural type of such 
values, even if you only fill in low bits. (otherwise it can later on 
result in unexpected results if the u32 value here has bit 31 set.)


use a:

		if (!(...))
			continue;

construct to make the function more readable and to save an indentation 
level. Possibly split the iterator body into a separate function as 
well.


this function needs to be broken up into smaller ones.


unnecessary paranthesis.


use such comment style:

 /*
  * Comment
  */

(this applies to many other places in this file as well)


dont use ktime_get() in performance-sensitive code, it can get _really_ 
expensive if GTOD falls back to pmtimer or hpet or other southbridge-ish 
time methods.


do something like this for structure initialization:


to make it easier to read.


static variable in the middle of file - data should move up to the 
header portion of the file, or this functionality should go into a 
separate file if it's well-isolated.


unnecessary line break. (applies to many other function definitions in 
this file too)


static variable hidden in function. It should move into head of the file 
instead.


why is this modular?


function way too large - per node initialization should go into a helper 
function to reduce function linecount and complexity.


unnecessary newline in front of __initcall().


please use the style and alignment found in other areas of 
include/asm-x86, such as include/asm-x86/processor.h. (applies to other 
areas of this patch as well)


this (and the other atomic_*() additions) should go into atomic.h 
instead.


function prototypes in headers should use 'extern'.



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

Messages in current thread:
Re: [PATCH 1/1] SGI UV: TLB shootdown using broadcast assi ..., Ingo Molnar, (Mon Jun 2, 8:01 am)