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=-6.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS 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 9A6D9C433DF for ; Thu, 21 May 2020 00:22:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4704120748 for ; Thu, 21 May 2020 00:22:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fVcDR+yg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4704120748 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D61FF80008; Wed, 20 May 2020 20:22:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D13A580007; Wed, 20 May 2020 20:22:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2A2180008; Wed, 20 May 2020 20:22:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A8D2580007 for ; Wed, 20 May 2020 20:22:09 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 653C7181AEF1F for ; Thu, 21 May 2020 00:22:09 +0000 (UTC) X-FDA: 76838823978.20.kitty82_4cf91a0632551 X-HE-Tag: kitty82_4cf91a0632551 X-Filterd-Recvd-Size: 2994 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 May 2020 00:22:08 +0000 (UTC) Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A6CD5205CB; Thu, 21 May 2020 00:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590020528; bh=VNT1XW0Hh5ozONz4ly7v1+37MuVVB4/dY6J8WDs59k8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fVcDR+ygrfYVVQ9LnCkI/9ox3ZHnXW8UYVQV3OFC9RZyQvgE2nFDnG1cxptt85e0X QjFs/LbptJMNlvxXW82HpSBAJVYCCHqH6VTjSFVMBxGE9mykhCIMrVG8s6utchYuun 9GSOUw7zQAIvxKx11ame7WfNfMFykMArJ5iRrv4A= Date: Wed, 20 May 2020 17:22:06 -0700 From: Jakub Kicinski To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, kernel-team@fb.com, tj@kernel.org, hannes@cmpxchg.org, chris@chrisdown.name, cgroups@vger.kernel.org, shakeelb@google.com, mhocko@kernel.org Subject: Re: [PATCH mm v5 0/4] memcg: Slow down swap allocation as the available space gets depleted Message-ID: <20200520172206.4e55b66f@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20200521002010.3962544-1-kuba@kernel.org> References: <20200521002010.3962544-1-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 20 May 2020 17:20:06 -0700 Jakub Kicinski wrote: > Tejun describes the problem as follows: > > When swap runs out, there's an abrupt change in system behavior - > the anonymous memory suddenly becomes unmanageable which readily > breaks any sort of memory isolation and can bring down the whole > system. To avoid that, oomd [1] monitors free swap space and triggers > kills when it drops below the specific threshold (e.g. 15%). > > While this works, it's far from ideal: > - Depending on IO performance and total swap size, a given > headroom might not be enough or too much. > - oomd has to monitor swap depletion in addition to the usual > pressure metrics and it currently doesn't consider memory.swap.max. > > Solve this by adapting parts of the approach that memory.high uses - > slow down allocation as the resource gets depleted turning the > depletion behavior from abrupt cliff one to gradual degradation > observable through memory pressure metric. > > [1] https://github.com/facebookincubator/oomd > > v4: https://lore.kernel.org/linux-mm/20200519171938.3569605-1-kuba@kernel.org/ > v3: https://lore.kernel.org/linux-mm/20200515202027.3217470-1-kuba@kernel.org/ > v2: https://lore.kernel.org/linux-mm/20200511225516.2431921-1-kuba@kernel.org/ > v1: https://lore.kernel.org/linux-mm/20200417010617.927266-1-kuba@kernel.org/ Ah, damn, I forgot to add Shakeel's review tags, let me resend.