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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 9EE4AC432BE for ; Wed, 18 Aug 2021 14:15:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0A99D60EBD for ; Wed, 18 Aug 2021 14:15:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0A99D60EBD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8DA586B0073; Wed, 18 Aug 2021 10:15:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B1376B0074; Wed, 18 Aug 2021 10:15:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A0398D0001; Wed, 18 Aug 2021 10:15:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id 5FC046B0073 for ; Wed, 18 Aug 2021 10:15:23 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E39E8181E437B for ; Wed, 18 Aug 2021 14:15:22 +0000 (UTC) X-FDA: 78488398884.12.FA81D7C Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by imf11.hostedemail.com (Postfix) with ESMTP id 902A2F006B01 for ; Wed, 18 Aug 2021 14:15:22 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id m21so3078570qkm.13 for ; Wed, 18 Aug 2021 07:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QuwtlkiDGdVrCHQjEs+V1pH13gkXul/lhVEkHhu3sPg=; b=HGixUth5XmHhaExQjj0gkfLh0CcKhfT9fLJ8YT+dCDfj28MGFMjoiPk12fFJ75GriO T3vJh7OduH2ggAbsAw4pR2TMzK5OkotvAbwW5kg/WMKj9tVKuwutWoUoQqQ0mair1Ivn IXnMaAE+5G6/0DOyN2E24YF4TEN52GyJyeAHja0iPBTGhHdmzv72e37rv5SRqMwiX0jB 0zAct3Jr3JADH5pG3y5yrxAkueO/MsBtxxTBZXMS87vYomrc7Gl69AVEtEHAd0dNxdAq BG3Rnqfq+rO/ArKUpIPfdWadeGYwTOuXPzo9l1ubVv0Dcpykxz3Wfu/DmKo5bFuvq0W4 6vpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QuwtlkiDGdVrCHQjEs+V1pH13gkXul/lhVEkHhu3sPg=; b=q0HJrfxsnk2Zn+2WRwofQmyasbrLUic0oFsXz/f6enLv8eUsMxd8rigtp1xeRTsQKk PxQH6LjB2BzWSP+/XiqrCVsPquTuvEMmVPIky7jwgkMg45w3lGX9MpyNyVJBzpItnXLN EVLJIsNWpdIiHGHhzOxZGLyqoYJsjK5EPdPqHu1ZSLne3kNgJ9sDJc7irV9TFeuEr3f3 BFeihYrXujCjgXIkMunZRvfQmKLfR5adEl1BkuqpzBhNrFz8nD2SNh+4Ay0dBIrAyNi2 P//JTINTvZujelpal2k1Y57j8Q21AlygiXJKzHOrDE7BPXIkRcNkHoH0n1aM4j/zaXS5 jI+g== X-Gm-Message-State: AOAM531RIAKUuvXLBpIwyDBQY9YjK7ncN+KMUEzZC3T5JHk7lp5+mPEX E9PjgGNLrOS6Ng1Gv5zcZ6/AKA== X-Google-Smtp-Source: ABdhPJzBvxuWBcQn6T0nzg4r0Ki9UxaU9vIgb2Te0VQ8siFV29T1isqOwegBqIHbenxfs1BwkxKiVw== X-Received: by 2002:a05:620a:450e:: with SMTP id t14mr9583617qkp.93.1629296122062; Wed, 18 Aug 2021 07:15:22 -0700 (PDT) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id f15sm59672qte.5.2021.08.18.07.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 07:15:21 -0700 (PDT) Date: Wed, 18 Aug 2021 10:16:59 -0400 From: Johannes Weiner To: Shakeel Butt Cc: Andrew Morton , Leon Yang , Chris Down , Roman Gushchin , Michal Hocko , Linux MM , Cgroups , LKML , Kernel Team Subject: Re: [PATCH] mm: memcontrol: fix occasional OOMs due to proportional memory.low reclaim Message-ID: References: <20210817180506.220056-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 902A2F006B01 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=HGixUth5; spf=pass (imf11.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.175 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Rspamd-Server: rspam01 X-Stat-Signature: 8scutwg75c1d79k96zn9urpaqkauefct X-HE-Tag: 1629296122-370883 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, Aug 17, 2021 at 12:10:16PM -0700, Shakeel Butt wrote: > On Tue, Aug 17, 2021 at 11:03 AM 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 > > *slightly > > > 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, > > *diminished Oops. Andrew, would you mind folding these into the checkpatch fixlet? > > we'll try another full-force cycle before giving up and OOMing. > > > > Reported-by: Leon Yang > > Signed-off-by: Johannes Weiner > > Should this be considered for stable? Yes, I think so after all. Please see my reply to Roman. > Reviewed-by: Shakeel Butt Thanks Shakeel!