Large Page support disabled on Raspberry Pi kernels

Bug #1933532 reported by Karsten Necke
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux-raspi (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Fix Released
Undecided
Juerg Haefliger

Bug Description

[ Impact ]

It appears that large page support and transparent hugepages are disabled in config on the Raspberry Pi. It would be nice if they were enabled in the kernel configuration, even if they are disabled by default. Then they could be set in user-editable config via the "transparent_hugepage" boot option.

With 4GB hardware in this family, there might be valid uses for large pages.

root@ubuntu:/home/ubuntu# hugeadm --explain
hugeadm:ERROR: kernel does not support huge pages

root@ubuntu:/home/ubuntu# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal

root@ubuntu:/home/ubuntu# uname -a
Linux ubuntu 5.4.0-1038-raspi #41-Ubuntu SMP PREEMPT Thu Jun 17 14:14:11 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

root@ubuntu:/home/ubuntu# grep -i huge /boot/config-5.4.0-1038-raspi
CONFIG_SYS_SUPPORTS_HUGETLBFS=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_HUGE_VMAP=y
# CONFIG_TRANSPARENT_HUGEPAGE is not set
# CONFIG_HUGETLBFS is not set

[ Test Case ]

See above:

[ Fix ]

Enable HUGETLBFS and TRANSPARENT_HUGEPAGE to match the master kernel and hirsure and later raspi kernels.

[ Where Problems Could Occur ]

Thess configs enable code that is disabled by default. However, there is minimal stub code running at boot so problems would most likely show up as splats during boot or later on when hugetlbfs is explicitly mounted by systemd.

Juerg Haefliger (juergh)
affects: linux-raspi-5.4 (Ubuntu) → linux-raspi (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-raspi (Ubuntu Focal):
status: New → Confirmed
Changed in linux-raspi (Ubuntu):
status: New → Confirmed
Revision history for this message
Michal Babej (rakka) wrote :

Would also appreciate if this was enabled.

Have a RPi4 with 8GB that runs Rosetta (from BOINC) with idle priority. The tasks eat about 1G ram each; with 4 running there are quite a few TLB misses:

root@vadelma:~# perf stat -I 1000 -e dTLB-load-misses,dTLB-store-misses,iTLB-load-misses -a
# time counts unit events
   1.000395577 16,504,784 dTLB-load-misses
   1.000395577 1,562,981 dTLB-store-misses
   1.000395577 193,640 iTLB-load-misses
   2.001569068 18,044,238 dTLB-load-misses
   2.001569068 1,524,714 dTLB-store-misses
   2.001569068 86,710 iTLB-load-misses
   3.002516807 14,502,850 dTLB-load-misses
   3.002516807 1,527,325 dTLB-store-misses
   3.002516807 189,333 iTLB-load-misses
   4.003480550 27,343,138 dTLB-load-misses
   4.003480550 1,542,708 dTLB-store-misses
   4.003480550 118,987 iTLB-load-misses

After recompiling the kernel with transparent hugepages and enabling them:

root@vadelma:~# perf stat -I 1000 -e dTLB-load-misses,dTLB-store-misses,iTLB-load-misses -a
# time counts unit events
     1.000446250 6,559,299 dTLB-load-misses
     1.000446250 78,022 dTLB-store-misses
     1.000446250 615,533 iTLB-load-misses
     2.001771713 7,980,471 dTLB-load-misses
     2.001771713 172,949 dTLB-store-misses
     2.001771713 837,294 iTLB-load-misses
     3.002796124 6,795,584 dTLB-load-misses
     3.002796124 84,586 dTLB-store-misses
     3.002796124 760,424 iTLB-load-misses

Average TLB misses are down about 2/3 while IPC is slightly up, by 8-10%.

I'm perfectly fine if it's disabled by default, but it would be nice to not have to recompile the kernel.

Juerg Haefliger (juergh)
Changed in linux-raspi (Ubuntu):
status: Confirmed → Invalid
Changed in linux-raspi (Ubuntu Focal):
status: Confirmed → In Progress
assignee: nobody → Juerg Haefliger (juergh)
description: updated
Juerg Haefliger (juergh)
Changed in linux-raspi (Ubuntu Focal):
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-raspi/5.4.0-1053.60 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
Karsten Necke (chk0301) wrote :

problem is solved, change tag to 'verification-done-focal'
many thanks
Karsten

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (16.9 KiB)

This bug was fixed in the package linux-raspi - 5.4.0-1053.60

---------------
linux-raspi (5.4.0-1053.60) focal; urgency=medium

  * focal/linux-raspi: 5.4.0-1053.60 -proposed tracker (LP: #1959271)

  * Kernel fails to boot in ScalingStack (LP: #1959102)
    - [Config] raspi: Set VIRTIO_PCI=m

  * Large Page support disabled on Raspberry Pi kernels (LP: #1933532)
    - [Config] raspi: Set HUGETLBFS=y and TRANSPARENT_HUGEPAGE=y

  [ Ubuntu: 5.4.0-100.113 ]

  * focal/linux: 5.4.0-100.113 -proposed tracker (LP: #1959900)
  * CVE-2022-22942
    - SAUCE: drm/vmwgfx: Fix stale file descriptors on failed usercopy
  * CVE-2022-0330
    - drm/i915: Flush TLBs before releasing backing store
  * Focal update: v5.4.166 upstream stable release (LP: #1957008)
    - netfilter: selftest: conntrack_vrf.sh: fix file permission
    - Linux 5.4.166
    - net/packet: rx_owner_map depends on pg_vec
    - USB: gadget: bRequestType is a bitfield, not a enum
    - HID: holtek: fix mouse probing
    - udp: using datalen to cap ipv6 udp max gso segments
    - selftests: Calculate udpgso segment count without header adjustment
  * Focal update: v5.4.165 upstream stable release (LP: #1957007)
    - serial: tegra: Change lower tolerance baud rate limit for tegra20 and
      tegra30
    - ntfs: fix ntfs_test_inode and ntfs_init_locked_inode function type
    - HID: quirks: Add quirk for the Microsoft Surface 3 type-cover
    - HID: google: add eel USB id
    - HID: add hid_is_usb() function to make it simpler for USB detection
    - HID: add USB_HID dependancy to hid-prodikeys
    - HID: add USB_HID dependancy to hid-chicony
    - HID: add USB_HID dependancy on some USB HID drivers
    - HID: bigbenff: prevent null pointer dereference
    - HID: wacom: fix problems when device is not a valid USB device
    - HID: check for valid USB device for many HID drivers
    - can: kvaser_usb: get CAN clock frequency from device
    - can: kvaser_pciefd: kvaser_pciefd_rx_error_frame(): increase correct
      stats->{rx,tx}_errors counter
    - can: sja1000: fix use after free in ems_pcmcia_add_card()
    - nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done
    - selftests: netfilter: add a vrf+conntrack testcase
    - vrf: don't run conntrack on vrf with !dflt qdisc
    - bpf: Fix the off-by-two error in range markings
    - ice: ignore dropped packets during init
    - bonding: make tx_rebalance_counter an atomic
    - nfp: Fix memory leak in nfp_cpp_area_cache_add()
    - seg6: fix the iif in the IPv6 socket control block
    - udp: using datalen to cap max gso segments
    - iavf: restore MSI state on reset
    - iavf: Fix reporting when setting descriptor count
    - IB/hfi1: Correct guard on eager buffer deallocation
    - mm: bdi: initialize bdi_min_ratio when bdi is unregistered
    - ALSA: ctl: Fix copy of updated id with element read/write
    - ALSA: hda/realtek - Add headset Mic support for Lenovo ALC897 platform
    - ALSA: pcm: oss: Fix negative period/buffer sizes
    - ALSA: pcm: oss: Limit the period size to 16MB
    - ALSA: pcm: oss: Handle missing errors in snd_pcm_oss_change_params*()
    - btrfs: clear extent buffer uptodate when we fail to write i...

Changed in linux-raspi (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.