summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/flamegraph.py
diff options
context:
space:
mode:
authorJoanne Koong <joannelkoong@gmail.com>2025-10-10 15:07:38 -0700
committerMiklos Szeredi <mszeredi@redhat.com>2025-11-11 16:04:45 +0100
commitbd5603eaae0aabf527bfb3ce1bb07e979ce5bd50 (patch)
tree9611242287d1893abfc0a598bc3fd618c05ba63b /tools/perf/scripts/python/flamegraph.py
parente9a6fb0bcdd7609be6969112f3fbfcce3b1d4a7c (diff)
downloadkernel-bd5603eaae0aabf527bfb3ce1bb07e979ce5bd50.tar.gz
fuse: fix readahead reclaim deadlock
Commit e26ee4efbc79 ("fuse: allocate ff->release_args only if release is needed") skips allocating ff->release_args if the server does not implement open. However in doing so, fuse_prepare_release() now skips grabbing the reference on the inode, which makes it possible for an inode to be evicted from the dcache while there are inflight readahead requests. This causes a deadlock if the server triggers reclaim while servicing the readahead request and reclaim attempts to evict the inode of the file being read ahead. Since the folio is locked during readahead, when reclaim evicts the fuse inode and fuse_evict_inode() attempts to remove all folios associated with the inode from the page cache (truncate_inode_pages_range()), reclaim will block forever waiting for the lock since readahead cannot relinquish the lock because it is itself blocked in reclaim: >>> stack_trace(1504735) folio_wait_bit_common (mm/filemap.c:1308:4) folio_lock (./include/linux/pagemap.h:1052:3) truncate_inode_pages_range (mm/truncate.c:336:10) fuse_evict_inode (fs/fuse/inode.c:161:2) evict (fs/inode.c:704:3) dentry_unlink_inode (fs/dcache.c:412:3) __dentry_kill (fs/dcache.c:615:3) shrink_kill (fs/dcache.c:1060:12) shrink_dentry_list (fs/dcache.c:1087:3) prune_dcache_sb (fs/dcache.c:1168:2) super_cache_scan (fs/super.c:221:10) do_shrink_slab (mm/shrinker.c:435:9) shrink_slab (mm/shrinker.c:626:10) shrink_node (mm/vmscan.c:5951:2) shrink_zones (mm/vmscan.c:6195:3) do_try_to_free_pages (mm/vmscan.c:6257:3) do_swap_page (mm/memory.c:4136:11) handle_pte_fault (mm/memory.c:5562:10) handle_mm_fault (mm/memory.c:5870:9) do_user_addr_fault (arch/x86/mm/fault.c:1338:10) handle_page_fault (arch/x86/mm/fault.c:1481:3) exc_page_fault (arch/x86/mm/fault.c:1539:2) asm_exc_page_fault+0x22/0x27 Fix this deadlock by allocating ff->release_args and grabbing the reference on the inode when preparing the file for release even if the server does not implement open. The inode reference will be dropped when the last reference on the fuse file is dropped (see fuse_file_put() -> fuse_release_end()). Fixes: e26ee4efbc79 ("fuse: allocate ff->release_args only if release is needed") Cc: stable@vger.kernel.org Signed-off-by: Joanne Koong <joannelkoong@gmail.com> Reported-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions
2010-11-24af_unix: limit unix_tot_inflightEric Dumazet 2010-11-08af_unix: optimize unix_dgram_poll()Eric Dumazet 2010-11-08af_unix: fix unix_dgram_poll() behavior for EPOLLOUT eventEric Dumazet 2010-11-08af_unix: use keyed wakeupsEric Dumazet 2010-10-26fs: allow for more than 2^31 filesEric Dumazet 2010-10-05AF_UNIX: Implement SO_TIMESTAMP and SO_TIMETAMPNS on Unix socketsAlban Crequy 2010-09-09Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/ne...David S. Miller 2010-09-07UNIX: Do not loop forever at unix_autobind().Tetsuo Handa 2010-09-06net: poll() optimizationsEric Dumazet 2010-07-20drop_monitor: convert some kfree_skb call sites to consume_skbNeil Horman 2010-06-16af_unix: Allow connecting to sockets in other network namespaces.Eric W. Biederman 2010-06-16af_unix: Allow credentials to work across user and pid namespaces.Eric W. Biederman 2010-06-16af_unix: Allow SO_PEERCRED to work across namespaces.Eric W. Biederman 2010-05-03unix/garbage: kill copy of the skb queue walkerIlpo Järvinen 2010-05-01net: sock_def_readable() and friends RCU conversionEric Dumazet 2010-04-20net: sk_sleep() helperEric Dumazet 2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking imp...Tejun Heo 2010-02-18AF_UNIX: update locking commentStephen Hemminger 2010-01-17net: spread __net_init, __net_exitAlexey Dobriyan 2009-12-08Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6Linus Torvalds 2009-11-29net: Move && and || to end of previous lineJoe Perches 2009-11-12sysctl net: Remove unused binary sysctl codeEric W. Biederman 2009-11-10net: netlink_getname, packet_getname -- use DECLARE_SOCKADDR guardCyrill Gorcunov 2009-11-05net: pass kern to net_proto_family create functionEric Paris 2009-10-27Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/ne...David S. Miller 2009-10-18AF_UNIX: Fix deadlock on connecting to shutdown socketTomoki Sekiyama 2009-10-07net: mark net_proto_ops as constStephen Hemminger