mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Cliff Wickman <cpw@sgi.com>
Cc: linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] x86: UV uv_tlb.c cleanup
Date: Tue, 17 May 2011 21:04:45 +0200	[thread overview]
Message-ID: <20110517190445.GB29574@elte.hu> (raw)
In-Reply-To: <E1QML7f-00070E-36@eag09.americas.sgi.com>


Ok, looks like some good first steps. I have a few more nits below, of things 
that occur still quite widely in the UV driver files:

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

> +static void write_global_mmr_activation(int pnode, unsigned long mmr_image)
> +{
> +	uv_write_global_mmr64(pnode, UVH_LB_BAU_SB_ACTIVATION_CONTROL,
> +								mmr_image);

Please *never* break a line at the end line that just because checkpatch.pl 
complains.

Instead try to make uv_write_global_mmr64() shorter, it's used in quite a few 
places!

Something like:

	write_gmmr8()
	write_gmmr64()
	write_lmmr64()

would still be pretty obvious and is a lot shorter! I applied two tricks:

 - The 'MMR' is an UV specific term of art *anyway* which you have to know if
   you are reading this code, so making it 'LMMR' for local and 'GMMR' for 
   global MMRs is an obvious extension to the abbreviation you are using already.

 - You do not have to prefix everything with uv_() !! Only APIs you really need
   to export to other code like the infamous is_uv_system() flag. These 
   functions are used in files named uv_something.c anyway, and 'MMR' is an UV
   concept, so the uv_ prefix was absolutely unnecessary screen bloat.

Please propagate the uv_ removal to all other places - there's a lot of 
functions that have it needlessly.

Likewise, you can propagate these concepts to the naming of the other MMR 
handling functions as well - for example would turn into 
write_gmmr_activation() - which is nicer to read and type than 
write_global_mmr_activation().

I think with that and with your other cleanups you have already done the code 
will already be a lot more readable.

One more request, could you please make structure fields aligned vertically? 
I.e. use something like:

struct msg_desc {
	struct bau_payload_queue_entry	*msg;
	int				msg_slot;
	int				swack_slot;
	struct bau_payload_queue_entry	*va_queue_first;
	struct bau_payload_queue_entry	*va_queue_last;
};

Have a look at arch/x86/include/asm/processor.h for more examples.

Also, *please* notice and fix too long structure names like the 
bau_payload_queue_entry above. Commonly used names like that should be tightly 
named - so for example could it be 'struct bau_pq_entry'? If that's descriptive 
enough for you then it could be:

struct msg_desc {
	struct bau_pq_entry		*msg;
	int				msg_slot;
	int				swack_slot;
	struct bau_pq_entry		*va_queue_first;
	struct bau_pq_entry		*va_queue_last;
};

Also, what does the 'va_' prefix mean above? Virtual address? Why does 'msg' 
have no prefix?

Thanks,

	Ingo

      reply	other threads:[~2011-05-17 19:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 14:19 Cliff Wickman
2011-05-17 19:04 ` Ingo Molnar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110517190445.GB29574@elte.hu \
    --to=mingo@elte.hu \
    --cc=cpw@sgi.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®