From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f198.google.com (mail-wr0-f198.google.com [209.85.128.198]) by kanga.kvack.org (Postfix) with ESMTP id 7AC2E800D8 for ; Thu, 25 Jan 2018 03:36:08 -0500 (EST) Received: by mail-wr0-f198.google.com with SMTP id h38so3981046wrh.11 for ; Thu, 25 Jan 2018 00:36:08 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id g8si3467423wrg.136.2018.01.25.00.36.07 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jan 2018 00:36:07 -0800 (PST) Date: Thu, 25 Jan 2018 09:36:04 +0100 From: Michal Hocko Subject: Re: [PATCH 1/2] mm,vmscan: Kill global shrinker lock. Message-ID: <20180125083604.GM28465@dhcp22.suse.cz> References: <20171115140020.GA6771@cmpxchg.org> <20171115141113.2nw4c4nejermhckb@dhcp22.suse.cz> <201801250204.w0P24NKZ033992@www262.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201801250204.w0P24NKZ033992@www262.sakura.ne.jp> Sender: owner-linux-mm@kvack.org List-ID: To: Tetsuo Handa Cc: Johannes Weiner , linux-mm@lists.ewheeler.net, Minchan Kim , Huang Ying , Mel Gorman , Vladimir Davydov , Andrew Morton , Shakeel Butt , Greg Thelen , linux-mm@kvack.org, linux-kernel@vger.kernel.org On Thu 25-01-18 11:04:23, Tetsuo Handa wrote: > Michal Hocko wrote: > > On Wed 15-11-17 09:00:20, Johannes Weiner wrote: > > > In any case, Minchan's lock breaking seems way preferable over that > > > level of headscratching complexity for an unusual case like Shakeel's. > > > > agreed! I would go the more complex way only if it turns out that early > > break out causes some real problems. > > > > Eric Wheeler wrote (at http://lkml.kernel.org/r/alpine.LRH.2.11.1801242349220.30642@mail.ewheeler.net ): > > Hello all, > > > > We are getting processes stuck with /proc/pid/stack listing the following: > > Yes, I think that this is a silent OOM lockup. > > > > > [] io_schedule+0x12/0x40 > > [] __lock_page+0x105/0x150 > > [] pagecache_get_page+0x161/0x210 > > [] shmem_unused_huge_shrink+0x334/0x3f0 > > [] super_cache_scan+0x176/0x180 > > [] shrink_slab+0x275/0x460 > > [] shrink_node+0x10e/0x320 > > [] node_reclaim+0x19d/0x250 > > [] get_page_from_freelist+0x16a/0xac0 > > [] __alloc_pages_nodemask+0x107/0x290 > > [] pte_alloc_one+0x13/0x40 > > [] __pte_alloc+0x19/0x100 > > [] alloc_set_pte+0x468/0x4c0 > > [] finish_fault+0x3a/0x70 > > [] __handle_mm_fault+0x94a/0x1190 > > [] handle_mm_fault+0xc4/0x1d0 > > [] __do_page_fault+0x253/0x4d0 > > [] do_page_fault+0x33/0x120 > > [] page_fault+0x4c/0x60 > > > > > > For some reason io_schedule is not coming back, so shrinker_rwsem never > > gets an up_read. When this happens, other processes like libvirt get stuck > > trying to start VMs with the /proc/pid/stack of libvirtd looking like so, > > while register_shrinker waits for shrinker_rwsem to be released: > > > > [] call_rwsem_down_write_failed+0x13/0x20 > > [] register_shrinker+0x45/0xa0 > > [] sget_userns+0x468/0x4a0 > > [] mount_nodev+0x2a/0xa0 > > [] mount_fs+0x34/0x150 > > [] vfs_kern_mount+0x62/0x120 > > [] do_mount+0x1ee/0xc50 > > [] SyS_mount+0x7e/0xd0 > > [] do_syscall_64+0x61/0x1a0 > > [] entry_SYSCALL64_slow_path+0x25/0x25 > > [] 0xffffffffffffffff > > > > If io_schedule() depends on somebody else's memory allocation request, that > somebody else will call shrink_slab() and down_read_trylock(&shrinker_rwsem) > will fail without making progress. This means that that somebody else will > forever retry as long as should_continue_reclaim() returns true. I would rather understand the problem than speculate here. I strongly suspect somebody simply didn't unlock the page. -- Michal Hocko SUSE Labs -- 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