Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757081AbcLPSPn (ORCPT ); Fri, 16 Dec 2016 13:15:43 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:56184 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754517AbcLPSPe (ORCPT ); Fri, 16 Dec 2016 13:15:34 -0500 Subject: Re: OOM: Better, but still there on 4.9 To: Michal Hocko , Nils Holland References: <20161215225702.GA27944@boerne.fritz.box> <20161216073941.GA26976@dhcp22.suse.cz> CC: , , David Sterba , From: Chris Mason Message-ID: <1da4691d-d0da-a620-020c-c2e968c2a5ec@fb.com> Date: Fri, 16 Dec 2016 13:15:18 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161216073941.GA26976@dhcp22.suse.cz> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.101.197.43] X-ClientProxiedBy: CY4PR16CA0041.namprd16.prod.outlook.com (10.171.216.28) To CY4PR15MB1239.namprd15.prod.outlook.com (10.172.178.138) X-MS-Office365-Filtering-Correlation-Id: b12d8a45-3aa3-4c79-8ff4-08d425df805a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR15MB1239; X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1239;3:6eLm9dNnoOUmAEeHVgrv4JInm5upCvT5eA4aX6xWLzz3wrEPho9vR8komh0A5vtqC1tJ9IgdY9wl/HscEwO1Y71eJ0moOc7s5oACWeV0WPw7xzB7Av6T1Sp4MttiHTGQGWU9G/VxaOSSph4Y25277yK4cSTMtIORjzons8XfChDmjBx6ePos6HflUpYIQbj6cYbQhVF4Nya1sh1hBOqjvmFyNtoF1BlA+OyS4JuT/2t+bzAh/DHI0ICME/BtRM6iKYXg9il8FCnHNW1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LNlyTVn2B3O8F1yih97N5bAApsfpDm4/3YRvZ5EMGC/vMnBmBprc4+FEfV0491PK9cEx48LIFLsG9XlL3Dh69/tvQuDDX5OQHDoLspf7JfjWJe67oXMOxcUi6i7NnGqCfImFwoQtDKCWYNBCzxJKpxmdC0KrfIYwdREk3mMt8+WlIZLmpNrswPCoSHV4gmg8QRp2tBvw6TXSq+zdOYhoOGv93PYWkouYZW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(20161123558021)(6072148);SRVR:CY4PR15MB1239;BCL:0;PCL:0;RULEID:;SRVR:CY4PR15MB1239; X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1239;4:a56BS573KcIbQYQK9LSxy0Ws1aRoT2fE8CNzFBD23u8no056/loS04lmY0VFwDf1bCmaqrhWUPmzSP1LX+9/Rj3nFz98tq9HCrnBZgc3FFnTmd6g7WnMJW7MoV9e6aqUNH733Rp4/0Tt5me9olUMg9wSQZCnB4cSPHmRQ3/2IFXmMmkIFPk/sbj19FOlroqvynG0O6bbS5+Kpp5vOQye2rPTAJplhArR3d0UDShY173ujhzyEm0FZxyFcKsBJv8t5yeg8fq8IFQDRehlyEpO42gxCY4gmKySlrs47DqTsrx9JaoprWC7DwEBU5eybIBJvZRK+UoFh+z7IooOuaVr1s587Ki3mvd96n4SnmLuhlJUvMJCGXkVucvPdS6W+DMcxbvIasD+bdR7znfG9wtsxPqPjBZ0enmzgWtNuNY189FBLu5todDPh8Z34BIjkIZt1VyR8+vqNOQjGMuoriimqHnRlNMlmpcxwv5bH0tZhJTboz6VJr0nHKD6MUJzn2ezib1t2z4dBQxXe4uO2mf9d77Yc+9OksF/+5+ch0dZME0uVUu9WpwSovvAFX+Fst4tLq9+KD1ak/nAuGlep4NGWsng6YiiU/nqhCkdcMJNEdY= X-Forefront-PRVS: 01583E185C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39840400002)(51234002)(199003)(24454002)(189002)(377454003)(377424004)(33646002)(229853002)(92566002)(2906002)(42186005)(551934003)(4326007)(101416001)(106356001)(6486002)(77096006)(105586002)(2950100002)(54356999)(6666003)(81166006)(305945005)(31686004)(7736002)(8676002)(38730400001)(50986999)(90366009)(81156014)(64126003)(5660300001)(47776003)(3846002)(6116002)(117156001)(189998001)(36756003)(4001350100001)(76176999)(25786008)(23746002)(50466002)(97736004)(86362001)(575784001)(5001770100001)(65826007)(230700001)(65956001)(66066001)(68736007)(83506001)(65806001)(31696002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR15MB1239;H:[192.168.1.14];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY4PR15MB1239;23:SNX4nbi4wUnPqB0Rf0EO+gwV5hRIlfx1AJ+Rm?= =?Windows-1252?Q?hoNUKIZtwhzLpaN32t/GIFqywjy5OzDjARCkwJk71hEHImt2XCQsH8Yv?= =?Windows-1252?Q?OglYAsULf3WR9JUu3F+G556mISg1/N41CjiwJOc1mvS8hgxD4SbpqsL6?= =?Windows-1252?Q?TWTkI8h7gk8xkpx5N6UW/x3dMwO+0JDm4qNp2QDzbbd+C/P8IGfioyLi?= =?Windows-1252?Q?uPjjO7pvSGrULfjwRsC43v2UXWehaiCb20YBnuf6boXhA4j6iU1gwria?= =?Windows-1252?Q?3SMHWo7RwihF9DShedbkgObXVfmiHG6feX8yvmjuO8BE6iYoqQ/Ii/A+?= =?Windows-1252?Q?Z2x245BRhNLIM0NuFQWQxrfHoZuS+9+FI+5MVcRQ4AT0fWqbXQDDgl1a?= =?Windows-1252?Q?e9IAC57cHjNY9xBK/s9WHf+ZVRdQ1sJCYkra1YHV181S6M1EagZR/CGq?= =?Windows-1252?Q?veGG0wrvWEfWSyz7UcD8ewqzpodt28nfywLRsNExIo7MinPVO/kHYXLL?= =?Windows-1252?Q?TWnEKy+L0nCmW7E8Ay7ZvKvkh7nOBcjeQIdenN8h7X7EVt2aZ41/opAG?= =?Windows-1252?Q?f2OVRAzpBdsaHQasK+rRtjhC5527aUHd3JQvnpH70Bfx2EXOgEpJz2ki?= =?Windows-1252?Q?tuCtTll8zLNgpgzaVcfRCE+bPU995Z0enOI7aUQ3VLxjdzyEQNjh/Mty?= =?Windows-1252?Q?NLf+V+6LOZWLp/8T1aAVXvqh2wejEA0vdlw0TaWvJ21fSNoQgMM6Evth?= =?Windows-1252?Q?q3bvBwSP2hRCe+7MPR/UoKwmRY7QILiz6Ml94YN6FAuW702VVSWwSEGn?= =?Windows-1252?Q?RnEpfcYHJ2JYm/YgayOWVb17YpXPT7fO42jXniiDHlQcfQ0lmw1bOh6T?= =?Windows-1252?Q?uA1dzpYOqqPpJi0NIzXSaxJcmWF++/L54IUp6ExJ44pP2E+1Wdce2AH7?= =?Windows-1252?Q?cOQFiQnXEHMfDWUL04GGwy6Ge93s+MIIt24cpmgukO6EB20nWegLLVEW?= =?Windows-1252?Q?gyo+p7YIz+t8eHRUlDLsAvfltFwvdI2Bz6bf8NBeqaYQHtVTEUY+Tb7Q?= =?Windows-1252?Q?OUbsZCK9HlWPHL/iVkAtVIbqzu7uJ+v10qBWpR62EK59fMACO3+IMblA?= =?Windows-1252?Q?HciQL1Si8vHiuK3Mkgh6RZlAy8hfYKglBgLlbWYGLhyRiCuMnP1ZCJ7k?= =?Windows-1252?Q?ojLdEcvwLqg/d3UW+qApka5LSqnBKzdGftRPznSGirgk8VbKMdzMom/X?= =?Windows-1252?Q?c/utyOtoxHv16q9xAZmU5ARuxrSgjbMMH+mSXVeztUlWKkYycxlCG8Hp?= =?Windows-1252?Q?jwdbe/qD5azbDHv1RzA0FJZiZNn7LNbGthuJUCeh+5I2pQJDR6K8dVE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5BqB8j0CROYwutWqUjGtVGaDZ4ruYQAvRhpxcNGbKo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR15MB1239;7:raaCya3XXbpryQrBNoC6XuxM8vjXC25SAfa+JROcLKEwJ8KWmbHk+W9Vktx/5IKKlY1sKdlGRA/K7DZ8wUvglIRDfBvDX4WHud6J91gliYrVgLrG+DR4xqzLhfGV+YRbL6k6We0KzH4EOM+B3R6j/ZvV/+EoiWI6uHYgLXwO9InClZV3ZrU42Z0535FTtB9kWrLyOr6Xp+0wUH6nmSnumJpKpgmPwHvIKZ/dmtOJvWa+hNLhxLYJP0lgv+MpDG+WG0z8Hlt8GDg7I7IGLz9CAkkAvinALRd6IZlHa/5U2i1Okl45QYj0mb2L3w/ViB8w5nRmb/BVgjDSliGLzj8y/Lo56Zuqtq7zUIMD1ZEbo6Ia2FIy+0LrS5lVltdwnkSHkjArFsu+WgrPe2i+cJ1iInCpFv4p94IiTnWt4276jDNHaJGJ0GTbYE7cu0T/5wV70jq6JYHmCeKpTVfHP+W9kg==;20:BQmdQ55BUR8Q+aYNpx+wFiKYWq2SE72eCof/12NvbuQqcR5MrHglL090uccUH/LT9VAsYJRs3D4M6mB/2w9LAZJydfUpKXgow7v5NOfXzOjPF0RyOYNwH/roSOO/An9Ejz0UhNBaFKNGO7ZGwCBKZ1Hcsli/TDq7pQ4oguGEksQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2016 18:15:22.2101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1239 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-16_10:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8417 Lines: 116 On 12/16/2016 02:39 AM, Michal Hocko wrote: > [CC linux-mm and btrfs guys] > > On Thu 15-12-16 23:57:04, Nils Holland wrote: > [...] >> Of course, none of this are workloads that are new / special in any >> way - prior to 4.8, I never experienced any issues doing the exact >> same things. >> >> Dec 15 19:02:16 teela kernel: kworker/u4:5 invoked oom-killer: gfp_mask=0x2400840(GFP_NOFS|__GFP_NOFAIL), nodemask=0, order=0, oom_score_adj=0 >> Dec 15 19:02:18 teela kernel: kworker/u4:5 cpuset=/ mems_allowed=0 >> Dec 15 19:02:18 teela kernel: CPU: 1 PID: 2603 Comm: kworker/u4:5 Not tainted 4.9.0-gentoo #2 >> Dec 15 19:02:18 teela kernel: Hardware name: Hewlett-Packard Compaq 15 Notebook PC/21F7, BIOS F.22 08/06/2014 >> Dec 15 19:02:18 teela kernel: Workqueue: writeback wb_workfn (flush-btrfs-1) >> Dec 15 19:02:18 teela kernel: eff0b604 c142bcce eff0b734 00000000 eff0b634 c1163332 00000000 00000292 >> Dec 15 19:02:18 teela kernel: eff0b634 c1431876 eff0b638 e7fb0b00 e7fa2900 e7fa2900 c1b58785 eff0b734 >> Dec 15 19:02:18 teela kernel: eff0b678 c110795f c1043895 eff0b664 c11075c7 00000007 00000000 00000000 >> Dec 15 19:02:18 teela kernel: Call Trace: >> Dec 15 19:02:18 teela kernel: [] dump_stack+0x47/0x69 >> Dec 15 19:02:18 teela kernel: [] dump_header+0x60/0x178 >> Dec 15 19:02:18 teela kernel: [] ? ___ratelimit+0x86/0xe0 >> Dec 15 19:02:18 teela kernel: [] oom_kill_process+0x20f/0x3d0 >> Dec 15 19:02:18 teela kernel: [] ? has_capability_noaudit+0x15/0x20 >> Dec 15 19:02:18 teela kernel: [] ? oom_badness.part.13+0xb7/0x130 >> Dec 15 19:02:18 teela kernel: [] out_of_memory+0xd9/0x260 >> Dec 15 19:02:18 teela kernel: [] __alloc_pages_nodemask+0xbfb/0xc80 >> Dec 15 19:02:18 teela kernel: [] pagecache_get_page+0xad/0x270 >> Dec 15 19:02:18 teela kernel: [] alloc_extent_buffer+0x116/0x3e0 >> Dec 15 19:02:18 teela kernel: [] btrfs_find_create_tree_block+0xe/0x10 >> Dec 15 19:02:18 teela kernel: [] btrfs_alloc_tree_block+0x1ef/0x5f0 >> Dec 15 19:02:18 teela kernel: [] __btrfs_cow_block+0x143/0x5f0 >> Dec 15 19:02:18 teela kernel: [] btrfs_cow_block+0x13a/0x220 >> Dec 15 19:02:18 teela kernel: [] btrfs_search_slot+0x1d1/0x870 >> Dec 15 19:02:18 teela kernel: [] btrfs_lookup_file_extent+0x4d/0x60 >> Dec 15 19:02:18 teela kernel: [] __btrfs_drop_extents+0x176/0x1070 >> Dec 15 19:02:18 teela kernel: [] ? kmem_cache_alloc+0xb7/0x190 >> Dec 15 19:02:18 teela kernel: [] ? start_transaction+0x65/0x4b0 >> Dec 15 19:02:18 teela kernel: [] ? __kmalloc+0x147/0x1e0 >> Dec 15 19:02:18 teela kernel: [] cow_file_range_inline+0x215/0x6b0 >> Dec 15 19:02:18 teela kernel: [] cow_file_range.isra.49+0x55c/0x6d0 >> Dec 15 19:02:18 teela kernel: [] ? lock_extent_bits+0x75/0x1e0 >> Dec 15 19:02:18 teela kernel: [] run_delalloc_range+0x441/0x470 >> Dec 15 19:02:18 teela kernel: [] writepage_delalloc.isra.47+0x144/0x1e0 >> Dec 15 19:02:18 teela kernel: [] __extent_writepage+0xd8/0x2b0 >> Dec 15 19:02:18 teela kernel: [] extent_writepages+0x25c/0x380 >> Dec 15 19:02:18 teela kernel: [] ? btrfs_real_readdir+0x610/0x610 >> Dec 15 19:02:18 teela kernel: [] btrfs_writepages+0x1f/0x30 >> Dec 15 19:02:18 teela kernel: [] do_writepages+0x15/0x40 >> Dec 15 19:02:18 teela kernel: [] __writeback_single_inode+0x35/0x2f0 >> Dec 15 19:02:18 teela kernel: [] writeback_sb_inodes+0x16e/0x340 >> Dec 15 19:02:18 teela kernel: [] wb_writeback+0xaa/0x280 >> Dec 15 19:02:18 teela kernel: [] wb_workfn+0xd8/0x3e0 >> Dec 15 19:02:18 teela kernel: [] process_one_work+0x114/0x3e0 >> Dec 15 19:02:18 teela kernel: [] worker_thread+0x2f/0x4b0 >> Dec 15 19:02:18 teela kernel: [] ? create_worker+0x180/0x180 >> Dec 15 19:02:18 teela kernel: [] kthread+0x97/0xb0 >> Dec 15 19:02:18 teela kernel: [] ? __kthread_parkme+0x60/0x60 >> Dec 15 19:02:18 teela kernel: [] ret_from_fork+0x1b/0x28 >> Dec 15 19:02:18 teela kernel: Mem-Info: >> Dec 15 19:02:18 teela kernel: active_anon:58685 inactive_anon:90 isolated_anon:0 >> active_file:274324 inactive_file:281962 isolated_file:0 > > OK, so there is still some anonymous memory that could be swapped out > and quite a lot of page cache. This might be harder to reclaim because > the allocation is a GFP_NOFS request which is limited in its reclaim > capabilities. It might be possible that those pagecache pages are pinned > in some way by the the filesystem. > >> unevictable:0 dirty:649 writeback:0 unstable:0 >> slab_reclaimable:40662 slab_unreclaimable:17754 >> mapped:7382 shmem:202 pagetables:351 bounce:0 >> free:206736 free_pcp:332 free_cma:0 >> Dec 15 19:02:18 teela kernel: Node 0 active_anon:234740kB inactive_anon:360kB active_file:1097296kB inactive_file:1127848kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:29528kB dirty:2596kB writeback:0kB shmem:0kB shmem_thp: 0kB shmem_pmdmapped: 184320kB anon_thp: 808kB writeback_tmp:0kB unstable:0kB pages_scanned:0 all_unreclaimable? no >> Dec 15 19:02:18 teela kernel: DMA free:3952kB min:788kB low:984kB high:1180kB active_anon:0kB inactive_anon:0kB active_file:7316kB inactive_file:0kB unevictable:0kB writepending:96kB present:15992kB managed:15916kB mlocked:0kB slab_reclaimable:3200kB slab_unreclaimable:1408kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB >> Dec 15 19:02:18 teela kernel: lowmem_reserve[]: 0 813 3474 3474 >> Dec 15 19:02:18 teela kernel: Normal free:41332kB min:41368kB low:51708kB high:62048kB active_anon:0kB inactive_anon:0kB active_file:532748kB inactive_file:44kB unevictable:0kB writepending:24kB present:897016kB managed:836248kB mlocked:0kB slab_reclaimable:159448kB slab_unreclaimable:69608kB kernel_stack:1112kB pagetables:1404kB bounce:0kB free_pcp:528kB local_pcp:340kB free_cma:0kB > > And this shows that there is no anonymous memory in the lowmem zone. > Note that this request cannot use the highmem zone so no swap out would > help. So if we are not able to reclaim those pages on the file LRU then > we are out of luck > >> Dec 15 19:02:18 teela kernel: lowmem_reserve[]: 0 0 21292 21292 >> Dec 15 19:02:18 teela kernel: HighMem free:781660kB min:512kB low:34356kB high:68200kB active_anon:234740kB inactive_anon:360kB active_file:557232kB inactive_file:1127804kB unevictable:0kB writepending:2592kB present:2725384kB managed:2725384kB mlocked:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:800kB local_pcp:608kB free_cma:0kB > > That being said, the OOM killer invocation is clearly pointless and > pre-mature. We normally do not invoke it normally for GFP_NOFS requests > exactly for these reasons. But this is GFP_NOFS|__GFP_NOFAIL which > behaves differently. I am about to change that but my last attempt [1] > has to be rethought. > > Now another thing is that the __GFP_NOFAIL which has this nasty side > effect has been introduced by me d1b5c5671d01 ("btrfs: Prevent from > early transaction abort") in 4.3 so I am quite surprised that this has > shown up only in 4.8. Anyway there might be some other changes in the > btrfs which could make it more subtle. > > I believe the right way to go around this is to pursue what I've started > in [1]. I will try to prepare something for testing today for you. Stay > tuned. But I would be really happy if somebody from the btrfs camp could > check the NOFS aspect of this allocation. We have already seen > allocation stalls from this path quite recently Just double checking, are you asking why we're using GFP_NOFS to avoid going into btrfs from the btrfs writepages call, or are you asking why we aren't allowing highmem? For why we're not using highmem, it goes back to 2011: commit a65917156e345946dbde3d7effd28124c6d6a8c2 Btrfs: stop using highmem for extent_buffers The short answer is that kmap + shared caching pointer between threads made it hugely complex. I gave up and dropped the highmem part. -chris