From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE40EC4338F for ; Tue, 17 Aug 2021 19:14:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C10F660FD9 for ; Tue, 17 Aug 2021 19:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233279AbhHQTOp (ORCPT ); Tue, 17 Aug 2021 15:14:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:42688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbhHQTOo (ORCPT ); Tue, 17 Aug 2021 15:14:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5FEB60EBD; Tue, 17 Aug 2021 19:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1629227650; bh=e7J/njEnxcO8SaLkLK/P3EfzspDwSQw73D4u4l2pHCA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=s0/KRm5RBJw6o+Xc0boKgzneAED+creTvrWPnBOqIx0TwvgWd0l+LP3GRh2oQHcNb mjDmgI7oKJ41dOQgHIQVrVVweEXEjG8cZh6ct0U7Epi40o2jTBoYphIau66HX7aDP2 X/EwSWdyxxu9nO8r0Alq+Z4TKy2mASx81P3bHFCA= Date: Tue, 17 Aug 2021 12:14:08 -0700 From: Andrew Morton To: Johannes Weiner Cc: Leon Yang , Chris Down , Roman Gushchin , Michal Hocko , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] mm: memcontrol: fix occasional OOMs due to proportional memory.low reclaim Message-Id: <20210817121408.47be5d9a11baf5bba44da9a1@linux-foundation.org> In-Reply-To: <20210817180506.220056-1-hannes@cmpxchg.org> References: <20210817180506.220056-1-hannes@cmpxchg.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Aug 2021 14:05:06 -0400 Johannes Weiner wrote: > We've noticed occasional OOM killing when memory.low settings are in > effect for cgroups. This is unexpected and undesirable as memory.low > is supposed to express non-OOMing memory priorities between cgroups. > > The reason for this is proportional memory.low reclaim. When cgroups > are below their memory.low threshold, reclaim passes them over in the > first round, and then retries if it couldn't find pages anywhere else. > But when cgroups are slighly above their memory.low setting, page scan > force is scaled down and diminished in proportion to the overage, to > the point where it can cause reclaim to fail as well - only in that > case we currently don't retry, and instead trigger OOM. > > To fix this, hook proportional reclaim into the same retry logic we > have in place for when cgroups are skipped entirely. This way if > reclaim fails and some cgroups were scanned with dimished pressure, > we'll try another full-force cycle before giving up and OOMing. Which kernel version(s) do you think need this?