From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id C22956B0033 for ; Sun, 5 Feb 2017 05:46:53 -0500 (EST) Received: by mail-pf0-f198.google.com with SMTP id y143so76201125pfb.6 for ; Sun, 05 Feb 2017 02:46:53 -0800 (PST) Received: from www262.sakura.ne.jp (www262.sakura.ne.jp. [2001:e42:101:1:202:181:97:72]) by mx.google.com with ESMTPS id g12si30623559pla.248.2017.02.05.02.46.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 05 Feb 2017 02:46:51 -0800 (PST) Subject: Re: [RFC PATCH 1/2] mm, vmscan: account the number of isolated pages per zone From: Tetsuo Handa References: <201701290027.AFB30799.FVtFLOOOJMSHQF@I-love.SAKURA.ne.jp> <20170130085546.GF8443@dhcp22.suse.cz> <20170202101415.GE22806@dhcp22.suse.cz> <201702031957.AGH86961.MLtOQVFOSHJFFO@I-love.SAKURA.ne.jp> <20170203145548.GC19325@dhcp22.suse.cz> In-Reply-To: <20170203145548.GC19325@dhcp22.suse.cz> Message-Id: <201702051943.CFB35412.OOSJVtLFOFQHMF@I-love.SAKURA.ne.jp> Date: Sun, 5 Feb 2017 19:43:07 +0900 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-linux-mm@kvack.org List-ID: To: mhocko@kernel.org Cc: hch@lst.de, mgorman@suse.de, viro@ZenIV.linux.org.uk, linux-mm@kvack.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, peterz@infradead.org Michal Hocko wrote: > [CC Petr] > > On Fri 03-02-17 19:57:39, Tetsuo Handa wrote: > [...] > > (2) I got a lockdep warning. (A new false positive?) > > Yes, I suspect this is a false possitive. I do not see how we can > deadlock. __alloc_pages_direct_reclaim calls drain_all_pages(NULL) which > means that a potential recursion to the page allocator during draining > would just bail out on the trylock. Maybe I am misinterpreting the > report though. > I got same warning with ext4. Maybe we need to check carefully. [ 511.215743] ===================================================== [ 511.218003] WARNING: RECLAIM_FS-safe -> RECLAIM_FS-unsafe lock order detected [ 511.220031] 4.10.0-rc6-next-20170202+ #500 Not tainted [ 511.221689] ----------------------------------------------------- [ 511.223579] a.out/49302 [HC0[0]:SC0[0]:HE1:SE1] is trying to acquire: [ 511.225533] (cpu_hotplug.dep_map){++++++}, at: [] get_online_cpus+0x37/0x80 [ 511.227795] [ 511.227795] and this task is already holding: [ 511.230082] (jbd2_handle){++++-.}, at: [] start_this_handle+0x1a7/0x590 [ 511.232592] which would create a new lock dependency: [ 511.234192] (jbd2_handle){++++-.} -> (cpu_hotplug.dep_map){++++++} [ 511.235966] [ 511.235966] but this new dependency connects a RECLAIM_FS-irq-safe lock: [ 511.238563] (jbd2_handle){++++-.} [ 511.238564] [ 511.238564] ... which became RECLAIM_FS-irq-safe at: [ 511.242078] [ 511.242084] [] __lock_acquire+0x34b/0x1640 [ 511.244492] [ 511.244495] [] lock_acquire+0xc9/0x250 [ 511.246694] [ 511.246697] [] jbd2_log_wait_commit+0x55/0x1d0 [ 511.249323] [ 511.249328] [] jbd2_complete_transaction+0x71/0x90 [ 511.252069] [ 511.252074] [] ext4_evict_inode+0x356/0x760 [ 511.254753] [ 511.254757] [] evict+0xd1/0x1a0 [ 511.257062] [ 511.257065] [] dispose_list+0x4d/0x80 [ 511.259531] [ 511.259535] [] prune_icache_sb+0x5a/0x80 [ 511.261953] [ 511.261957] [] super_cache_scan+0x141/0x190 [ 511.264540] [ 511.264545] [] shrink_slab+0x29f/0x6d0 [ 511.267165] [ 511.267171] [] shrink_node+0x2fa/0x310 [ 511.269455] [ 511.269459] [] kswapd+0x362/0x9b0 [ 511.271831] [ 511.271834] [] kthread+0x10f/0x150 [ 511.274031] [ 511.274035] [] ret_from_fork+0x31/0x40 [ 511.276216] [ 511.276216] to a RECLAIM_FS-irq-unsafe lock: [ 511.278128] (cpu_hotplug.dep_map){++++++} [ 511.278130] [ 511.278130] ... which became RECLAIM_FS-irq-unsafe at: [ 511.281809] ... [ 511.281811] [ 511.282598] [] mark_held_locks+0x71/0x90 [ 511.284852] [ 511.284854] [] lockdep_trace_alloc+0x6f/0xd0 [ 511.287215] [ 511.287218] [] kmem_cache_alloc_node_trace+0x48/0x3b0 [ 511.289751] [ 511.289755] [] __smpboot_create_thread.part.2+0x35/0xf0 [ 511.292326] [ 511.292329] [] smpboot_create_threads+0x66/0x90 [ 511.295025] [ 511.295030] [] cpuhp_invoke_callback+0x229/0x9e0 [ 511.299245] [ 511.299253] [] cpuhp_up_callbacks+0x37/0xb0 [ 511.301889] [ 511.301894] [] _cpu_up+0x89/0xf0 [ 511.304270] [ 511.304275] [] do_cpu_up+0x85/0xb0 [ 511.306428] [ 511.306431] [] cpu_up+0x13/0x20 [ 511.308533] [ 511.308535] [] smp_init+0x6b/0xcc [ 511.310710] [ 511.310713] [] kernel_init_freeable+0x17d/0x2ac [ 511.313232] [ 511.313235] [] kernel_init+0xe/0x110 [ 511.315616] [ 511.315620] [] ret_from_fork+0x31/0x40 [ 511.317867] [ 511.317867] other info that might help us debug this: [ 511.317867] [ 511.320920] Possible interrupt unsafe locking scenario: [ 511.320920] [ 511.323218] CPU0 CPU1 [ 511.324622] ---- ---- [ 511.325973] lock(cpu_hotplug.dep_map); [ 511.327246] local_irq_disable(); [ 511.328870] lock(jbd2_handle); [ 511.330483] lock(cpu_hotplug.dep_map); [ 511.332259] [ 511.333187] lock(jbd2_handle); [ 511.334304] [ 511.334304] *** DEADLOCK *** [ 511.334304] [ 511.336749] 4 locks held by a.out/49302: [ 511.338129] #0: (sb_writers#8){.+.+.+}, at: [] mnt_want_write+0x24/0x50 [ 511.340768] #1: (&type->i_mutex_dir_key#3){++++++}, at: [] path_openat+0x60b/0xd50 [ 511.343744] #2: (jbd2_handle){++++-.}, at: [] start_this_handle+0x1a7/0x590 [ 511.345743] #3: (pcpu_drain_mutex){+.+...}, at: [] drain_all_pages.part.89+0x1f/0x2c0 [ 511.348605] [ 511.348605] the dependencies between RECLAIM_FS-irq-safe lock and the holding lock: [ 511.351336] -> (jbd2_handle){++++-.} ops: 203220 { [ 511.352768] HARDIRQ-ON-W at: [ 511.353827] [ 511.353833] [] __lock_acquire+0x9de/0x1640 [ 511.356489] [ 511.356492] [] lock_acquire+0xc9/0x250 [ 511.359063] [ 511.359067] [] jbd2_log_wait_commit+0x55/0x1d0 [ 511.361905] [ 511.361908] [] jbd2_complete_transaction+0x71/0x90 [ 511.364560] [ 511.364563] [] ext4_sync_file+0x2e7/0x5e0 [ 511.367362] [ 511.367367] [] vfs_fsync_range+0x3d/0xb0 [ 511.369950] [ 511.369953] [] do_fsync+0x3d/0x70 [ 511.372400] [ 511.372402] [] SyS_fsync+0x10/0x20 [ 511.374821] [ 511.374824] [] do_syscall_64+0x6c/0x200 [ 511.377422] [ 511.377425] [] return_from_SYSCALL_64+0x0/0x7a [ 511.380273] HARDIRQ-ON-R at: [ 511.381791] [ 511.381815] [] __lock_acquire+0x2dd/0x1640 [ 511.384693] [ 511.384697] [] lock_acquire+0xc9/0x250 [ 511.387195] [ 511.387198] [] start_this_handle+0x225/0x590 [ 511.389888] [ 511.389891] [] jbd2__journal_start+0xe9/0x340 [ 511.392522] [ 511.392525] [] __ext4_journal_start_sb+0x9a/0x240 [ 511.395341] [ 511.395344] [] ext4_file_open+0x188/0x230 [ 511.397886] [ 511.397889] [] do_dentry_open+0x22b/0x340 [ 511.400727] [ 511.400730] [] vfs_open+0x52/0x80 [ 511.403297] [ 511.403301] [] path_openat+0x4a2/0xd50 [ 511.405752] [ 511.405755] [] do_filp_open+0x91/0x100 [ 511.408229] [ 511.408231] [] do_sys_open+0x124/0x210 [ 511.410820] [ 511.410822] [] SyS_open+0x1e/0x20 [ 511.413158] [ 511.413161] [] entry_SYSCALL_64_fastpath+0x1f/0xc2 [ 511.416074] SOFTIRQ-ON-W at: [ 511.417069] [ 511.417073] [] __lock_acquire+0x306/0x1640 [ 511.419681] [ 511.419684] [] lock_acquire+0xc9/0x250 [ 511.422516] [ 511.422520] [] jbd2_log_wait_commit+0x55/0x1d0 [ 511.425157] [ 511.425160] [] jbd2_complete_transaction+0x71/0x90 [ 511.427862] [ 511.427865] [] ext4_sync_file+0x2e7/0x5e0 [ 511.430379] [ 511.430382] [] vfs_fsync_range+0x3d/0xb0 [ 511.433412] [ 511.433418] [] do_fsync+0x3d/0x70 [ 511.436064] [ 511.436067] [] SyS_fsync+0x10/0x20 [ 511.438498] [ 511.438502] [] do_syscall_64+0x6c/0x200 [ 511.441519] [ 511.441524] [] return_from_SYSCALL_64+0x0/0x7a [ 511.444325] SOFTIRQ-ON-R at: [ 511.445358] [ 511.445362] [] __lock_acquire+0x306/0x1640 [ 511.448298] [ 511.448312] [] lock_acquire+0xc9/0x250 [ 511.451096] [ 511.451100] [] start_this_handle+0x225/0x590 [ 511.453784] [ 511.453786] [] jbd2__journal_start+0xe9/0x340 [ 511.456659] [ 511.456664] [] __ext4_journal_start_sb+0x9a/0x240 [ 511.459638] [ 511.459643] [] ext4_file_open+0x188/0x230 [ 511.462384] [ 511.462389] [] do_dentry_open+0x22b/0x340 [ 511.465550] [ 511.465558] [] vfs_open+0x52/0x80 [ 511.468141] [ 511.468145] [] path_openat+0x4a2/0xd50 [ 511.470816] [ 511.470819] [] do_filp_open+0x91/0x100 [ 511.473441] [ 511.473443] [] do_sys_open+0x124/0x210 [ 511.476079] [ 511.476081] [] SyS_open+0x1e/0x20 [ 511.478584] [ 511.478587] [] entry_SYSCALL_64_fastpath+0x1f/0xc2 [ 511.481394] IN-RECLAIM_FS-W at: [ 511.482680] [ 511.482691] [] __lock_acquire+0x34b/0x1640 [ 511.485262] [ 511.485264] [] lock_acquire+0xc9/0x250 [ 511.487862] [ 511.487865] [] jbd2_log_wait_commit+0x55/0x1d0 [ 511.490707] [ 511.490710] [] jbd2_complete_transaction+0x71/0x90 [ 511.493524] [ 511.493527] [] ext4_evict_inode+0x356/0x760 [ 511.496251] [ 511.496255] [] evict+0xd1/0x1a0 [ 511.498817] [ 511.498821] [] dispose_list+0x4d/0x80 [ 511.501361] [ 511.501364] [] prune_icache_sb+0x5a/0x80 [ 511.504069] [ 511.504072] [] super_cache_scan+0x141/0x190 [ 511.506890] [ 511.506895] [] shrink_slab+0x29f/0x6d0 [ 511.509465] [ 511.509467] [] shrink_node+0x2fa/0x310 [ 511.512228] [ 511.512233] [] kswapd+0x362/0x9b0 [ 511.514724] [ 511.514728] [] kthread+0x10f/0x150 [ 511.517264] [ 511.517269] [] ret_from_fork+0x31/0x40 [ 511.519827] INITIAL USE at: [ 511.520829] [ 511.520833] [] __lock_acquire+0x36f/0x1640 [ 511.523377] [ 511.523380] [] lock_acquire+0xc9/0x250 [ 511.525781] [ 511.525784] [] start_this_handle+0x225/0x590 [ 511.528372] [ 511.528375] [] jbd2__journal_start+0xe9/0x340 [ 511.531138] [ 511.531141] [] __ext4_journal_start_sb+0x9a/0x240 [ 511.533905] [ 511.533908] [] ext4_file_open+0x188/0x230 [ 511.536467] [ 511.536471] [] do_dentry_open+0x22b/0x340 [ 511.538990] [ 511.538992] [] vfs_open+0x52/0x80 [ 511.541457] [ 511.541461] [] path_openat+0x4a2/0xd50 [ 511.544036] [ 511.544039] [] do_filp_open+0x91/0x100 [ 511.546642] [ 511.546644] [] do_sys_open+0x124/0x210 [ 511.549354] [ 511.549370] [] SyS_open+0x1e/0x20 [ 511.551781] [ 511.551784] [] entry_SYSCALL_64_fastpath+0x1f/0xc2 [ 511.554410] } [ 511.555145] ... key at: [] jbd2_trans_commit_key.48870+0x0/0x8 [ 511.557051] ... acquired at: [ 511.558047] [ 511.558050] [] check_irq_usage+0x4a/0xb0 [ 511.560268] [ 511.560270] [] __lock_acquire+0xe7b/0x1640 [ 511.562536] [ 511.562538] [] lock_acquire+0xc9/0x250 [ 511.564779] [ 511.564783] [] get_online_cpus+0x5d/0x80 [ 511.567230] [ 511.567234] [] drain_all_pages.part.89+0x2c/0x2c0 [ 511.569585] [ 511.569588] [] __alloc_pages_slowpath+0x509/0xe36 [ 511.572289] [ 511.572292] [] __alloc_pages_nodemask+0x382/0x3d0 [ 511.574744] [ 511.574747] [] alloc_pages_current+0x97/0x1b0 [ 511.577103] [ 511.577106] [] __page_cache_alloc+0x15d/0x1a0 [ 511.579483] [ 511.579486] [] pagecache_get_page+0x5a/0x2b0 [ 511.581935] [ 511.581940] [] __getblk_gfp+0x112/0x390 [ 511.584220] [ 511.584223] [] __ext4_get_inode_loc+0x10a/0x560 [ 511.586627] [ 511.586630] [] ext4_get_inode_loc+0x20/0x30 [ 511.589802] [ 511.589808] [] ext4_reserve_inode_write+0x26/0x90 [ 511.592471] [ 511.592476] [] ext4_mark_inode_dirty+0x8e/0x390 [ 511.594926] [ 511.594930] [] ext4_ext_tree_init+0x3a/0x40 [ 511.597306] [ 511.597308] [] __ext4_new_inode+0x12da/0x1540 [ 511.599962] [ 511.599969] [] ext4_create+0xd2/0x1a0 [ 511.602484] [ 511.602489] [] lookup_open+0x653/0x7b0 [ 511.604699] [ 511.604701] [] path_openat+0x626/0xd50 [ 511.606890] [ 511.606893] [] do_filp_open+0x91/0x100 [ 511.609097] [ 511.609099] [] do_sys_open+0x124/0x210 [ 511.611346] [ 511.611348] [] SyS_open+0x1e/0x20 [ 511.613431] [ 511.613434] [] do_syscall_64+0x6c/0x200 [ 511.615967] [ 511.615979] [] return_from_SYSCALL_64+0x0/0x7a [ 511.618303] [ 511.619062] [ 511.619062] the dependencies between the lock to be acquired [ 511.619063] and RECLAIM_FS-irq-unsafe lock: [ 511.622794] -> (cpu_hotplug.dep_map){++++++} ops: 1130 { [ 511.624286] HARDIRQ-ON-W at: [ 511.625479] [ 511.625485] [] __lock_acquire+0x9de/0x1640 [ 511.627957] [ 511.627959] [] lock_acquire+0xc9/0x250 [ 511.630609] [ 511.630612] [] cpu_hotplug_begin+0x73/0xe0 [ 511.633682] [ 511.633697] [] _cpu_up+0x32/0xf0 [ 511.636022] [ 511.636024] [] do_cpu_up+0x85/0xb0 [ 511.638397] [ 511.638399] [] cpu_up+0x13/0x20 [ 511.640852] [ 511.640866] [] smp_init+0x6b/0xcc [ 511.643507] [ 511.643511] [] kernel_init_freeable+0x17d/0x2ac [ 511.646002] [ 511.646005] [] kernel_init+0xe/0x110 [ 511.648600] [ 511.648611] [] ret_from_fork+0x31/0x40 [ 511.651115] HARDIRQ-ON-R at: [ 511.652080] [ 511.652084] [] __lock_acquire+0x2dd/0x1640 [ 511.654554] [ 511.654557] [] lock_acquire+0xc9/0x250 [ 511.656983] [ 511.656986] [] get_online_cpus+0x5d/0x80 [ 511.659442] [ 511.659445] [] kmem_cache_create+0x3a/0x2d0 [ 511.662336] [ 511.662342] [] numa_policy_init+0x43/0x24a [ 511.665117] [ 511.665121] [] start_kernel+0x3f6/0x4d6 [ 511.667566] [ 511.667568] [] x86_64_start_reservations+0x2a/0x2c [ 511.670245] [ 511.670247] [] x86_64_start_kernel+0x14c/0x16f [ 511.673050] [ 511.673054] [] verify_cpu+0x0/0xfc [ 511.675400] SOFTIRQ-ON-W at: [ 511.676405] [ 511.676408] [] __lock_acquire+0x306/0x1640 [ 511.679556] [ 511.679563] [] lock_acquire+0xc9/0x250 [ 511.683155] [ 511.683164] [] cpu_hotplug_begin+0x73/0xe0 [ 511.686224] [ 511.686231] [] _cpu_up+0x32/0xf0 [ 511.689073] [ 511.689078] [] do_cpu_up+0x85/0xb0 [ 511.691573] [ 511.691575] [] cpu_up+0x13/0x20 [ 511.694007] [ 511.694010] [] smp_init+0x6b/0xcc [ 511.696524] [ 511.696528] [] kernel_init_freeable+0x17d/0x2ac [ 511.699401] [ 511.699405] [] kernel_init+0xe/0x110 [ 511.701956] [ 511.701959] [] ret_from_fork+0x31/0x40 [ 511.704520] SOFTIRQ-ON-R at: [ 511.705530] [ 511.705534] [] __lock_acquire+0x306/0x1640 [ 511.708036] [ 511.708038] [] lock_acquire+0xc9/0x250 [ 511.710516] [ 511.710518] [] get_online_cpus+0x5d/0x80 [ 511.713771] [ 511.713780] [] kmem_cache_create+0x3a/0x2d0 [ 511.716681] [ 511.716688] [] numa_policy_init+0x43/0x24a [ 511.719450] [ 511.719455] [] start_kernel+0x3f6/0x4d6 [ 511.722114] [ 511.722117] [] x86_64_start_reservations+0x2a/0x2c [ 511.724864] [ 511.724866] [] x86_64_start_kernel+0x14c/0x16f [ 511.727552] [ 511.727555] [] verify_cpu+0x0/0xfc [ 511.729936] RECLAIM_FS-ON-W at: [ 511.731059] [ 511.731063] [] mark_held_locks+0x71/0x90 [ 511.733851] [ 511.733857] [] lockdep_trace_alloc+0x6f/0xd0 [ 511.736601] [ 511.736604] [] kmem_cache_alloc_node_trace+0x48/0x3b0 [ 511.739325] [ 511.739329] [] __smpboot_create_thread.part.2+0x35/0xf0 [ 511.742499] [ 511.742503] [] smpboot_create_threads+0x66/0x90 [ 511.745233] [ 511.745236] [] cpuhp_invoke_callback+0x229/0x9e0 [ 511.747909] [ 511.747911] [] cpuhp_up_callbacks+0x37/0xb0 [ 511.750604] [ 511.750606] [] _cpu_up+0x89/0xf0 [ 511.753180] [ 511.753182] [] do_cpu_up+0x85/0xb0 [ 511.755982] [ 511.755986] [] cpu_up+0x13/0x20 [ 511.758565] [ 511.758568] [] smp_init+0x6b/0xcc [ 511.761138] [ 511.761141] [] kernel_init_freeable+0x17d/0x2ac [ 511.763877] [ 511.763881] [] kernel_init+0xe/0x110 [ 511.766703] [ 511.766709] [] ret_from_fork+0x31/0x40 [ 511.769522] RECLAIM_FS-ON-R at: [ 511.770730] [ 511.770735] [] mark_held_locks+0x71/0x90 [ 511.773324] [ 511.773327] [] lockdep_trace_alloc+0x6f/0xd0 [ 511.775897] [ 511.775900] [] kmem_cache_alloc_node_trace+0x48/0x3b0 [ 511.778659] [ 511.778663] [] allocate_shared_regs+0x29/0x70 [ 511.781485] [ 511.781488] [] intel_pmu_cpu_prepare+0x37/0x140 [ 511.784574] [ 511.784578] [] x86_pmu_prepare_cpu+0x40/0x50 [ 511.787169] [ 511.787172] [] cpuhp_invoke_callback+0x229/0x9e0 [ 511.789906] [ 511.789909] [] cpuhp_issue_call+0xe2/0x140 [ 511.792625] [ 511.792628] [] __cpuhp_setup_state+0x12d/0x190 [ 511.795441] [ 511.795446] [] init_hw_perf_events+0x402/0x5b6 [ 511.798187] [ 511.798190] [] do_one_initcall+0x51/0x1c0 [ 511.801133] [ 511.801139] [] kernel_init_freeable+0x155/0x2ac [ 511.803812] [ 511.803816] [] kernel_init+0xe/0x110 [ 511.806381] [ 511.806385] [] ret_from_fork+0x31/0x40 [ 511.808849] INITIAL USE at: [ 511.809876] [ 511.809881] [] __lock_acquire+0x36f/0x1640 [ 511.812607] [ 511.812610] [] lock_acquire+0xc9/0x250 [ 511.815088] [ 511.815092] [] get_online_cpus+0x5d/0x80 [ 511.817776] [ 511.817779] [] __cpuhp_setup_state+0x43/0x190 [ 511.820394] [ 511.820397] [] page_alloc_init+0x23/0x3a [ 511.823000] [ 511.823003] [] start_kernel+0x1a2/0x4d6 [ 511.825495] [ 511.825497] [] x86_64_start_reservations+0x2a/0x2c [ 511.828158] [ 511.828160] [] x86_64_start_kernel+0x14c/0x16f [ 511.830986] [ 511.830991] [] verify_cpu+0x0/0xfc [ 511.833452] } [ 511.834219] ... key at: [] cpu_hotplug+0x108/0x140 [ 511.835931] ... acquired at: [ 511.836924] [ 511.836927] [] check_irq_usage+0x4a/0xb0 [ 511.839589] [ 511.839593] [] __lock_acquire+0xe7b/0x1640 [ 511.842158] [ 511.842162] [] lock_acquire+0xc9/0x250 [ 511.844452] [ 511.844454] [] get_online_cpus+0x5d/0x80 [ 511.846668] [ 511.846671] [] drain_all_pages.part.89+0x2c/0x2c0 [ 511.849257] [ 511.849264] [] __alloc_pages_slowpath+0x509/0xe36 [ 511.852127] [ 511.852132] [] __alloc_pages_nodemask+0x382/0x3d0 [ 511.854545] [ 511.854549] [] alloc_pages_current+0x97/0x1b0 [ 511.856942] [ 511.856946] [] __page_cache_alloc+0x15d/0x1a0 [ 511.859259] [ 511.859262] [] pagecache_get_page+0x5a/0x2b0 [ 511.861595] [ 511.861598] [] __getblk_gfp+0x112/0x390 [ 511.863893] [ 511.863897] [] __ext4_get_inode_loc+0x10a/0x560 [ 511.866538] [ 511.866542] [] ext4_get_inode_loc+0x20/0x30 [ 511.868929] [ 511.868932] [] ext4_reserve_inode_write+0x26/0x90 [ 511.871579] [ 511.871584] [] ext4_mark_inode_dirty+0x8e/0x390 [ 511.874088] [ 511.874092] [] ext4_ext_tree_init+0x3a/0x40 [ 511.876398] [ 511.876400] [] __ext4_new_inode+0x12da/0x1540 [ 511.878735] [ 511.878737] [] ext4_create+0xd2/0x1a0 [ 511.881170] [ 511.881174] [] lookup_open+0x653/0x7b0 [ 511.883841] [ 511.883848] [] path_openat+0x626/0xd50 [ 511.886058] [ 511.886061] [] do_filp_open+0x91/0x100 [ 511.888285] [ 511.888288] [] do_sys_open+0x124/0x210 [ 511.890642] [ 511.890644] [] SyS_open+0x1e/0x20 [ 511.892781] [ 511.892784] [] do_syscall_64+0x6c/0x200 [ 511.895050] [ 511.895053] [] return_from_SYSCALL_64+0x0/0x7a [ 511.897382] [ 511.898165] [ 511.898165] stack backtrace: [ 511.900033] CPU: 0 PID: 49302 Comm: a.out Not tainted 4.10.0-rc6-next-20170202+ #500 [ 511.901974] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015 [ 511.904851] Call Trace: [ 511.905789] dump_stack+0x85/0xc9 [ 511.906854] check_usage+0x4ba/0x4d0 [ 511.907984] ? delayacct_end+0x56/0x60 [ 511.909136] check_irq_usage+0x4a/0xb0 [ 511.910318] __lock_acquire+0xe7b/0x1640 [ 511.911470] ? delayacct_end+0x56/0x60 [ 511.912607] lock_acquire+0xc9/0x250 [ 511.913703] ? get_online_cpus+0x37/0x80 [ 511.914888] get_online_cpus+0x5d/0x80 [ 511.916137] ? get_online_cpus+0x37/0x80 [ 511.917287] drain_all_pages.part.89+0x2c/0x2c0 [ 511.918539] __alloc_pages_slowpath+0x509/0xe36 [ 511.919889] __alloc_pages_nodemask+0x382/0x3d0 [ 511.921673] ? sched_clock_cpu+0x11/0xc0 [ 511.922919] alloc_pages_current+0x97/0x1b0 [ 511.924123] __page_cache_alloc+0x15d/0x1a0 [ 511.925252] pagecache_get_page+0x5a/0x2b0 [ 511.926392] __getblk_gfp+0x112/0x390 [ 511.927524] __ext4_get_inode_loc+0x10a/0x560 [ 511.928723] ? ext4_ext_tree_init+0x3a/0x40 [ 511.929900] ext4_get_inode_loc+0x20/0x30 [ 511.931008] ext4_reserve_inode_write+0x26/0x90 [ 511.932370] ? ext4_ext_tree_init+0x3a/0x40 [ 511.933582] ext4_mark_inode_dirty+0x8e/0x390 [ 511.934807] ext4_ext_tree_init+0x3a/0x40 [ 511.935919] __ext4_new_inode+0x12da/0x1540 [ 511.937093] ext4_create+0xd2/0x1a0 [ 511.938106] lookup_open+0x653/0x7b0 [ 511.939108] ? __wake_up+0x23/0x50 [ 511.940131] ? sched_clock+0x9/0x10 [ 511.941184] path_openat+0x626/0xd50 [ 511.942194] do_filp_open+0x91/0x100 [ 511.943164] ? _raw_spin_unlock+0x27/0x40 [ 511.944335] ? __alloc_fd+0xf7/0x210 [ 511.945350] do_sys_open+0x124/0x210 [ 511.946333] SyS_open+0x1e/0x20 [ 511.947189] do_syscall_64+0x6c/0x200 [ 511.948208] entry_SYSCALL64_slow_path+0x25/0x25 [ 511.949587] RIP: 0033:0x7feb6a026a10 [ 511.950555] RSP: 002b:00007ffce3579c88 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 [ 511.952261] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007feb6a026a10 [ 511.953864] RDX: 0000000000000180 RSI: 0000000000004441 RDI: 00000000006010c0 [ 511.955566] RBP: 0000000000000000 R08: 00007feb69f86938 R09: 000000000000000f [ 511.957231] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000040083b [ 511.958864] R13: 00007ffce3579d90 R14: 0000000000000000 R15: 0000000000000000 Below one is also a loop. Maybe we can add __GFP_NOMEMALLOC to GFP_NOWAIT ? [ 257.781715] Out of memory: Kill process 5171 (a.out) score 842 or sacrifice child [ 257.784726] Killed process 5171 (a.out) total-vm:2177096kB, anon-rss:1476488kB, file-rss:4kB, shmem-rss:0kB [ 257.787691] a.out(5171): TIF_MEMDIE allocation: order=0 mode=0x1000200(GFP_NOWAIT|__GFP_NOWARN) [ 257.789789] CPU: 3 PID: 5171 Comm: a.out Not tainted 4.10.0-rc6-next-20170202+ #500 [ 257.791784] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015 [ 257.794700] Call Trace: [ 257.795690] dump_stack+0x85/0xc9 [ 257.797224] __alloc_pages_slowpath+0xacb/0xe36 [ 257.798612] __alloc_pages_nodemask+0x382/0x3d0 [ 257.799942] alloc_pages_current+0x97/0x1b0 [ 257.801236] __get_free_pages+0x14/0x50 [ 257.802546] __tlb_remove_page_size+0x70/0xd0 [ 257.803810] unmap_page_range+0x74b/0xa80 [ 257.804992] unmap_single_vma+0x81/0xf0 [ 257.806131] unmap_vmas+0x41/0x60 [ 257.807179] exit_mmap+0x97/0x150 [ 257.808282] ? __khugepaged_exit+0xe5/0x130 [ 257.809594] mmput+0x80/0x150 [ 257.810566] do_exit+0x2c0/0xd70 [ 257.811609] do_group_exit+0x4c/0xc0 [ 257.813035] get_signal+0x35f/0x9b0 [ 257.814199] do_signal+0x37/0x730 [ 257.815215] ? mutex_unlock+0x12/0x20 [ 257.816285] ? pagefault_out_of_memory+0x75/0x80 [ 257.817872] ? mm_fault_error+0x65/0x152 [ 257.819027] ? exit_to_usermode_loop+0x26/0x92 [ 257.820277] exit_to_usermode_loop+0x51/0x92 [ 257.821480] prepare_exit_to_usermode+0x7f/0x90 [ 257.822756] retint_user+0x8/0x23 [ 257.823755] RIP: 0033:0x400780 [ 257.824717] RSP: 002b:00007ffce4497640 EFLAGS: 00010206 [ 257.826061] RAX: 000000005a1de000 RBX: 0000000080000000 RCX: 00007f11b8887650 [ 257.827774] RDX: 0000000000000000 RSI: 00007ffce4497460 RDI: 00007ffce4497460 [ 257.829770] RBP: 00007f10b89be010 R08: 00007ffce4497570 R09: 00007ffce44973b0 [ 257.831714] R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000007 [ 257.833447] R13: 00007f10b89be010 R14: 0000000000000000 R15: 0000000000000000 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org