Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754830AbcLASQp (ORCPT ); Thu, 1 Dec 2016 13:16:45 -0500 Received: from mail-yb0-f194.google.com ([209.85.213.194]:33623 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbcLASQn (ORCPT ); Thu, 1 Dec 2016 13:16:43 -0500 MIME-Version: 1.0 In-Reply-To: <20161201135014.jrr65ptxczplmdkn@kmo-pixel> References: <20161128072315.GC14788@dhcp22.suse.cz> <20161129155537.f6qgnfmnoljwnx6j@merlins.org> <20161129160751.GC9796@dhcp22.suse.cz> <20161129163406.treuewaqgt4fy4kh@merlins.org> <20161129174019.fywddwo5h4pyix7r@merlins.org> <20161130174713.lhvqgophhiupzwrm@merlins.org> <20161130203011.GB15989@htj.duckdns.org> <20161201135014.jrr65ptxczplmdkn@kmo-pixel> From: Linus Torvalds Date: Thu, 1 Dec 2016 10:16:41 -0800 X-Google-Sender-Auth: ZLY79uOuBEchRUTdUKfZb55N9dk Message-ID: Subject: Re: 4.8.8 kernel trigger OOM killer repeatedly when I have lots of RAM that should be free To: Kent Overstreet Cc: Tejun Heo , Marc MERLIN , Jens Axboe , Michal Hocko , Vlastimil Babka , linux-mm , LKML , Joonsoo Kim , 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: 1208 Lines: 26 On Thu, Dec 1, 2016 at 5:50 AM, Kent Overstreet wrote: > > That said, I'm not sure how I feel about Jens's exact approach... it seems to me > that this can really just live within the writeback code, I don't know why it > should involve the block layer at all. plus, if I understand correctly his code > has the effect of blocking in generic_make_request() to throttle, which means > due to the way the writeback code is structured we'll be blocking with page > locks held. Yeah, I do *not* believe that throttling at the block layer is at all the right thing to do. I do think that the block layer needs to throttle, but it needs to be seen as a "last resort" kind of thing, where the block layer just needs to limit how much it will have oending. But it should be seen as a failure mode, not as a write balancing issue. Because the real throttling absolutely needs to happen when things are marked dirty, because no block layer throttling will ever fix the situation where you just have too much memory dirtied that you cannot free because it will take a minute to write out. So throttling at a VM level is sane. Throttling at a block layer level is not. Linus