Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934595AbcLPWro (ORCPT ); Fri, 16 Dec 2016 17:47:44 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:33169 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933629AbcLPWrm (ORCPT ); Fri, 16 Dec 2016 17:47:42 -0500 Subject: Re: OOM: Better, but still there on 4.9 To: Michal Hocko References: <20161215225702.GA27944@boerne.fritz.box> <20161216073941.GA26976@dhcp22.suse.cz> <1da4691d-d0da-a620-020c-c2e968c2a5ec@fb.com> <20161216221420.GF7645@dhcp22.suse.cz> CC: Nils Holland , , , David Sterba , From: Chris Mason Message-ID: <4e87e963-154a-df2c-80a4-ecc6d898f9a8@fb.com> Date: Fri, 16 Dec 2016 17:47:25 -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: <20161216221420.GF7645@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: MWHPR19CA0063.namprd19.prod.outlook.com (10.173.117.25) To BN6PR15MB1236.namprd15.prod.outlook.com (10.172.206.10) X-MS-Office365-Filtering-Correlation-Id: f4f952c5-271f-43f3-678f-08d426058588 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR15MB1236; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1236;3:im72WWIA906GPnMi3qb16ngGS0wEUUNHw0hZCQfouYY+ZL/4SYhRHn5mK0qzf7qvQwgmWh7DT0lKGla5V7Te7wYvYJSt4aDlcm2O3cn/IhxY614F8XWIM/fb+Jfg3l7WRJplwRO+uJ4DiiXAuTiOnO38C2BxMGniUqevjEtupBjoKgYE60I9JjWmivpaoxunKRCsG5Nk2pYknrHq9NjA4pcX2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9uP4v7fr/3ozkiuGzcQIFMkYeS0CxFRJ04ZkBxzDum9eU+dUk6bbhHTsxFIRFlv71bD9B7LYCO1H2ezOK+yqG6n+OaobJ8qXW8zjWS0dcYcMz0ai8yDGCKaZeNdGu36i1H0++fAaaM=;20:MIisnuPhsbJCahyWirmgw6Huxoohnyon2Y52Qc5cLkbR7Um6xzNWDDxgQ57EBvaMr1PfIiIVa//PQabTPEmnvxujZETWm8nsGzfG6t1m5C3iE+fwxqxSXFOBlZ7rOnmV08ON/mBlqbt+l1JnYqZjouhgDolyMlEte+coz2c3RAR2x88d/KOaUVVXsBLN0tBfE5MossxRnk4Af8GjgoMZCFV1sGV0ha3wmAUSD3hd3CRjF/vz96hF1S0Fr5lq4wTt5/mofb23KdKI365phE1paWVlUC9dtWPQmScA02DChJWNLUibvKT/n9Y3XK7BM06TALzKK76aNeAyx98u9a1UgbRC/Tbaa2GfEbg+AIBJ+b+T5EeTFyPJj0FTJx+/FgYi5N5VIUaqfr57rBFD5/IbUcCf+QXxwaOY3rHbtFW7F9sy7HSOaL3WCxdXqIUG7R1mOKjAvZ0F4NiQIbbcVSiEFZW3L9NQETG1bDZ18lIw9WElBOXwQ83E2lca3UbmPaeQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148);SRVR:BN6PR15MB1236;BCL:0;PCL:0;RULEID:;SRVR:BN6PR15MB1236; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1236;4:Py4lNGyq7hiAYHDdqJ6tqpg/ojibi3in/G8y9S+9Rl9dwmvLZ7pbat32Lyakh0IRVQUzOYm/oTmnUzKmi5v0pGFQ7bOri7OgjyaZM4b/T9vW7Ez3UiaeHZOm/wW9vIe+qXRV1tTcbrFyLOi3eJDNS02Tpr3no/h87RK8GKPR8TbTWtC0fHOum7yvzjHg0jQhlPt1PVmS/w1FF9v8ryXPPOXfogtFb+cpzBXUntp1juT/8fMsHNXbhyR41poGsIfTPWcsmSerxxJiU62ysTwC1OAg+KanCeJ+8ye/+Sz8q7htJ4W35n3vb9LaiVvbY1JwZcVDlzmcS0gSV2UubKTmAtbICA6ggtlN0avWqw6B5lOCBiQs2FfDf1vygc6Wknb+uIQKGchNRdQnLrYdVsJXSEkbdMPMZZI1tRnxB3IZa37/IF5XSgccYHcTGP17kEuJSQYbZV+7X1kff+kl54Kk09uwfDaD9z1WWwBMO17tc82JJQJulBNzODTNQTFN33y/vSByTluFoo4OnF4TGOAJY02/uXSE0hhTbThHX0JHU9xgNr1QJwdL/xYnkB5bsdzone1x4z0QgUmQcwd20mfnVg== X-Forefront-PRVS: 01583E185C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(39410400002)(39840400002)(39450400003)(24454002)(377454003)(199003)(189002)(377424004)(97736004)(101416001)(106356001)(2906002)(38730400001)(6666003)(77096006)(189998001)(23746002)(7736002)(50986999)(31686004)(6486002)(4326007)(2950100002)(54356999)(76176999)(65806001)(25786008)(86362001)(47776003)(110136003)(3846002)(31696002)(6116002)(90366009)(6916009)(66066001)(230700001)(65956001)(229853002)(83506001)(117156001)(4001350100001)(65826007)(50466002)(33646002)(8676002)(81156014)(551934003)(42186005)(93886004)(5660300001)(36756003)(68736007)(305945005)(92566002)(64126003)(81166006)(105586002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1236;H:[192.168.1.14];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BN6PR15MB1236;23:lpPpWw6i/ssbbzFovP07qHvLU1xn2xujqJ8tD?= =?Windows-1252?Q?zjaOXqMjwUyi4T1H+tsBFs+K/YZ8a7NdnkObvyYFrqxOV0Bgfd4dwSns?= =?Windows-1252?Q?NSeWsAqtqsG3g7bxuBHe6bCv2SBFwF7w7gt7PNRms8/DPsMm9uWNBJnO?= =?Windows-1252?Q?sFqdGNvUaE5dD0uHoDPg/7PJY52e49Qva5KrvtTGX5EQAzF2VAErZyHR?= =?Windows-1252?Q?UxcJ+QvtGxeyF63deo5rnoWQvgzbtjT50N9PukHaQYq6pOGnsnfrFSSW?= =?Windows-1252?Q?ZAlNen3zHK6MmfF3fLwP6RsO0HnkAh9MXlLasJiuFt+QBQYEMq3TTNSJ?= =?Windows-1252?Q?ZZFPe4Qx7qDMkxCifbVmfQLIBjs1IGYsDuBkzK6OM0BZ9MnTdEkYnG+y?= =?Windows-1252?Q?3H0lhRCMdXPteBozAeIh7s0OVmtaaF7ljIxKdJbTfqC7HBPc33WL0FEw?= =?Windows-1252?Q?QVghOCjAeqQ4eDvAE6TtMKPZNXWKm4OsSVNVM16A+URVoRg08ItVR5EL?= =?Windows-1252?Q?kBO5ytVCvv3AFsKw4YVKJO43DfeYE4fqKhRnmwSSpYOu42Vyqkh6krB6?= =?Windows-1252?Q?pg9DKYt72tQ1yCwB2ozrexTJ+VFcawMDI3D0uwqBUqAeqP/N5cuHE2qH?= =?Windows-1252?Q?Rq5yrSp0wO2q2klRVzsN1NJKmjzQSi8JMT688C5f91m7BIhrcPBaIwCa?= =?Windows-1252?Q?IHAVrADHzRcdIVGXDD7h3/V+wWsnMmcf5kSsknhpil4BYzzL2tYwKnsl?= =?Windows-1252?Q?MY1TTfplB9StFUdiGIZlL9zD9omvVD89CZ1m3VtAhc0/3a2djVcx/W+v?= =?Windows-1252?Q?+PqEnWkeDJmUKeqlTJoT0Xpc7HRjhkokFI9CD+H/nJAzlAsV2c8b2Bl9?= =?Windows-1252?Q?GOscaQej49XjKz7cwXLqqqVLJt8f9Mm6uzRjJFwFaTzPB1OVg2NdXmYN?= =?Windows-1252?Q?+4WaGPi3KIAicmvhR/WOyk3pziG3mI4XKPGQ8IzqEfPs43iEQ+PBdaxW?= =?Windows-1252?Q?UFyXMseNQZmYZhhjpDXA86OO8iposU38WTOMWo0YUp3ak4roFChi68a8?= =?Windows-1252?Q?4bnjHFe9O04Pyceo73VXF7hy2eKCKkoAJGvMLIsJBlGiDUl94xVK3fwO?= =?Windows-1252?Q?4LmXKWFaFhFfqC92Mqaz5hnlvZim4oKEpL1q9kNcltYjnoaVdvrrOERw?= =?Windows-1252?Q?RDQYpj3+aSpbShhh+x9JVLyw9xaVOSY9Pi7u4ojBwIcDwD7c9tL38GTY?= =?Windows-1252?Q?gkl2UoCvFH4FtnCiPLNVQ7BtWsXH1TtbZhKnqobkORHsd7hC/JlJmlME?= =?Windows-1252?Q?nrinZF0xFJKXj8iK821wU0OOc1uZ9fYIPeZc+2HDA6cdgQDJb91001Z3?= =?Windows-1252?Q?bZhs/7HqrFYSDV5DRsOjf+rx48oC3XW+X8uJej0FA2K0HdbCPdG4P/by?= =?Windows-1252?Q?o8fhMdwsUO7bGBTbXrCIrayRNCU/JO/EJDQI0omYJMGu3D4iwqxoPQ+o?= =?Windows-1252?Q?dnoLL2PburZEO3NsQbJ+nPuQDpI3dtTb/R9mS2V7extQjOOZKfUiB/H6?= =?Windows-1252?Q?v2oLwc0flBJ0voU3EWobWBraKLZF6njhOy2LIdIFDC9UTmaDhWqUsRX0?= =?Windows-1252?Q?6JbLJ0ym1tn+BkdCzcuNEI=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1236;6:i9ZFUH8aiGMjzC3E3rz9L5G5HTJcHu9EF5rmPsM2QwgyePz3OuDaLzFqqwUr93ei0nFn77bqUdbjQsqBrAKCfsXLvuVF0+/UZNlxLqN7gEVyGLED7hpVKsX+yiUaKJDzVpzHAWGSqvFFKRDqsTMyzt0c4vYUvkvwtvTStTHUNDy9B6iWyd9rlKwbgxmIoTxpieLIVNQHra9rpWdAspMozYF1m22XBu5Ryfk+9BkeAIe8/Ah1nxf6NPsbkqNm+UsrtR0nHgLJmdu0tgz9x4lOMHy089YO1CJNvWxbvJ0RX1DlueX9+pUu4VskxeqgY6uuq+uO99fTrX1iOYV311+25UtNu0NyWOmsMakqwBay3s9tS9mDnkWOhGl1TTdJ4ePMjd68jupsFsKOAOWEuuRTJLP0O01kA9IrvpOnIblGub0=;5:BGhxWOrav4Y+y4ZVU9hGlR82hBBy2xhpmBN8z0SedOQxymhIzFM33BodyM85HnkocHKFgDlYIURoB+39NISeNhrzj4DSHG/WHnA0zVLQoIr2Y7RzL6ohxsfLIj1AelKkhporVuE6Od7Axi3zed42ig==;24:9avfvZF1sScG0R1L985hNIfyohh2Uhj2cUhRd5DrNBE3wjtyFbrt5VkPSJ0gl/F9kAMf4AA+pMaGirRWoHxsbqCnRXB2czUewgeG+5oDQVM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1236;7:fWxrE+H84xYj3U6jvwF/zQoX0rgZaGYqvD4xQ21lCl63Z9RFpI5Bw3yRR6t1gpPlsxATktWK30yo8duAjRMBr77Ur7joEpAAhxy5LYaSffBoqlnEyHnDqR+GZwoyWd48/kpC9SikU5bigBxlTpyNAB9vfGKWbtRSLstT06Mziq+n02UN8x5rNH9sDXSMFYGVhvdY8xCrCS1KcuRr132E5Wp6Idxg4Ckms9dsH6rdoa+irS7/z2jpP2wAOenfeMStXbcb4/t17SJpTeZ/a2vpLlfGS46l1eV6V3sa9aCWhLCLqdqPQWvK/W9s4j/VACN+8n3x30l9wASRZ2QiJs0jEk6xotaZj6NpVxyg5jGoi0qkiI0E9Tj9L9qt3t7HCfEdJ2FfSDghWio0veHRkWNuvcDiExrAM7OYqwpREdL2L2bwqwyoWUiX9uDjVVLC4MKOft5eHYkR/x8n9vnzI9rAlw==;20:YGjKZpOXjmYs78y5XrkUn+gm4geL2w7mfIZGo0VT4L3fgJIhTegQT1JHanosxc4NwfMLwOKg5UVHUZs8rDnqHMf3NtnjKHbrDKaUzK68nqX13dxLElKsJHtGHw8rUCpaVnjzwOOzvo5PKMASaK5io7kI2+VJEpnHRTKZLP30RIE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2016 22:47:31.0142 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1236 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_14:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1250 Lines: 29 On 12/16/2016 05:14 PM, Michal Hocko wrote: > On Fri 16-12-16 13:15:18, Chris Mason wrote: >> On 12/16/2016 02:39 AM, Michal Hocko wrote: > [...] >>> 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? > > I am more interested in the NOFS part. Why cannot this be a full > GFP_KERNEL context? What kind of locks we would lock up when recursing > to the fs via slab shrinkers? > Since this is our writepages call, any jump into direct reclaim would go to writepage, which would end up calling the same set of code to read metadata blocks, which would do a GFP_KERNEL allocation and end up back in writepage again. We'd also have issues with blowing through transaction reservations since the writepage recursion would have to nest into the running transaction. -chris