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 37685C4338F for ; Tue, 17 Aug 2021 19:14:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF45060EBD for ; Tue, 17 Aug 2021 19:14:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AF45060EBD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 37FD46B0071; Tue, 17 Aug 2021 15:14:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3081B6B0072; Tue, 17 Aug 2021 15:14:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CFFD8D0001; Tue, 17 Aug 2021 15:14:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 00A296B0071 for ; Tue, 17 Aug 2021 15:14:13 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 92500248A1 for ; Tue, 17 Aug 2021 19:14:13 +0000 (UTC) X-FDA: 78485523186.01.968C02C Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf30.hostedemail.com (Postfix) with ESMTP id 36766E002135 for ; Tue, 17 Aug 2021 19:14:13 +0000 (UTC) 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 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="s0/KRm5R"; spf=pass (imf30.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 36766E002135 X-Stat-Signature: cqwjgmkiiwb7mohpfw8n6xpktqgsb6b9 X-HE-Tag: 1629227653-87905 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?