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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_SANE_1 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 60A95C38A2F for ; Sat, 18 Apr 2020 13:45:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0572E2054F for ; Sat, 18 Apr 2020 13:45:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0572E2054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 64FA28E0005; Sat, 18 Apr 2020 09:45:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 601418E0003; Sat, 18 Apr 2020 09:45:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 515AB8E0005; Sat, 18 Apr 2020 09:45:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id 365538E0003 for ; Sat, 18 Apr 2020 09:45:33 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D7CCB181AEF31 for ; Sat, 18 Apr 2020 13:45:32 +0000 (UTC) X-FDA: 76721098104.26.queen82_4d679d780f441 X-HE-Tag: queen82_4d679d780f441 X-Filterd-Recvd-Size: 3828 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Sat, 18 Apr 2020 13:45:31 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01355;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0TvvSI1O_1587217526; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0TvvSI1O_1587217526) by smtp.aliyun-inc.com(127.0.0.1); Sat, 18 Apr 2020 21:45:26 +0800 Subject: Re: [PATCH 1/2] memcg: folding CONFIG_MEMCG_SWAP as default To: Michal Hocko , Shakeel Butt Cc: Andrew Morton , Johannes Weiner , Linux MM , Cgroups References: <1587134624-184860-1-git-send-email-alex.shi@linux.alibaba.com> <20200417155317.GS26707@dhcp22.suse.cz> <20200417165442.GT26707@dhcp22.suse.cz> From: Alex Shi Message-ID: Date: Sat, 18 Apr 2020 21:44:32 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200417165442.GT26707@dhcp22.suse.cz> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: quoted-printable 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: =D4=DA 2020/4/18 =C9=CF=CE=E712:54, Michal Hocko =D0=B4=B5=C0: > On Fri 17-04-20 09:41:04, Shakeel Butt wrote: >> On Fri, Apr 17, 2020 at 9:03 AM Michal Hocko wrote= : >>> >>> On Fri 17-04-20 22:43:43, Alex Shi wrote: >>>> This patch fold MEMCG_SWAP feature into kernel as default function. = That >>>> required a short size memcg id for each of page. As Johannes mention= ed >>>> >>>> "the overhead of tracking is tiny - 512k per G of swap (0.04%).' >>>> >>>> So all swapout page could be tracked for its memcg id. >>> >>> I am perfectly OK with dropping the CONFIG_MEMCG_SWAP. The code that = is >>> guarded by it is negligible and the resulting code is much easier to >>> read so no objection on that front. I just do not really see any real >>> reason to flip the default for cgroup v1. Why do we want/need that? >>> >> >> Yes, the changelog is lacking the motivation of this change. This is >> proposed by Johannes and I was actually expecting the patch from him. >> The motivation is to make the things simpler for per-memcg LRU locking >> and workingset for anon memory (Johannes has described these really >> well, lemme find the email). If we keep the differentiation between >> cgroup v1 and v2, then there is actually no point of this cleanup as >> per-memcg LRU locking and anon workingset still has to handle the >> !do_swap_account case. >=20 > All those details really have to go into the changelog. I have to say > that I still do not understand why the actual accounting swap or not > makes any difference for per per-memcg LRU. Especially when your patch > keeps the kernel command line parameter still in place. >=20 > Anyway, it would be much more simpler to have a patch that drops the > CONFIG_MEMCG_SWAP and a separate one which switches the default > beahvior. I am not saying I am ok with the later but if the > justification is convincing then I might change my mind. >=20 Hi Shakeel & Michal, Thanks for all comments! Yes, we still need to remove swapaccount from cmdline and keep swap_cgrou= p.id permanently. Just I don't know if this patch could fit into the details o= f=20 Johannes new solution. Anyway, I will send out v2 for complete memcg id record patch, just in ca= se if they are useful. Thanks Alex