Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933206AbcK2SB0 (ORCPT ); Tue, 29 Nov 2016 13:01:26 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:33971 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756778AbcK2SBL (ORCPT ); Tue, 29 Nov 2016 13:01:11 -0500 MIME-Version: 1.0 In-Reply-To: <20161129174019.fywddwo5h4pyix7r@merlins.org> References: <20161121215639.GF13371@merlins.org> <20161122160629.uzt2u6m75ash4ved@merlins.org> <48061a22-0203-de54-5a44-89773bff1e63@suse.cz> <20161123063410.GB2864@dhcp22.suse.cz> <20161128072315.GC14788@dhcp22.suse.cz> <20161129155537.f6qgnfmnoljwnx6j@merlins.org> <20161129160751.GC9796@dhcp22.suse.cz> <20161129163406.treuewaqgt4fy4kh@merlins.org> <20161129174019.fywddwo5h4pyix7r@merlins.org> From: Linus Torvalds Date: Tue, 29 Nov 2016 10:01:10 -0800 X-Google-Sender-Auth: BJk41KL4zKeKcwhnNEC7v7SCiio Message-ID: Subject: Re: 4.8.8 kernel trigger OOM killer repeatedly when I have lots of RAM that should be free To: Marc MERLIN Cc: Michal Hocko , Vlastimil Babka , linux-mm , LKML , Joonsoo Kim , Tejun Heo , Greg Kroah-Hartman Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1328 Lines: 29 On Tue, Nov 29, 2016 at 9:40 AM, Marc MERLIN wrote: > > In my case, it is a 5x 4TB HDD with > software raid 5 < bcache < dmcrypt < btrfs It doesn't sound like the nasty situations I have seen (particularly with large USB flash storage - often high momentary speed for benchmarks, but slows down to a crawl after you've written a bit to it, and doesn't have the smart garbage collection that modern "real" SSDs have). But while it doesn't sound like that nasty case, RAID5 will certainly not help your write speed, and with spinning rust that potentially up to 4GB (in fact, almost 5GB) of dirty pending data is going to take a long time to write out if it's not all nice and contiguous (which it won't be). And btrfs might be weak on that case - I remember complaining about fsync stuttering all IO a few years ago, exactly because it would force-flush everything else too (ie you were doing non-synchronous writes in one session, and then the browser did a "fsync" on the small writes it did to the mysql database, and suddenly the browser paused for ten seconds or more, because the fsync wasn't just waiting for the small database update, but for _everythinig_ to be written back). Your backtrace isn't for fsync, but it looks superficially similar: "wait for write data to flush". Linus