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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 38069C2D0EF for ; Fri, 17 Apr 2020 16:24:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C89C32083E for ; Fri, 17 Apr 2020 16:24:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aiPTtHFE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C89C32083E 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 30B668E0034; Fri, 17 Apr 2020 12:23:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E33D8E0023; Fri, 17 Apr 2020 12:23:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F9328E0034; Fri, 17 Apr 2020 12:23:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 07F018E0023 for ; Fri, 17 Apr 2020 12:23:59 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B3AD9180ACEF0 for ; Fri, 17 Apr 2020 16:23:58 +0000 (UTC) X-FDA: 76717868556.10.unit16_5ce6bd194d32d X-HE-Tag: unit16_5ce6bd194d32d X-Filterd-Recvd-Size: 5004 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Apr 2020 16:23:58 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id s30so2436499qth.2 for ; Fri, 17 Apr 2020 09:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=D81ZHtrbqiwN618Bg4B7aPUCBzzVXf/vmH57VSxsIY4=; b=aiPTtHFEp4KVgthHvdAD03AyuQ9cu09DZc3IgvSIUb2DOuuWxUTORySKuFjXakFqHn BIhCvxgrp4gmwHUqZL/slxGBP+DEGbPGufukryYKxB8hbxsQZMbKLhd6IS9tP6bXnGei W0bR5Lt/w0vPxbT7PhW8AozoqUmDO5NCxBZR+oW2fcuwkzZJ15phuOfjCUduUMxyzLTl MlHjMCOdpZGLpxfjXgp+k/x6bDLwl6kxUPsq3Ih8ehx/Wkvonm0IyCX9QRMyLVFEUSV4 BmbXWZBT/vbTuyHUl3L9AO/ak6pHiaif/8DvuXzZsnH1ew4BGz4v1lgOnEx2eDoE3HyV idiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=D81ZHtrbqiwN618Bg4B7aPUCBzzVXf/vmH57VSxsIY4=; b=L/DWKZCGlthVFbb60SGDPG4qgKE/7nMqD52SJ/yNOoO1tXTAx/najG2nsrq5F654PH 4PzJc36n44uZJa/vEWGTIgkG2Z9ZmOZdlEQqG8YFXN44rS8YyuVXril3A/SdKPJChmvj 83vSDATt/TcwyH9yQlq2vrpliPw5WlVQGQxwTzh4Dxq7fYZbm6TKz8LYamarsOBNa13N MDdJctBg3W6/3aV6IpZwi062ldmVs3YmEwJw+WHJUa7lB7sJSjZpXHK3VTWScXVQdkCg TjG3cYToctGwJIC5W1w7xuQEkzfMbJ+Lp3iWxOwjmqr05xYZPwXfYUpmpu3S0ZjRFxen IEaA== X-Gm-Message-State: AGi0PuYeu39CvzFep+m2UR2hrgR8LkxABZZOOA5CwfxmJhyZDwt9Bnjn MiCTigtQxGkW03TF3/R1YRw= X-Google-Smtp-Source: APiQypJtYYnsPvdg6q1oBIp+Rc7BATM1Vk8sdmM0zaAe04Om3YWEGlWa6hC7qX3ptcl/CTC9SBPIlw== X-Received: by 2002:aed:370a:: with SMTP id i10mr3904083qtb.114.1587140637522; Fri, 17 Apr 2020 09:23:57 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::c4b0]) by smtp.gmail.com with ESMTPSA id i4sm17315649qkh.27.2020.04.17.09.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 09:23:56 -0700 (PDT) Date: Fri, 17 Apr 2020 12:23:55 -0400 From: Tejun Heo To: Shakeel Butt Cc: Jakub Kicinski , Andrew Morton , Linux MM , Kernel Team , Johannes Weiner , Chris Down , Cgroups Subject: Re: [PATCH 0/3] memcg: Slow down swap allocation as the available space gets depleted Message-ID: <20200417162355.GA43469@mtj.thefacebook.com> References: <20200417010617.927266-1-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Hello, On Fri, Apr 17, 2020 at 09:11:33AM -0700, Shakeel Butt wrote: > On Thu, Apr 16, 2020 at 6:06 PM 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. > > Can you please add more info on this abrupt change in system behavior > and what do you mean by anon memory becoming unmanageable? In the sense that anonymous memory becomes essentially memlocked. > Once the system is in global reclaim and doing swapping the memory > isolation is already broken. Here I am assuming you are talking about There currently are issues with anonymous memory management which makes them different / worse than page cache but I don't follow why swapping necessarily means that isolation is broken. Page refaults don't indicate that memory isolation is broken after all. > memcg limit reclaim and memcg limits are overcommitted. Shouldn't > running out of swap will trigger the OOM earlier which should be > better than impacting the whole system. The primary scenario which was being considered was undercommitted protections but I don't think that makes any relevant differences. This is exactly similar to delay injection for memory.high. What's desired is slowing down the workload as the available resource is depleted so that the resource shortage presents as gradual degradation of performance and matching increase in resource PSI. This allows the situation to be detected and handled from userland while avoiding sudden and unpredictable behavior changes. Thanks. -- tejun