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=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1, USER_IN_DEF_DKIM_WL 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 C239BC433E1 for ; Wed, 15 Jul 2020 17:33:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 86C232065D for ; Wed, 15 Jul 2020 17:33:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="m+o1DG5c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86C232065D Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 14CE76B0007; Wed, 15 Jul 2020 13:33:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FD376B000A; Wed, 15 Jul 2020 13:33:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0118D6B000C; Wed, 15 Jul 2020 13:33:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id DF2FF6B0007 for ; Wed, 15 Jul 2020 13:33:55 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 74E8B82499B9 for ; Wed, 15 Jul 2020 17:33:55 +0000 (UTC) X-FDA: 77041008030.20.bit51_5a0e6d426efb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 3AFEC180C0611 for ; Wed, 15 Jul 2020 17:33:55 +0000 (UTC) X-HE-Tag: bit51_5a0e6d426efb X-Filterd-Recvd-Size: 4742 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jul 2020 17:33:54 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id j19so3393381pgm.11 for ; Wed, 15 Jul 2020 10:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=PVtPnpDCnFAQV5fwXJEr/RSTBynO8Xc9u6VPuoN4lxA=; b=m+o1DG5c/kUGkAGKg+4+dMc3sD7jL5tBy8wqLGklDhgrqf3vjFdT77jGABzg9RUPAt XyP7bfZfakKBiM8EpPa4na/ojGxr4Sq2ANVLuQUQWAElOYsfwEYqDO0u8N/t16ayK4XT iVJTOLDCrLvwqcTkmdpqjCf8WQNDQsyvNb7We/6fpOL95rNZmN+2RLvMwv2yS1IG51Je wRFx7kcVbYKamIHIJvvS8YnodYPyqw2Q0alj0x7sIHHl5ZFp3LdlGzNM4RhlSulYx0HI v80pbORRaUrVa+WfDL3e5fR/kQHzO9TqunphHMMcwxDcN2RgoQ6mmy/gMRE4EFHuLYMv pvVA== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=PVtPnpDCnFAQV5fwXJEr/RSTBynO8Xc9u6VPuoN4lxA=; b=l26LoURV8t37feKi5Yls2tI9aV8RuUSpT8fwktqI9d13FugarlUZ+HbbQ3yUp8kf4l nzyQ0yS3ldm9gmo8Jm83IZ6AYXfqV9/i0xgut8+W/kcuDCA+QIsqQu7Khq6eVnN9daD0 DLUckdLDl89zaoyMm7IOZs9b0/VuHJcFv/vg5sb0KmB3hojPqeinfuK483L1Ll71LOKh 3CW+sNrebF6DI2M63BpwFTsPxnEf6lvay1o/Vw07XgvzFkMuKy40MSTUMSI51BDdMuZ/ 5/qqfq5pG9alhAzeA2iKksN2IQ/YQUGYX+Qjs4DTuV0K2pGnNuNIoG3+43BBg79kt7mI jsKQ== X-Gm-Message-State: AOAM530Vv4Hu1+OYQTxkT+UUFmucDmVfvnVnsNPdWWdoiV2GlAfjbL2x vrH8w7Wtf32WhLUS0ki+QfNuhA== X-Google-Smtp-Source: ABdhPJwC6YWxRprlzzKpQux0td0cZKqnGWBYmUE/fwY7ZrMAKm28ifk0okyLyHdlM373de72fL4dVw== X-Received: by 2002:a63:5b55:: with SMTP id l21mr723987pgm.348.1594834433632; Wed, 15 Jul 2020 10:33:53 -0700 (PDT) Received: from [2620:15c:17:3:4a0f:cfff:fe51:6667] ([2620:15c:17:3:4a0f:cfff:fe51:6667]) by smtp.gmail.com with ESMTPSA id q11sm2651130pjj.17.2020.07.15.10.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 10:33:53 -0700 (PDT) Date: Wed, 15 Jul 2020 10:33:52 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: SeongJae Park cc: Andrew Morton , Yang Shi , Michal Hocko , Shakeel Butt , Yang Shi , Roman Gushchin , Greg Thelen , Johannes Weiner , Vladimir Davydov , cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: Re: [patch] mm, memcg: provide a stat to describe reclaimable memory In-Reply-To: <20200715071522.19663-1-sjpark@amazon.com> Message-ID: References: <20200715071522.19663-1-sjpark@amazon.com> User-Agent: Alpine 2.23 (DEB 453 2020-06-18) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 3AFEC180C0611 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Wed, 15 Jul 2020, SeongJae Park wrote: > > An alternative to this would also be to change from an "available" metric > > to an "anon_reclaimable" metric since both the deferred split queues and > > lazy freeable memory would pertain to anon. This would no longer attempt > > to mimic MemAvailable and leave any such calculation to userspace > > (anon_reclaimable + (file + slab_reclaimable) / 2). > > > > With this route, care would need to be taken to clearly indicate that > > anon_reclaimable is not necessarily a subset of the "anon" metric since > > reclaimable memory from compound pages on deferred split queues is not > > mapped, so it doesn't show up in NR_ANON_MAPPED. > > > > I'm indifferent to either approach and would be happy to switch to > > anon_reclaimable if others agree and doesn't foresee any extensibility > > issues. > > Agreed, I was also once confused about the 'MemAvailable'. The 'reclaimable' > might be better to understand. > Hi SeongJae, I'm leaning in that direction now too, actually, because I reasoned that determining the precise amount of anon that can be reclaimed would require subtracting (file + slab_reclaimable) / 2, which is awkward :) So I'll send a follow-up patch to add only an anon_reclaimable field which is good enough for our purposes unless others would like to have more discussion. Thanks!