From: Balbir Singh <bsingharora@gmail•com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux•vnet.ibm.com>
Cc: benh@kernel•crashing.org, paulus@samba•org, mpe@ellerman•id.au,
linuxppc-dev@lists•ozlabs.org
Subject: Re: [RFC PATCH 1/5] powerpc/mm/slice: Convert slice_mask high slice to a bitmap
Date: Wed, 8 Feb 2017 16:00:10 +0530 [thread overview]
Message-ID: <20170208103010.GD17068@localhost.localdomain> (raw)
In-Reply-To: <1486439333-22162-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
On Tue, Feb 07, 2017 at 09:18:49AM +0530, Aneesh Kumar K.V wrote:
> In followup patch we want to increase the va range which will result
> in us requiring high_slices to have more than 64 bits. To enable this
> convert high_slices to bitmap. We keep the number bits same in this patch
> and later change that to larger value
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux•vnet.ibm.com>
> ---
> arch/powerpc/include/asm/page_64.h | 15 +++---
> arch/powerpc/mm/slice.c | 106 ++++++++++++++++++++++++-------------
> 2 files changed, 76 insertions(+), 45 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
> index dd5f0712afa2..7f72659b7999 100644
> --- a/arch/powerpc/include/asm/page_64.h
> +++ b/arch/powerpc/include/asm/page_64.h
> @@ -98,19 +98,16 @@ extern u64 ppc64_pft_size;
> #define GET_LOW_SLICE_INDEX(addr) ((addr) >> SLICE_LOW_SHIFT)
> #define GET_HIGH_SLICE_INDEX(addr) ((addr) >> SLICE_HIGH_SHIFT)
>
> +#ifndef __ASSEMBLY__
> struct slice_mask {
> u16 low_slices;
Can we move low_slices as well, although we don't need it
it'll just make the code consistent.
> - u64 high_slices;
> + DECLARE_BITMAP(high_slices, 64);
> };
>
>
> static void slice_print_mask(const char *label, struct slice_mask mask)
> {
> - char *p, buf[16 + 3 + 64 + 1];
> + char *p, buf[SLICE_NUM_LOW + 3 + SLICE_NUM_HIGH + 1];
> int i;
>
> if (!_slice_debug)
> @@ -60,8 +55,12 @@ static void slice_print_mask(const char *label, struct slice_mask mask)
> *(p++) = ' ';
> *(p++) = '-';
> *(p++) = ' ';
> - for (i = 0; i < SLICE_NUM_HIGH; i++)
> - *(p++) = (mask.high_slices & (1ul << i)) ? '1' : '0';
> + for (i = 0; i < SLICE_NUM_HIGH; i++) {
> + if (test_bit(i, mask.high_slices))
> + *(p++) = '1';
> + else
> + *(p++) = '0';
> + }
Can we move to using %*pbl or bitmap_print_to_pagebuf
> *(p++) = 0;
>
>
Balbir Singh.
next prev parent reply other threads:[~2017-02-08 10:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 3:48 [RFC PATCH 0/5] Add support for larger address space for ppc64 Aneesh Kumar K.V
2017-02-07 3:48 ` [RFC PATCH 1/5] powerpc/mm/slice: Convert slice_mask high slice to a bitmap Aneesh Kumar K.V
2017-02-08 10:30 ` Balbir Singh [this message]
2017-02-07 3:48 ` [RFC PATCH 2/5] powerpc/mm/slice: Update the function prototype Aneesh Kumar K.V
2017-02-07 3:48 ` [RFC PATCH 3/5] powerpc/mm/hash: Move kernel context to the starting of context range Aneesh Kumar K.V
2017-02-07 3:48 ` [RFC PATCH 4/5] powerpc/mm/hash: Support 68 bit VA Aneesh Kumar K.V
2017-02-07 3:48 ` [RFC PATCH 5/5] powerpc/mm/hash: Increase VA range to 256TB Aneesh Kumar K.V
2017-02-07 4:06 ` Benjamin Herrenschmidt
2017-02-07 4:17 ` Aneesh Kumar K.V
2017-02-07 4:46 ` Benjamin Herrenschmidt
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=20170208103010.GD17068@localhost.localdomain \
--to=bsingharora@gmail$(echo .)com \
--cc=aneesh.kumar@linux$(echo .)vnet.ibm.com \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mpe@ellerman$(echo .)id.au \
--cc=paulus@samba$(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