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=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 4599DC54FCB for ; Sat, 25 Apr 2020 15:24:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DA0162071E for ; Sat, 25 Apr 2020 15:24:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tzmc7YB2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA0162071E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3A5B18E0005; Sat, 25 Apr 2020 11:24:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 308328E0003; Sat, 25 Apr 2020 11:24:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D1178E0005; Sat, 25 Apr 2020 11:24:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 011A68E0003 for ; Sat, 25 Apr 2020 11:24:41 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AE076584F for ; Sat, 25 Apr 2020 15:24:41 +0000 (UTC) X-FDA: 76746749562.27.jail28_28f5595f7f12e X-HE-Tag: jail28_28f5595f7f12e X-Filterd-Recvd-Size: 4206 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Sat, 25 Apr 2020 15:24:41 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id r4so6131958pgg.4 for ; Sat, 25 Apr 2020 08:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=KSDnmeL7kbYO0entEoKpb+EP26Hv9eZaDGSTgBmwruM=; b=Tzmc7YB2i/Fouhfcdf1EfgkJ6iPwJxuS53LmQl23+zdhyPnX1yPhMdw2EwLt2IIpW0 SGTAxTL0r1kZ5OelWSgsm/S7pdYUAEM6NfK/+4sse0sI8h6np6kwJ91PxGslv1k4GkvO LQ1e7fuSV15A1wMoos6SvhDTMJudMFB7KYnuyT20o+3i4bZ5Cq6aoSaDDXXhTjOUTsbz NXnYAjf4+DUqt+1ZZStYmvIgofTDik8IqBq4WDew0M6s8nNhPSHe1Koth5Chwb3+wWms vhvqUhyPl6H7IjpCnvS8CwfnEKlfMKsB8z3jpcJSt/jsSWRR5kFG5LIlbLVdtELmzlWK OJ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KSDnmeL7kbYO0entEoKpb+EP26Hv9eZaDGSTgBmwruM=; b=ELfyY2ql7mG94jW8uEaTvFS2TFNqbqm6enpJnh/L4/pshHEBTqVU/UV0CCSQFWVGqz CofT4wlsG9MpgnZsIANSLF2igO2hhgWOQMoVxs1hvApc5v8IW9EGG7+3psm1rZNgcK1B sjfHtYmqi4ZwQnAocEEngKnfovwW/vTX5l+N/9foLQcKIpbcfgn6S0TbiTqaGd4THnfN J2w1mRtRdd00wE5mkSgWIsGJJkdEVYqh90kFVQymGTLA2jr46VjHuhQCn0DlLFkS8Nay DnHnzlY7Rk/1MgzuBLvn+j4K8vabyNn6r7x2liKJEsmdcDxBx1mzsuxWNTSqh894MFeJ Z5cw== X-Gm-Message-State: AGi0PubFLiW9n7Xb0QVIqssE5ruvtXQ2JwoyxZib9bCTBjB0juLP+kbl 3KfRGQFTiaMrNO0DPYtGTIk= X-Google-Smtp-Source: APiQypIG5/LUaayEMzy9JpMAdfe7laJx1T7Obq8DNgGakaMU4JHtUEuHPhB0rx9mP5kqHLU2TrFYCw== X-Received: by 2002:a63:1c25:: with SMTP id c37mr14962497pgc.320.1587828280413; Sat, 25 Apr 2020 08:24:40 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id w11sm7319838pgj.4.2020.04.25.08.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Apr 2020 08:24:39 -0700 (PDT) From: Yafang Shao To: akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, guro@fb.com, chris@chrisdown.name Cc: linux-mm@kvack.org, Yafang Shao Subject: [PATCH 0/3] mm: improve proportional memcg protection Date: Sat, 25 Apr 2020 11:24:15 -0400 Message-Id: <20200425152418.28388-1-laoar.shao@gmail.com> X-Mailer: git-send-email 2.18.1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000112, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Since proportional memory.{min, low} reclaim is introduced in commit 9783aa9917f8 ("mm, memcg: proportional memory.{low,min} reclaim"), it have been proved that the proportional reclaim is hard to understand and the issues caused by it is harder to understand.[1]. That dilemma faced by us is caused by that the proportional reclaim mixed up memcg and the reclaim context. In proportional reclaim, the whole reclaim context - includes the memcg to be reclaimed and the reclaimer, should be considered, rather than memcg only. To make it clear, a new member 'protection' is introduced in the reclaim context (struct shrink_control) to replace mem_cgroup_protection(). This one is set when we check whether the memcg is protected or not. After this change, the issue pointed by me[1] - a really old left-over value can slow down target reclaim - can be fixed, and I think it could also avoid some potential race. Patch #1 and patch #2 is the preparation of patch #3. [1]. https://lore.kernel.org/linux-mm/20200423061629.24185-1-laoar.shao@gmail.com Yafang Shao (3): mm: move struct scan_control into internal.h mm: add reclaim context as a new parameter in mem_cgroup_protected() mm: improvements on memcg protection functions include/linux/memcontrol.h | 34 ----------- mm/internal.h | 101 +++++++++++++++++++++++++++++++ mm/memcontrol.c | 66 +++++++++++++++------ mm/vmscan.c | 118 ++----------------------------------- 4 files changed, 152 insertions(+), 167 deletions(-) -- 2.18.2