From: Michael Ellerman <mpe@ellerman•id.au>
To: Anshuman Khandual <khandual@linux•vnet.ibm.com>
Cc: linuxppc-dev@ozlabs•org, mikey@neuling•org
Subject: Re: [RFC 4/8] powerpc/slb: Add some helper functions to improve modularization
Date: Wed, 22 Jul 2015 19:19:50 +1000 [thread overview]
Message-ID: <1437556790.27712.5.camel@ellerman.id.au> (raw)
In-Reply-To: <1437461926-8908-4-git-send-email-khandual@linux.vnet.ibm.com>
On Tue, 2015-07-21 at 12:28 +0530, Anshuman Khandual wrote:
> From: "khandual@linux•vnet.ibm.com" <khandual@linux•vnet.ibm.com>
>
> This patch adds the following helper functions to improve modularization
> and readability of the code.
>
> (1) slb_invalid_all: Invalidates entire SLB
This reads badly. Although invalid can be a verb, the meaning of invalid as a
verb is not correct here. You want "invalidate".
> (2) slb_invalid_paca_slots: Invalidate SLB entries present in PACA
Ditto.
But, I think that's the wrong abstraction.
We should just have one routine, slb_invalidate(), which deals with all the
mess. ie. checking the MMU_FTR and the offset etc. So basically the whole
if/else.
> (3) kernel_linear_vsid_flags: VSID flags for kernel linear mapping
> (4) kernel_virtual_vsid_flags: VSID flags for kernel virtual mapping
I don't like these names either.
> diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
> index cbeaaa2..dcba4c2 100644
> --- a/arch/powerpc/mm/slb.c
> +++ b/arch/powerpc/mm/slb.c
> @@ -94,18 +94,37 @@ static inline void new_shadowed_slbe(unsigned long ea, int ssize,
> : "memory" );
> }
>
> +static inline unsigned long kernel_linear_vsid_flags(void)
> +{
> + return SLB_VSID_KERNEL | mmu_psize_defs[mmu_linear_psize].sllp;
> +}
mmu_linear_vsid_flags() ?
> +
> +static inline unsigned long kernel_virtual_vsid_flags(void)
> +{
> + return SLB_VSID_KERNEL | mmu_psize_defs[mmu_vmalloc_psize].sllp;
> +}
mmu_vmalloc_vsid_flags() ?
etc.
ie. have the function names match the mmu psize names. I don't think we need
"kernel" in the name, I think that's implied.
cheers
next prev parent reply other threads:[~2015-07-22 9:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 6:58 [RFC 1/8] powerpc/slb: Remove a duplicate extern variable Anshuman Khandual
2015-07-21 6:58 ` [RFC 2/8] powerpc/slb: Rename all the 'entry' occurrences to 'slot' Anshuman Khandual
2015-07-21 9:46 ` [RFC, " Michael Ellerman
2015-07-21 11:23 ` [RFC,2/8] " Anshuman Khandual
2015-07-21 6:58 ` [RFC 3/8] powerpc/slb: Define macros for the bolted slots Anshuman Khandual
2015-07-22 9:32 ` Michael Ellerman
2015-07-21 6:58 ` [RFC 4/8] powerpc/slb: Add some helper functions to improve modularization Anshuman Khandual
2015-07-22 9:19 ` Michael Ellerman [this message]
2015-07-21 6:58 ` [RFC 5/8] powerpc/slb: Add documentation to runtime patching of SLB encoding Anshuman Khandual
2015-07-22 5:51 ` Michael Ellerman
2015-07-22 5:57 ` Gabriel Paubert
2015-07-22 9:01 ` Michael Ellerman
2015-07-22 12:17 ` Segher Boessenkool
2015-07-21 6:58 ` [RFC 6/8] powerpc/prom: Simplify the logic while fetching SLB size Anshuman Khandual
2015-07-21 10:21 ` [RFC, " Michael Ellerman
2015-07-21 11:24 ` Anshuman Khandual
2015-07-21 6:58 ` [RFC 7/8] powerpc/xmon: Drop 'valid' from the condition inside 'dump_segments' Anshuman Khandual
2015-07-21 10:00 ` [RFC, " Michael Ellerman
2015-07-21 11:45 ` Anshuman Khandual
2015-07-22 4:52 ` Michael Ellerman
2015-07-21 6:58 ` [RFC 8/8] powerpc/xmon: Add some more elements to the existing PACA dump list Anshuman Khandual
2015-07-21 10:08 ` [RFC, " Michael Ellerman
2015-07-21 11:48 ` Anshuman Khandual
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=1437556790.27712.5.camel@ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=khandual@linux$(echo .)vnet.ibm.com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=mikey@neuling$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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