aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorMel Gorman <mgorman@techsingularity.net>2021-07-14 21:26:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-07-15 10:13:49 -0700
commit187ad460b8413e863c951998cb321a117a717868 (patch)
treed711ce2fce5c66633d03df294c428b6bfe7d7bfa /tools/perf/scripts/python/export-to-sqlite.py
parentRevert "mm/page_alloc: make should_fail_alloc_page() static" (diff)
downloadlinux-187ad460b8413e863c951998cb321a117a717868.tar.gz
linux-187ad460b8413e863c951998cb321a117a717868.zip
mm/page_alloc: avoid page allocator recursion with pagesets.lock held
Syzbot is reporting potential deadlocks due to pagesets.lock when PAGE_OWNER is enabled. One example from Desmond Cheong Zhi Xi is as follows __alloc_pages_bulk() local_lock_irqsave(&pagesets.lock, flags) <---- outer lock here prep_new_page(): post_alloc_hook(): set_page_owner(): __set_page_owner(): save_stack(): stack_depot_save(): alloc_pages(): alloc_page_interleave(): __alloc_pages(): get_page_from_freelist(): rm_queue(): rm_queue_pcplist(): local_lock_irqsave(&pagesets.lock, flags); *** DEADLOCK *** Zhang, Qiang also reported BUG: sleeping function called from invalid context at mm/page_alloc.c:5179 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 1, name: swapper/0 ..... __dump_stack lib/dump_stack.c:79 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:96 ___might_sleep.cold+0x1f1/0x237 kernel/sched/core.c:9153 prepare_alloc_pages+0x3da/0x580 mm/page_alloc.c:5179 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5375 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2147 alloc_pages+0x238/0x2a0 mm/mempolicy.c:2270 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 save_stack+0x15e/0x1e0 mm/page_owner.c:120 __set_page_owner+0x50/0x290 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2445 [inline] __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5313 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline] vm_area_alloc_pages mm/vmalloc.c:2775 [inline] __vmalloc_area_node mm/vmalloc.c:2845 [inline] __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2947 __vmalloc_node mm/vmalloc.c:2996 [inline] vzalloc+0x67/0x80 mm/vmalloc.c:3066 There are a number of ways it could be fixed. The page owner code could be audited to strip GFP flags that allow sleeping but it'll impair the functionality of PAGE_OWNER if allocations fail. The bulk allocator could add a special case to release/reacquire the lock for prep_new_page and lookup PCP after the lock is reacquired at the cost of performance. The pages requiring prep could be tracked using the least significant bit and looping through the array although it is more complicated for the list interface. The options are relatively complex and the second one still incurs a performance penalty when PAGE_OWNER is active so this patch takes the simple approach -- disable bulk allocation of PAGE_OWNER is active. The caller will be forced to allocate one page at a time incurring a performance penalty but PAGE_OWNER is already a performance penalty. Link: https://lkml.kernel.org/r/20210708081434.GV3840@techsingularity.net Fixes: dbbee9d5cd83 ("mm/page_alloc: convert per-cpu list protection to local_lock") Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Reported-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com> Reported-by: "Zhang, Qiang" <Qiang.Zhang@windriver.com> Reported-by: syzbot+127fd7828d6eeb611703@syzkaller.appspotmail.com Tested-by: syzbot+127fd7828d6eeb611703@syzkaller.appspotmail.com Acked-by: Rafael Aquini <aquini@redhat.com> Cc: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
b5a5aefa23c652dbe947b7465633984&follow=1'>mm: alloc_large_system_hash() printk overflow on 16TB bootRobin Holt1-2/+2 2010-10-07Revert "mac80211: use netif_receive_skb in ieee80211_tx_status callpath"John W. Linville1-2/+2 2010-10-07ceph: update issue_seq on cap grantSage Weil1-3/+5 2010-10-07ceph: send cap release message early on failed revoke.Greg Farnum1-10/+13 2010-10-07ceph: Update max_len with minimum required sizeAneesh Kumar K.V1-1/+4 2010-10-07ceph: Fix return value of encode_fh functionAneesh Kumar K.V1-7/+9 2010-10-07ceph: avoid null deref in osd request error pathSage Weil1-1/+1 2010-10-07ceph: fix list_add usage on unsafe_writes listHenry C Chang1-1/+1 2010-10-07HWPOISON: Stop shrinking at right page countAndi Kleen1-1/+1 2010-10-07HWPOISON: Report correct address granuality for AO huge page errorsAndi Kleen1-5/+5 2010-10-07HWPOISON: Copy si_addr_lsb to userAndi Kleen1-0/+8 2010-10-07page-types.c: fix name of unpoison interfaceNaoya Horiguchi1-1/+1 2010-10-07elevator: fix oops on early call to elevator_change()Jens Axboe2-4/+9 2010-10-07drm: don't drop handle reference on unloadDave Airlie4-4/+1 2010-10-06xfs: properly account for reclaimed inodesJohannes Weiner1-5/+14 2010-10-07md: check return code of read_sb_pageVasiliy Kulikov1-4/+5 2010-10-07md/raid1: minor bio initialisation improvements.NeilBrown1-0/+2 2010-10-07md/raid1: avoid overflow in raid1 resync when bitmap is in use.NeilBrown1-1/+1 2010-10-06Linux 2.6.36-rc7v2.6.36-rc7Linus Torvalds1-1/+1 2010-10-06mac80211: delete AddBA response timerJohannes Berg1-0/+2 2010-10-06ath9k_hw: fix regression in ANI listen time calculationFelix Fietkau1-1/+1 2010-10-05caif: fix two caif_connect() bugsEric Dumazet1-6/+15 2010-10-05bonding: fix WARN_ON when writing to bond_master sysfs fileNeil Horman1-0/+9 2010-10-05ASoC: Update links for Wolfson MAINTAINERS entryMark Brown1-1/+2 2010-10-05ASoC: Add Dimitris Papastamos to Wolfson maintainersMark Brown1-0/+1 2010-10-05powerpc: remove unused variableStephen Rothwell1-1/+0 2010-10-06drm/ttm: Fix two race conditions + fix busy codepathsThomas Hellstrom2-13/+74 2010-10-05skge: add quirk to limit DMAStanislaw Gruszka1-1/+17 2010-10-05MAINTAINERS: update Intel LAN Ethernet infoJeff Kirsher1-2/+14