Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2363274ybt; Fri, 3 Jul 2020 07:24:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEbv2KTS7UtiSiWnOZbkbHOfZ/KyQAFy+0GtheA0KhqG6m+t03ZzZSdmWwRrla2QlTis+5 X-Received: by 2002:a17:906:c44c:: with SMTP id ck12mr33700222ejb.145.1593786243855; Fri, 03 Jul 2020 07:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593786243; cv=none; d=google.com; s=arc-20160816; b=O+Zea/NPQUtHHscdtju8B5vRSSWDJEmODvfhtlhNLvEdTS5i58A5bqbZsKshz05PaQ /+G6ToLhGurA69sLY+bnKGuhNyCc4Ehs75YIfL6kbN0a3+HwdWxrn/4EJSorzFLSvyVg H/hkKanEC5Jr/JXMa9nUz/cJtfGLw5aVeLLFLLIvcrP4QuDuY0XLK4lu15ey9FkFflpq au6//gQ2bsxTKSWUiAIgT1T5IRWczumhL6GXjyrIoHnnYZ9IdyYDfUtCuaoqOC15BSJu XCAvY7rfIi1Yq10TdXN/dq8as92GHFUPmjylBlatnkgQehm3d1jv/y6HWgXAXL3HlR+y pYyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xAsbhYpysmstHPq0Op9MjqJaZ7YDRLDrp7Rg8i0eT+Q=; b=VqMYD35FefxENEVg3ETOTaNqvEPadsdFvwRqsFsfPqL8XnZGwHxwy+fjJxeeBj3uPz JTtNZVxy9CMjAv9vF7huqxr3kVMYiYzu6DZ5PW2DjA07EnoHCG3zqC9TpM3RBLwxhY6z jCmPP/KLl2poZrZqL6WbyiLwfO6U0+XMxzy0sg/xbT2TXr6GQ/vfjOTB03E5TS/nc56q Z7idooKJfE7inDxSEdVHLeYXdD8n7qhQJDyjlWtbbP/utzNrTvRTaiBTV8uYFBpehHlk ZbTIBpqur9YFBpBIOqmE0rRpNNGrildCB+6C5REd/x2q7VmjVlf3PTfgKlRndySpHA3K rBEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KacU4DCh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si9498258edv.523.2020.07.03.07.23.40; Fri, 03 Jul 2020 07:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KacU4DCh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726074AbgGCOX2 (ORCPT + 99 others); Fri, 3 Jul 2020 10:23:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgGCOX1 (ORCPT ); Fri, 3 Jul 2020 10:23:27 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B2B4C08C5C1 for ; Fri, 3 Jul 2020 07:23:27 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 9so37156986ljv.5 for ; Fri, 03 Jul 2020 07:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xAsbhYpysmstHPq0Op9MjqJaZ7YDRLDrp7Rg8i0eT+Q=; b=KacU4DChX8owr3WxGngcQJG0ITHWxa2x5YJZMRcO1Oq8g8suqMxqCIKz2KIVn+GX0G NlL4sAx7SWLe7wOoKqalqC8WPtCsOVDiIJl2ugaBNTqIy8m+xXXNOoboIPQNY0hU4eh5 Cv+CRClsFvZBzHLaY4R8w4zl6/ZmyudVjt3Ym/CNTRtKSCKgM5mCowbGng/unHeM1X6G rX9V5/vB5ZifMJFjN2LTDNr4RYI0VvFlBsKbHhDWHWGHEv13TdNi3C8BfxPrrTetX9vs vMD4jQOdARdwlqk8ECDSA4gMLt9sQnF8RfswofOxXeklF/ny6lafGO5LMCzz1KNSzmw1 ZJUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xAsbhYpysmstHPq0Op9MjqJaZ7YDRLDrp7Rg8i0eT+Q=; b=Ee94ZbzAQRSsh/bjvat0A1MG7r5lHfeQms+2ZixgxUYjYj7kWo0yw/PD6pwNbq35d0 ypGLN2ETfUwpIwjyMihYpvBmiuchLRjWxi6pkAyNrkk7/25vB+hFSNOwM2q0XJUl/Bud 4ArI1RYi3s12T7MoZH3LW9qC3b5P2FCsAB7SxqzHanzsZp01YXJjm+PzYizeGADToLdn AKvdLLF1XnJImvNkWwVRO2YnDY8edM4QdAoeYXL7X0B+yq/B0WSVuWZ6QqaZAWOOWdL8 swkQAxbGsNgjjE+h+2BZde+R9aOzanviuVMHnv3RFJv27D6un8aGRf0b9hDuBbot/Ad1 Y8+A== X-Gm-Message-State: AOAM531AlHFENLcXalJARGqllHjTXtgawh0QbZ6BS3bZWdomryRWEfgi Mui1GXwkj3g43yabaiTeMFTmkQmo8Dar+vD3LTqOCA== X-Received: by 2002:a2e:910c:: with SMTP id m12mr20890425ljg.332.1593786205575; Fri, 03 Jul 2020 07:23:25 -0700 (PDT) MIME-Version: 1.0 References: <20200702152222.2630760-1-shakeelb@google.com> <20200703063548.GM18446@dhcp22.suse.cz> In-Reply-To: <20200703063548.GM18446@dhcp22.suse.cz> From: Shakeel Butt Date: Fri, 3 Jul 2020 07:23:14 -0700 Message-ID: Subject: Re: [RFC PROPOSAL] memcg: per-memcg user space reclaim interface To: Michal Hocko Cc: Johannes Weiner , Roman Gushchin , Yang Shi , David Rientjes , Greg Thelen , Andrew Morton , Linux MM , LKML , Cgroups Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 2, 2020 at 11:35 PM Michal Hocko wrote: > > On Thu 02-07-20 08:22:22, Shakeel Butt wrote: > [...] > > Interface options: > > ------------------ > > > > 1) memcg interface e.g. 'echo 10M > memory.reclaim' > > > > + simple > > + can be extended to target specific type of memory (anon, file, kmem). > > - most probably restricted to cgroup v2. > > > > 2) fadvise(PAGEOUT) on cgroup_dir_fd > > > > + more general and applicable to other FSes (actually we are using > > something similar for tmpfs). > > + can be extended in future to just age the LRUs instead of reclaim or > > some new use cases. > > Could you explain why memory.high as an interface to trigger pro-active > memory reclaim is not sufficient. Also memory.low limit to protect > latency sensitve workloads? Yes, we can use memory.high to trigger [proactive] reclaim in a memcg but note that it can also introduce stalls in the application running in that memcg. Let's suppose the memory.current of a memcg is 100MiB and we want to reclaim 20MiB from it, we can set the memory.high to 80MiB but any allocation attempt from the application running in that memcg can get stalled/throttled. I want the functionality of the reclaim without potential stalls. The memory.min is for protection against the global reclaim and is unrelated to this discussion.