linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [ltc-interlock] [PATCH] hugetlb: Fix hot remove for PowerVM
       [not found] <1500997831-19173-1-git-send-email-diegodo@linux.vnet.ibm.com>
@ 2017-07-26  4:35 ` Aneesh Kumar K.V
  0 siblings, 0 replies; only message in thread
From: Aneesh Kumar K.V @ 2017-07-26  4:35 UTC (permalink / raw)
  To: Diego Domingos, linux-mm; +Cc: ltc-interlock, linuxppc-dev

Diego Domingos <diegodo@linux.vnet.ibm.com> writes:

> PowerVM has support for 16G huge pages, so the function
> gigantic_page_supported needs to check if the running system
> is a pseries and check if there are some gigantic page
> registered. Then, we must return true - avoiding Segmentation
> Fault when hot removing memory sections within huge pages.

That is not correct. Those pages are not in zone/buddy. What
gigantic_page_supported checks is whether we can allocate pages runtime.
We scan the zones, check if we have the range that we are looking for
free for allocation, if so we do runtime allocation of those pages. This
may include page migration too. But these pages comes from buddy. We
don't do buddy allocator directly here, because the order of allocation
we are looking is more than max order.

>
> Signed-off-by: Diego Domingos <diegodo@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/book3s/64/hugetlb.h | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/hugetlb.h b/arch/powerpc/include/asm/book3s/64/hugetlb.h
> index 5c28bd6..49e43dd 100644
> --- a/arch/powerpc/include/asm/book3s/64/hugetlb.h
> +++ b/arch/powerpc/include/asm/book3s/64/hugetlb.h
> @@ -1,3 +1,5 @@
> +#include <asm/machdep.h>
> +
>  #ifndef _ASM_POWERPC_BOOK3S_64_HUGETLB_H
>  #define _ASM_POWERPC_BOOK3S_64_HUGETLB_H
>  /*
> @@ -54,9 +56,19 @@ static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
>  #ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
>  static inline bool gigantic_page_supported(void)
>  {
> +        struct hstate *h;
> +
>  	if (radix_enabled())
>  		return true;
> -	return false;
> +
> +        /* PowerVM can support 16GB hugepages (requested at boot time) */
> +        if(machine_is(pseries))
> +            for_each_hstate(h) {
> +                if (hstate_get_psize(h) == MMU_PAGE_16G)
> +                    return true;
> +            }
> +        
> +        return false;
>  }
>  #endif
>
> -- 
> 1.8.3.1
>
> _______________________________________________________
> ltc-interlock mailing list <ltc-interlock@lists.linux.ibm.com>
> To unsubscribe from the list, change your list options
> or if you have forgotten your list password visit:
> https://w3-01.ibm.com/stg/linux/ltc/mailinglists/listinfo/ltc-interlock

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-26  4:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1500997831-19173-1-git-send-email-diegodo@linux.vnet.ibm.com>
2017-07-26  4:35 ` [ltc-interlock] [PATCH] hugetlb: Fix hot remove for PowerVM Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).