Re: [PATCH 2/6] x86/platform/uv/BAU: Add status_mmr_loc to locate message status bits

From: Andrew Banman
Date: Thu Feb 16 2017 - 16:53:57 EST




On 02/16/2017 12:07 PM, Thomas Gleixner wrote:
On Tue, 14 Feb 2017, Andrew Banman wrote:

The location of the ERROR and BUSY status bits depends on the descriptor
index, i.e. the CPU, of the message. We determine this location ahead of
the wait_completion loop to avoid repeating the calculation.

Split out the status location calculation into a new routine,
status_mmr_loc, to be used within each uv*_wait_completion routine.

And the reason for this is? You just tell WHAT you are doing, not the WHY.

Looking at the patch which implements the uv4 wait function it uses the
thing as well. So for the casual reader there is no point.

The only reason i figured why you want to do that is to reduce the number
of arguments to the wait function, correct?

If yes, then spell it out. If no, please enlighten me.

Yes, the purpose was to re-scope the mmr location-finding logic into the uv*_wait_completion routines to make the call to wait_completion less complicated.

Though, on second thought, the *mmr and *index values in status_mmr_loc should really be set during initialization because they do not change. The calculation is always done with desc=uvhub_cpu.

I would add status_mmr and status_index to struct bau_control and move the calculation to scan_sock; there's no need for a subroutine in this case.

Thanks,

Andrew Banman


Thanks,

tglx