UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
888 Views
Registered: ‎06-13-2011

Zynq-7000 Linux TLB and huge page support

We have a XC7Z100 device running the Xilinx Linux kernel (4.6.0-xilinx-22243-g8f0c7fe-dirty) from GitHub.  We are not currently using the Petalinux tools to generate the Linux build.  I am trying to enable huge pages support for the TLB to address a performance issue we have once we add "too much" data into some arrays; that are continually streamed; in our application.  These arrays are processed by a few C++ modules so it appears we are seeing TLB misses which are the cause of the performance issue.

 

The ARM A9 technical reference manual shows there is L2 TLB huge page support.  I have enabled the following in the kernel build.

    CONFIG_TRANSPARENT_HUGEPAGE=y
    CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
    CONFIG_HUGETLBFS=y
    CONFIG_HUGETLB_PAGE=y
 
After my Linux system boots, I don't see any evidence that huge page support is actually enabled.  A cat of /proc/meminfo does not show what you would typically see on a Linux system (below).
 

HugePages_Total:       0

HugePages_Free:        0

HugePages_Rsvd:        0

HugePages_Surp:        0

Hugepagesize:       2048 kB

 

Under /sys/kernel/mm I don't see any entries for    hugepages/  transparent_hugepage/

 

I have seen a reference (Google search) from 3 years ago that someone did a test of huge pages being enabled on a Z-7045 device that showed it supports an L2 TLB size of 128k, but it did not go into how the kernel was configured.

 

Am I missing something from the kernel configuration to get this enabled/working?

0 Kudos
4 Replies
Moderator
Moderator
844 Views
Registered: ‎04-24-2017

Re: Zynq-7000 Linux TLB and huge page support

Hi @sshoaf,

 

Your kernel config looks good. I'm not sure we tested with TLB and huge tables. I can check on this.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Moderator
Moderator
822 Views
Registered: ‎04-24-2017

Re: Zynq-7000 Linux TLB and huge page support

Hi @sshoaf,

 

I check with our kernel maintainer and Since ARM supports TLB it should work out.

 

Refer some pages.

https://wiki.linaro.org/LEG/ServerArchitecture/HugePages

https://github.com/lgeek/arm_tlb_huge_pages 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
798 Views
Registered: ‎06-13-2011

Re: Zynq-7000 Linux TLB and huge page support

Hi Sandeep,

 

Thank you for the information.  I started to look further into what the issue might be and did discover something.  The way the kernel Kconfig files are now, you can only get the TLB huge page support in the kernel if your ARM processor supports Large Page Address Extensions (LPAE).  The ARM Cortex-A9 in the Zynq-7000 does not support LPAE.  Here is a snippet from the Linux arch/arm/Kconfig file.

 

config SYS_SUPPORTS_HUGETLBFS

           def_bool y

           depends on ARM_LPAE

 

config HAVE_ARCH_TRANSPARENT_HUGEPAGE

           def_bool y

           depends on ARM_LPAE

 

I confirmed not being able to select the huge page support by downloading the Petalinux tools and the BSP's for the ZC706 and the ZCU102 FPGA's and ran the Petalinux menuconfig option for Linux.  The screenshots for each are attached, showing the ZC706 does not have the option available based on not having ARM_LPAE be true as there is no LPAE support in the A9.

 

One can not simply remove the depends on ARM_LPAE in the Kconfig file as this causes kernel build errors.  I don't know if you could run an ARM_LPAE enabled kernel on a processor that does not support it even if you would be accessing 1GB or less of memory for the processor.

 

This might not have a happy ending.

 

ZCU102 device

zcu102_kernel_config.png

 

ZC706 device

zc706_kernel_config.png

0 Kudos
Adventurer
Adventurer
767 Views
Registered: ‎06-13-2011

Re: Zynq-7000 Linux TLB and huge page support

Hi Sandeep,

 

Unless there is something I am missing, with the way the current kernel configuration files are, you cannot enable TLB huge page support in the kernel build unless your ARM device supports LPAE which the Cortex A9 in the Zynq-7000 does not support.

 

Did Xilinx ever test a kernel with TLB huge page support on the Zynq-7000? If so, how did the kernel build get configured?

 

Thanks,

 

Steve

0 Kudos