Port OOM changes into do_page_fault for arm

Bug #951043 reported by Tobin Davis on 2012-03-09
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Medium
Paolo Pisati
Precise
Undecided
Unassigned
linux-armadaxp (Ubuntu)
Medium
Ike Panhc
Precise
Undecided
Unassigned
linux-ti-omap4 (Ubuntu)
Medium
Paolo Pisati
Precise
Undecided
Unassigned

Bug Description

SRU JUSTIFICATION
=================

EFFECT
======

Reduce mmap_sem lock contention on arm while using java (see below)

FIX
===

see the attached patch

TEST
====

This commit has already been incorporated/tested in the armadaxp kernel and impacts
only the arm side of master, proposing for P/master (omap4 will get it via
rebase).

---

A patch upstream landed on 2011-12-6 that reduces the mmap_sem hold time, which is crucial
during OOM killer invocation. It would be very beneficial if this patch could get pulled into all supported arm precise kernels.

See http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7178/1 for details on the patch. The upstream git commit is http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=8878a539ff19a43cf3729e7562cd528f490246ae

I have attached the raw patch as well for review.

Tobin Davis (gruemaster) wrote :
Changed in linux (Ubuntu):
importance: Undecided → Medium
Changed in linux-armadaxp (Ubuntu):
importance: Undecided → Medium
Changed in linux-ti-omap4 (Ubuntu):
importance: Undecided → Medium
tags: added: no-bot-spam

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 951043

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Tobin Davis (gruemaster) on 2012-03-09
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
tags: added: bot-stop-nagging
removed: no-bot-spam
tags: added: patch
Launchpad Janitor (janitor) wrote :

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

Changed in linux-armadaxp (Ubuntu):
status: New → Confirmed
Changed in linux-ti-omap4 (Ubuntu):
status: New → Confirmed
Tobin Davis (gruemaster) on 2012-03-14
Changed in linux (Ubuntu):
assignee: nobody → Paolo Pisati (p-pisati)
Changed in linux-ti-omap4 (Ubuntu):
assignee: nobody → Paolo Pisati (p-pisati)
Changed in linux-armadaxp (Ubuntu):
assignee: nobody → Bryan Wu (cooloney)
Xerxes Rånby (xranby) wrote :

I think there is an inconsistency in this patch that can cause a deadlock:

Consider that the code first takes the &mm->mmap_sem lock during if (!down_read_trylock(&mm->mmap_sem)) {

@@ -305,6 +297,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
  if (!down_read_trylock(&mm->mmap_sem)) {
   if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
    goto no_context;
+retry:
   down_read(&mm->mmap_sem);
  } else {
   /*
@@ -320,14 +313,41 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 #endif
  }

and then later manage to take the goto retry;
this will will cause a deadlock when trying to take the &mm->mmap_sem twice.

+ if (flags & FAULT_FLAG_ALLOW_RETRY) {
+ if (fault & VM_FAULT_MAJOR) {
+ tsk->maj_flt++;
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
+ regs, addr);
+ } else {
+ tsk->min_flt++;
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
+ regs, addr);
+ }
+ if (fault & VM_FAULT_RETRY) {
+ /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
+ * of starvation. */
+ flags &= ~FAULT_FLAG_ALLOW_RETRY;
+ goto retry;
+ }
+ }
+
+ up_read(&mm->mmap_sem);

Xerxes Rånby (xranby) wrote :

the issue in #5 can get easily fixed by adding a
up_read(&mm->mmap_sem);
before the goto retry;

...
+ up_read(&mm->mmap_sem);
+ goto retry;
+ }
+ }
+
+ up_read(&mm->mmap_sem);

Ike Panhc (ikepanhc) on 2012-04-03
Changed in linux-armadaxp (Ubuntu):
assignee: Bryan Wu (cooloney) → Ike Panhc (ikepanhc)
Ike Panhc (ikepanhc) on 2012-04-03
Changed in linux-armadaxp (Ubuntu):
status: Confirmed → In Progress
Launchpad Janitor (janitor) wrote :
Download full text (5.3 KiB)

This bug was fixed in the package linux-armadaxp - 3.2.0-1602.5

---------------
linux-armadaxp (3.2.0-1602.5) precise; urgency=low

  [ Ike Panhc ]

  * Remove unnecessary debug message
    - LP: #960340
  * Rebase onto Ubuntu-3.2.0-22.35

  [ Stefan Bader ]

  * d-i: Fix module name for dm-raid45
    - LP: #969248

  [ Upstream Kernel Changes ]

  * ARM: 7178/1: fault.c: Port OOM changes into do_page_fault
    - LP: #951043

  [ Ubuntu: 3.2.0-22.35 ]

  * Revert "SAUCE: hotkey quirks for various Zeptro Znote and Fujitsu Amilo
    laptops"
  * SAUCE: (no-up) elide some ioctl warnings which are known benign
    - LP: #972355
  * SAUCE (no-up) Provide a param for allowing the BIOS to handle changing
    the brightness on AC/battery status changes.
    - LP: #949311
  * SAUCE (drop after 3.4) Quirk for enabling backlight hotkeys on Samsung
    N150P
    - LP: #875893
  * SAUCE: PCI: Allow pcie_aspm=force to work even when FADT indicates it
    is unsupported
    - LP: #962038
  * SAUCE: (drop after 3.5) drm/i915: reinstate GM45 TV detection fix
    - LP: #638939
  * SAUCE: SECCOMP: audit: always report seccomp violations
  * SAUCE: SECCOMP: adjust prctl constant
  * [Config] Enable CONFIG_USBIP_CORE=m
    - LP: #900384
  * Rebase to v3.2.14
  * [Config] Updateconfigs after rebase to v3.2.14
  * d-i: Fix module name for dm-raid45
    - LP: #969248
  * SAUCE: remove __initdata from vesafb_fix
    - LP: #969309
  * Revert "sched: tg->se->load should be initialised to tg->shares"
  * toshiba_acpi: make one-bit bitfields unsigned
    - LP: #810015
  * ACPI: EC: Add ec_get_handle()
    - LP: #810015
  * toshiba_acpi: Support alternate hotkey interfaces
    - LP: #810015
  * toshiba_acpi: Support additional hotkey scancodes
    - LP: #810015
  * toshiba_acpi: Refuse to load on machines with buggy INFO
    implementations
    - LP: #810015
  * ata_piix: Add Toshiba Satellite Pro A120 to the quirks list due to
    broken suspend functionality.
    - LP: #886850
  * sweep the floors and convert some .get_drvinfo routines to strlcpy
    - LP: #921793
  * be2net: init (vf)_if_handle/vf_pmac_id to handle failure scenarios
    - LP: #921793
  * be2net: stop checking the UE registers after an EEH error
    - LP: #921793
  * be2net: don't log more than one error on detecting EEH/UE errors
    - LP: #921793
  * be2net: stop issuing FW cmds if any cmd times out
    - LP: #921793
  * be2net: Fix TX queue create for Lancer
    - LP: #921793
  * be2net: add register dump feature for Lancer
    - LP: #921793
  * be2net: Add EEPROM dump feature for Lancer
    - LP: #921793
  * be2net: Fix VLAN promiscous mode for Lancer
    - LP: #921793
  * be2net: Use V1 query link status command for lancer
    - LP: #921793
  * be2net: Move to new SR-IOV implementation in Lancer
    - LP: #921793
  * be2net: Fix error recovery paths
    - LP: #921793
  * be2net: Add error handling for Lancer
    - LP: #921793
  * be2net: Use new hash key
    - LP: #921793
  * be2net: Fix non utilization of RX queues
    - LP: #921793
  * be2net: netpoll support
    - LP: #921793
  * be2net: update some counters to display via ethtool
    - LP: #921793
  * be2net: workaround to fix a bug in BE
    ...

Read more...

Changed in linux-armadaxp (Ubuntu):
status: In Progress → Fix Released
Paolo Pisati (p-pisati) wrote :
description: updated
Luis Henriques (henrix) wrote :

This bug is awaiting verification that the kernel for precise in -proposed solves the problem (3.2.0-25.40). Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-precise' to 'verification-done-precise'.

If verification is not done by one week 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-precise

The attachment "linux-2.6.git-8878a539ff19a43cf3729e7562cd528f490246ae.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

Brad Figg (brad-figg) wrote :

Given that this only impacts ARM and that this has been upstream and tested for some time, I am going to mark this verified.

tags: added: verification-done-precise
removed: verification-needed-precise
Paolo Pisati (p-pisati) on 2012-06-04
Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Paolo Pisati (p-pisati) on 2012-06-04
Changed in linux-ti-omap4 (Ubuntu):
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (21.0 KiB)

This bug was fixed in the package linux - 3.2.0-25.40

---------------
linux (3.2.0-25.40) precise-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1003534

  [ Andy Whitcroft ]

  * [Config] control.stub is an intermediate product not a dependancy
    - LP: #992414
  * [Config] include include/generated/compile.h
    - LP: #942569

  [ Dave Martin ]

  * SAUCE: rtc: pl031: Enable module alias autogeneration for AMBA drivers
    - LP: #1000831

  [ Herton Ronaldo Krzesinski ]

  * Revert "SAUCE: ite-cir: postpone ISR registration"
    - LP: #1002484
  * SAUCE: async_populate_rootfs: fix build warnings
    - LP: #1003417

  [ Ike Panhc ]

  * [Config] add highbank flavour
    - LP: #1000831

  [ John Johansen ]

  * SAUCE: apparmor: fix long path failure due to disconnected path
    - LP: #955892
  * SAUCE: apparmor: fix profile lookup for unconfined
    - LP: #978038, #987371

  [ Mark Langsdorf ]

  * SAUCE: arm highbank: add support for pl320-ipc driver
    - LP: #1000831

  [ Rob Herring ]

  * SAUCE: input: add a key driver for highbank
    - LP: #1000831
  * SAUCE: ARM: highbank: Add smc calls to enable/disable the L2
    - LP: #1000831
  * SAUCE: force DMA buffers to non-bufferable on highbank
    - LP: #1000831
  * SAUCE: net: calxedaxgmac: fix net timeout recovery
    - LP: #1000831

  [ Tim Gardner ]

  * [Config] perarch and indep tools builds need separate build directories
  * [Config] CONFIG_XEN_ACPI_PROCESSOR=y
    - LP: #898112

  [ Upstream Kernel Changes ]

  * Revert "autofs: work around unhappy compat problem on x86-64"
    - LP: #1002482
  * Input: wacom - cleanup feature report for bamboos
    - LP: #568064
  * Input: wacom - remove unused bamboo HID parsing
    - LP: #568064
  * Input: wacom - add some comments to wacom_parse_hid
    - LP: #568064
  * Input: wacom - relax Bamboo stylus ID check
    - LP: #568064
  * Input: wacom - read 3rd gen Bamboo Touch HID data
    - LP: #568064
  * Input: wacom - 3rd gen Bamboo P&Touch packet support
    - LP: #568064
  * Input: wacom - ignore unwanted bamboo packets
    - LP: #568064
  * HID: wacom: Move parsing to a separate function
    - LP: #568064
  * HID: wacom: Initial driver for Wacom Intuos4 Wireless (Bluetooth)
    - LP: #568064
  * Input: wacom - add support for Cintiq 24HD
    - LP: #568064
  * Input: wacom - add LED support for Cintiq 24HD
    - LP: #568064
  * Input: wacom - add missing LEDS_CLASS to Kconfig
    - LP: #568064
  * Input: wacom - fix 3rd-gen Bamboo MT when 4+ fingers are in use
    - LP: #568064
  * power_supply: allow a power supply to explicitly point to powered
    device
    - LP: #568064
  * power_supply: add "powers" links to self-powered HID devices
    - LP: #568064
  * HID: wiimote: fix invalid power_supply_powers call
    - LP: #568064
  * HID: wacom: Fix invalid power_supply_powers calls
    - LP: #568064
  * ARM: 7178/1: fault.c: Port OOM changes into do_page_fault
    - LP: #951043
  * ARM: 7368/1: fault.c: correct how the tsk->[maj|min]_flt gets
    incremented
    - LP: #951043
  * hugepages: fix use after free bug in "quota" handling
    - LP: #990368
    - CVE-2012-2133
  * provide disable_cpufreq() functio...

Changed in linux (Ubuntu Precise):
status: New → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (21.2 KiB)

This bug was fixed in the package linux-ti-omap4 - 3.2.0-1414.19

---------------
linux-ti-omap4 (3.2.0-1414.19) precise-proposed; urgency=low

  * Release Tracking Bug
    - LP: #1004555

  [ Paolo Pisati ]

  * [Config] updateconfigs following rebase
  * rebased on 3.2.0-25.40

  [ Ubuntu: 3.2.0-25.40 ]

  * Release Tracking Bug
    - LP: #1003534
  * [Config] control.stub is an intermediate product not a dependancy
    - LP: #992414
  * [Config] include include/generated/compile.h
    - LP: #942569
  * SAUCE: rtc: pl031: Enable module alias autogeneration for AMBA drivers
    - LP: #1000831
  * Revert "SAUCE: ite-cir: postpone ISR registration"
    - LP: #1002484
  * SAUCE: async_populate_rootfs: fix build warnings
    - LP: #1003417
  * [Config] add highbank flavour
    - LP: #1000831
  * SAUCE: apparmor: fix long path failure due to disconnected path
    - LP: #955892
  * SAUCE: apparmor: fix profile lookup for unconfined
    - LP: #978038, #987371
  * SAUCE: arm highbank: add support for pl320-ipc driver
    - LP: #1000831
  * SAUCE: input: add a key driver for highbank
    - LP: #1000831
  * SAUCE: ARM: highbank: Add smc calls to enable/disable the L2
    - LP: #1000831
  * SAUCE: force DMA buffers to non-bufferable on highbank
    - LP: #1000831
  * SAUCE: net: calxedaxgmac: fix net timeout recovery
    - LP: #1000831
  * [Config] perarch and indep tools builds need separate build directories
  * [Config] CONFIG_XEN_ACPI_PROCESSOR=y
    - LP: #898112
  * Revert "autofs: work around unhappy compat problem on x86-64"
    - LP: #1002482
  * Input: wacom - cleanup feature report for bamboos
    - LP: #568064
  * Input: wacom - remove unused bamboo HID parsing
    - LP: #568064
  * Input: wacom - add some comments to wacom_parse_hid
    - LP: #568064
  * Input: wacom - relax Bamboo stylus ID check
    - LP: #568064
  * Input: wacom - read 3rd gen Bamboo Touch HID data
    - LP: #568064
  * Input: wacom - 3rd gen Bamboo P&Touch packet support
    - LP: #568064
  * Input: wacom - ignore unwanted bamboo packets
    - LP: #568064
  * HID: wacom: Move parsing to a separate function
    - LP: #568064
  * HID: wacom: Initial driver for Wacom Intuos4 Wireless (Bluetooth)
    - LP: #568064
  * Input: wacom - add support for Cintiq 24HD
    - LP: #568064
  * Input: wacom - add LED support for Cintiq 24HD
    - LP: #568064
  * Input: wacom - add missing LEDS_CLASS to Kconfig
    - LP: #568064
  * Input: wacom - fix 3rd-gen Bamboo MT when 4+ fingers are in use
    - LP: #568064
  * power_supply: allow a power supply to explicitly point to powered
    device
    - LP: #568064
  * power_supply: add "powers" links to self-powered HID devices
    - LP: #568064
  * HID: wiimote: fix invalid power_supply_powers call
    - LP: #568064
  * HID: wacom: Fix invalid power_supply_powers calls
    - LP: #568064
  * ARM: 7178/1: fault.c: Port OOM changes into do_page_fault
    - LP: #951043
  * ARM: 7368/1: fault.c: correct how the tsk->[maj|min]_flt gets
    incremented
    - LP: #951043
  * hugepages: fix use after free bug in "quota" handling
    - LP: #990368
    - CVE-2012-2133
  * provide disable_cpufreq() function to disable the API.
    - LP: #898112
  * xe...

Changed in linux-ti-omap4 (Ubuntu Precise):
status: New → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (13.6 KiB)

This bug was fixed in the package linux-armadaxp - 3.2.0-1605.8

---------------
linux-armadaxp (3.2.0-1605.8) precise-proposed; urgency=low

  * Release Tracking Bug
   -LP: #1020888

  [ Jani Monoses ]

  * Fix warnings.
  * Adapt to new sched_clock API

  [ Ubuntu: 3.2.0-27.43 ]

  * No change upload to fix .ddeb generation in the PPA.
  * Release Tracking Bug
    - LP: #1020016

  [ Ubuntu: 3.2.0-27.42 ]

  * Release Tracking Bug
    - LP: #1020016
  * PACKAGING: add .gnu_debuglink sections to .ko files
    - LP: #669641
  * [Config] Updateconfigs
    - LP: #1008345
  * SAUCE: (upstreamed) [media] ene_ir: Fix driver initialisation
    - LP: #1014800
  * SAUCE: ocfs2: Fix NULL pointer dereferrence in
    __ocfs2_change_file_space
    - LP: #1006012
  * SAUCE: net: calxedaxgmac: enable rx cut-thru mode
    - LP: #1008345
  * SAUCE: EDAC: Add support for the highbank platform memory
    - LP: #1008345
  * SAUCE: EDAC: add support for highbank platform L2 cache ecc
    - LP: #1008345
  * (pre-stable): bcma: add ext PA workaround for BCM4331 and BCM43431
    - LP: #925577
  * SAUCE: ALSA: hda - Fix power-map regression for HP dv6 & co
    - LP: #1013183
  * [Config] Enable CONFIG_CGROUPS for highbank
    - LP: #1014692
  * Revert "net: maintain namespace isolation between vlan and real device"
    - LP: #1013723
  * x86/amd: Re-enable CPU topology extensions in case BIOS has disabled it
    - LP: #1009087
  * hwmon: (k10temp) Add support for AMD Trinity CPUs
    - LP: #1009086
  * hwmon: (fam15h_power) Increase output resolution
    - LP: #1009086
  * Input: wacom - use BTN_TOOL_FINGER to indicate touch device type
    - LP: #1009435
  * Input: wacom - use switch statement for wacom_tpc_irq()
    - LP: #1009435
  * Input: wacom - isolate input registration
    - LP: #1009435
  * Input: wacom - wireless monitor framework
    - LP: #1009435
  * Input: wacom - create inputs when wireless connect
    - LP: #1009435
  * Input: wacom - wireless battery status
    - LP: #1009435
  * Input: wacom - check for allocation failure in probe()
    - LP: #1009435
  * Input: wacom - add basic Intuos5 support
    - LP: #1009435
  * Input: wacom - add Intuos5 Touch Ring/ExpressKey support
    - LP: #1009435
  * Input: wacom - add Intuos5 Touch Ring LED support
    - LP: #1009435
  * Input: wacom - add Intuos5 multitouch sensor support
    - LP: #1009435
  * iommu/amd: Add workaround for event log erratum
    - LP: #1013723
  * MIPS: BCM63XX: Add missing include for bcm63xx_gpio.h
    - LP: #1013723
  * cifs: Include backup intent search flags during searches {try #2)
    - LP: #1013723
  * sunrpc: fix loss of task->tk_status after rpc_delay call in
    xprt_alloc_slot
    - LP: #1013723
  * exofs: Fix CRASH on very early IO errors.
    - LP: #1013723
  * cifs: fix oops while traversing open file list (try #4)
    - LP: #1013723
  * Fix dm-multipath starvation when scsi host is busy
    - LP: #1013723
  * ixp4xx: fix compilation by adding gpiolib support
    - LP: #1013723
  * drm/i915: properly handle interlaced bit for sdvo dtd conversion
    - LP: #1013723
  * drm/i915: enable vdd when switching off the eDP panel
    - LP: #1013723
  * drm/i915: Ignore LVDS o...

Changed in linux-armadaxp (Ubuntu Precise):
status: New → Fix Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers