Received: by 10.192.165.148 with SMTP id m20csp4729004imm; Tue, 24 Apr 2018 07:31:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+HZx330zc4j4c4nxsqJlhbnFGcltjc04VVKqAMBqbdULeEpwrVva3Hng46BDDxcSmZOjxs X-Received: by 10.98.73.22 with SMTP id w22mr24046125pfa.96.1524580311781; Tue, 24 Apr 2018 07:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524580311; cv=none; d=google.com; s=arc-20160816; b=LQxn05x6v04WYgc0T78Rr18CqNMPKcga1Z3N95tR+FyBjUBuUdesNlagoQnXY/LYGv oufpuDroSigRXt7r2qnoSx5NM554VDbPeJkiuKpIoiQAV/7o5lHZzgQrFANJPoSPoAGc oGRK7fYrMeM39CsyJf+UKWZU1FWWi4yzb6AkGX+3ruOla+GFvLym/9YKEzXjyCvtWHFU wwENESc/LBYdO1h3kBcCvBc+qLRVVUzvbd6o2JeFrwOhhJ0aEjEQKH74oZETYaiY9I7M 1NJbtbioLzll3VWRkAzMfULTUgH8PvZEmo3Y7ecrVwHirFleGJLV1/i7iGxPf0zEzVa0 VVJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=BbZeerzq5K3/oAed2DdwcAMxLlhcu+is5gXRFDDBZvA=; b=tiwMTVQCGtowsx3/S+AAK/idVfETWQE2gWr7/+ZIvFRni3eZm+iltSZ/reFJNSpGKL 7AzlYkBatQC0VGQMnoKcuNXG+KKFXuCg/b9fVwQPP98NsGp7AuD7hmZBq+NudLm1wDsD TYAMhn64L+0KMVj9tWI79tKyFe27IBHLiAWHMZ99raRzfYaEq4GK3fMwLyBZBycz4zfw jr2vbmZWeDZddJJjJ4xTGKJ4NDTUHH2L/HbZd8VHfxMPHL85z45yKTwdfYsCMEhH4a+p JhiympM0bI1PuPfjYROZFsUTODI9qbCpEZlDcRFYxO6d/GTyqr6oQyZsteTyrChksXnx p9iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=Vk6ibwiT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si12174212pgs.73.2018.04.24.07.31.36; Tue, 24 Apr 2018 07:31:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=Vk6ibwiT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756228AbeDXLjI (ORCPT + 99 others); Tue, 24 Apr 2018 07:39:08 -0400 Received: from mail-he1eur01on0135.outbound.protection.outlook.com ([104.47.0.135]:19121 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755970AbeDXLjG (ORCPT ); Tue, 24 Apr 2018 07:39:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BbZeerzq5K3/oAed2DdwcAMxLlhcu+is5gXRFDDBZvA=; b=Vk6ibwiTUoBP4Rlhv2fAZi7UR0DgnFXz3gYVWBBLOqPZ1XILW/cyqjq6kDF4+sVt4CHzuc9vBxeWIkF2N4984B66oN49XbVDW+PxIHQh38Deq+CGrOZ4tI/xUFSgggZgwE/6OPmzrId/k2JG2Fblg82wtDfTB5NwF7t01pM4J5c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from [172.16.25.5] (185.231.240.15) by VI1PR0801MB1344.eurprd08.prod.outlook.com (2603:10a6:800:3b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.15; Tue, 24 Apr 2018 11:38:58 +0000 Subject: Re: [PATCH v2 04/12] mm: Assign memcg-aware shrinkers bitmap to memcg To: Vladimir Davydov Cc: akpm@linux-foundation.org, shakeelb@google.com, viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, tglx@linutronix.de, pombredanne@nexb.com, stummala@codeaurora.org, gregkh@linuxfoundation.org, sfr@canb.auug.org.au, guro@fb.com, mka@chromium.org, penguin-kernel@I-love.SAKURA.ne.jp, chris@chris-wilson.co.uk, longman@redhat.com, minchan@kernel.org, hillf.zj@alibaba-inc.com, ying.huang@intel.com, mgorman@techsingularity.net, jbacik@fb.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, lirongqing@baidu.com, aryabinin@virtuozzo.com References: <152397794111.3456.1281420602140818725.stgit@localhost.localdomain> <152399121146.3456.5459546288565589098.stgit@localhost.localdomain> <20180422175900.dsjmm7gt2nsqj3er@esperanza> <14ebcccf-3ea8-59f4-d7ea-793aaba632c0@virtuozzo.com> <20180424112844.626madzs4cwoz5gh@esperanza> From: Kirill Tkhai Message-ID: <7bf5372d-7d9d-abee-27dd-5044da5ec489@virtuozzo.com> Date: Tue, 24 Apr 2018 14:38:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180424112844.626madzs4cwoz5gh@esperanza> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [185.231.240.15] X-ClientProxiedBy: AM5PR0102CA0032.eurprd01.prod.exchangelabs.com (2603:10a6:206::45) To VI1PR0801MB1344.eurprd08.prod.outlook.com (2603:10a6:800:3b::8) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB1344; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1344;3:uDsbLFFeHvGyy7D4T0zrqMvIEIldDR7Y+cIL25QnxvGeKcr97bz0qAAnhWZHY8TP1DOeVGlGSMmjU81DBzITX3VxF0Ssv/JZEDy9T5tico2nE40vN/h3/Isnc+T5KMiAhuFfnzo7LqJNk1JeE0384JRutMUuto3ddAYbO67HJsw+Toc5Ppl+mJ0N5c7o9qJ5Gc6O1TtgPz7+UxeEA7VnK6AMHkf3Es8eqBkrB/IueMJLqusyTB6dtIW86rIoiGlq;25:hjnOXTzWea5J/SFTGa/GoWci/LA/4t8/GTG2uR143kUmUpxm4R8Af8bsAKVdtCx0HtX4kRG77r+SE+DDE1u+3J79RTkkxySEpa2VYtXoecN8Spr9PGd5/o6Vbe37VaS4pzcBWCEiyaog3sB0ahXsRGKFWDE0XbiiZkRDmeNxg8hhB6TJUUx6KxONf09nQyV9SUFBVRZ8iVZ7TFS3RzVgFCfyDjNjkLxhLpUb1FA1X8+QSfMaYorGKkoi8mgm8D+Q5tzwc8CHgxGpTDfaVEa0/rARHi5szjQ4LuyW+EOpGcooKMHuTr4/XXJfQF9JM+DEV0AwwG5dYnPaFHctmM3Mpg==;31:O0GUTH1LVY1jxVD7GAKC5DKdwVRpSwAgxo8wewlbefKuy2+IhNAybZaWETv/l7hbag04WYMI4m6BLBCnC9yxF8fmdlhnWu1KWWxcdG1m0/jU7sCp/jkBIu+UbFOD+gTwj1dqzOVctB/YRBKIUh0GndcRKcRuC7IfBgMiBEqz862Riy0QYliCnobAV2Urx7ln2XtVIBTX8x40mfveZnLdJRDS/A4Wh0vyXcfHd+iHR8s= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1344: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1344;20:gW+tIlsVzN3vU4iVRT41iQ5O7h8EdgEuQyC8fij4wu1cRykiY48N04DTRLUWaKS4NWTceTct04ey+wE17Uz+ZzLSCXr/gZvPGVLPuMqK6SZHHTYVTRNUqn/IXcV0uGqmvJe2GAUo+ivWMEaz9sebPDST/CdJjSbXYCojNPdGSTjFZ4Ae6epkvQtfuqT0Az5M3MZEjG/MM7iNcbYJs3e0GHkQ2NzEfqYxpWNxUn5HoZ03cSoQluMjlpTGShrRBy72zLdBZ0PJjraEzrzw/B3Hr8RdgPBWrHgNmJ55dc3XPKySFRAl3SM5CZ3NKZxSggM6btDgHckbblwuWjKaF09NLpxBiWtq5+IEH+Wy1X2yGLj535+kdJik/JeQaMiyQAW6ShC34HoGax4SVjnpQwXe+Ebi/YzvBI5uPCMptwsUH5P9epOy6Rb9/MMW1mIHSBB7Xz/gz14TCPSIQv/VZAR62WitkfMvK8CCauDitF6FKGOuG1njps2q7SOSje9Qo9qr;4:wdS2XhC9X4sJP0xdZct9et/20hZw+NdKvTBv2bwQzXIibb76aNF2pwFIdz26xxthuogRZ8a2deWng6RtSh6iUDZ3mkOVieksZehxdbPQ6YlvQZsEzh3NyZ4IvxukRlODwxhTLDL6apjJ4detPblUgIW7VH/LnJplDgq0QmPhvzKvDQ/le2SjSSA4TwQDKUJfXLFNkqMCVpaIhtekRd4nNNFcATSrDUZ7OnMMMl9QuiuK+ZMWLL5ZG45/WkllmniqJbCfRiCiS5gB6py7NAAEEw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231232)(944501410)(52105095)(93006095)(93001095)(10201501046)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:VI1PR0801MB1344;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1344; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(376002)(396003)(39380400002)(346002)(39850400004)(366004)(199004)(189003)(64126003)(16576012)(8936002)(16526019)(106356001)(316002)(59450400001)(6916009)(6666003)(7416002)(68736007)(7736002)(3846002)(6486002)(25786009)(486006)(2486003)(58126008)(229853002)(386003)(6116002)(53546011)(47776003)(97736004)(65826007)(476003)(230700001)(23676004)(52116002)(26005)(77096007)(956004)(52146003)(446003)(11346002)(39060400002)(31686004)(93886005)(36756003)(50466002)(305945005)(478600001)(53936002)(2906002)(86362001)(81166006)(65806001)(65956001)(66066001)(5660300001)(31696002)(6246003)(4326008)(107886003)(8676002)(76176011)(105586002)(81156014)(2616005);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB1344;H:[172.16.25.5];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA4MDFNQjEzNDQ7MjM6bDVDV09lcWhITmZ2N3NObzVzd1BHVHM3?= =?utf-8?B?ejZrV0hDbDc5SWhwYWViYWNWd3paZmpZWXFqMUxjbXFsb1lJMm5RTFprVHBG?= =?utf-8?B?QnlXeUVOVGV1ZStWeThhNmFUTkFqZytYYlBOUnNIcklINVIwbjMrNDJyTVpx?= =?utf-8?B?Und2VkNIVzZxMW1DSDVKL3cyc0RYcmJmTGtYdHdLS3JtNFhFbCtZd3llMVdn?= =?utf-8?B?L0NkakF3d2Jpcmx2SnhUTmNXVHhrMVMy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Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1344;7:6BbsfunXlE8pqAh3Wrxe178HaF9jYjduqpK/4pdAjHCBTU391eMx6ZKLrSRj2mdZr0a63S+fhg+AIou2ViSe+J4deHyYalSvGlAT1pe07BqCY4Fd+AMCf7n7GovjSJYHRDyPeX5XksFaEkEyvGfHt3nfHLE85MjNnMa7q2VHpZg0JCqt35rntaQfIgFqRPP986Wc6Td+Da5W2OclYhmN++fUYVLx7ljE/HDK8o+Qt/LRnhW7222GWUkCMxxAuoTD;20:CfRSD8cFGzdu89mm+D6IukoyEqG0YWl7jv4pTLEVaQupmSsz6Fa+JI8m8LDRqj9DEjZW/RWqoSLEAyYSiFE0r2bv+LkPs6JXapiltfKFI3vi7V+ixU0gsM/CxezAwyYKoodvlg4wAaQ5xK/z/PBRURS8Fcf3Ry7XwdeglgRP38Q= X-MS-Office365-Filtering-Correlation-Id: d44435ce-e700-4ea9-f311-08d5a9d7f90a X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 11:38:58.1755 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d44435ce-e700-4ea9-f311-08d5a9d7f90a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1344 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.04.2018 14:28, Vladimir Davydov wrote: > On Mon, Apr 23, 2018 at 01:54:50PM +0300, Kirill Tkhai wrote: >>>> @@ -1200,6 +1206,8 @@ extern int memcg_nr_cache_ids; >>>> void memcg_get_cache_ids(void); >>>> void memcg_put_cache_ids(void); >>>> >>>> +extern int shrinkers_max_nr; >>>> + >>> >>> memcg_shrinker_id_max? >> >> memcg_shrinker_id_max sounds like an includive value, doesn't it? >> While shrinker->id < shrinker_max_nr. >> >> Let's better use memcg_shrinker_nr_max. > > or memcg_nr_shrinker_ids (to match memcg_nr_cache_ids), not sure... > > Come to think of it, this variable is kinda awkward: it is defined in > vmscan.c but declared in memcontrol.h; it is used by vmscan.c for max > shrinker id and by memcontrol.c for shrinker map capacity. Just a raw > idea: what about splitting it in two: one is private to vmscan.c, used > as max id, say we call it shrinker_id_max; the other is defined in > memcontrol.c and is used for shrinker map capacity, say we call it > memcg_shrinker_map_capacity. What do you think? I don't much like a duplication of the single variable... Are there real problems, if it defined in memcontrol.{c,h} and use in both of the places? >>>> +int expand_shrinker_maps(int old_nr, int nr) >>>> +{ >>>> + int id, size, old_size, node, ret; >>>> + struct mem_cgroup *memcg; >>>> + >>>> + old_size = old_nr / BITS_PER_BYTE; >>>> + size = nr / BITS_PER_BYTE; >>>> + >>>> + down_write(&shrinkers_max_nr_rwsem); >>>> + for_each_node(node) { >>> >>> Iterating over cgroups first, numa nodes second seems like a better idea >>> to me. I think you should fold for_each_node in memcg_expand_maps. >>> >>>> + idr_for_each_entry(&mem_cgroup_idr, memcg, id) { >>> >>> Iterating over mem_cgroup_idr looks strange. Why don't you use >>> for_each_mem_cgroup? >> >> We want to allocate shrinkers maps in mem_cgroup_css_alloc(), since >> mem_cgroup_css_online() mustn't fail (it's a requirement of currently >> existing design of memcg_cgroup::id). >> >> A new memcg is added to parent's list between two of these calls: >> >> css_create() >> ss->css_alloc() >> list_add_tail_rcu(&css->sibling, &parent_css->children) >> ss->css_online() >> >> for_each_mem_cgroup() does not see allocated, but not linked children. > > Why don't we move shrinker map allocation to css_online then? Because the design of memcg_cgroup::id prohibits mem_cgroup_css_online() to fail. This function can't fail. I don't think it will be good to dive into reworking of this stuff for this patchset, which is really already big. Also, it will be assymmetric to allocate one part of data in css_alloc(), while another data in css_free(). This breaks cgroup design, which specially introduces this two function to differ allocation and onlining. Also, I've just move the allocation to alloc_mem_cgroup_per_node_info() like it was suggested in comments to v1... >> >>>> + if (id == 1) >>>> + memcg = NULL; >>>> + ret = memcg_expand_maps(memcg, node, size, old_size); >>>> + if (ret) >>>> + goto unlock; >>>> + } >>>> + >>>> + /* root_mem_cgroup is not initialized yet */ >>>> + if (id == 0) >>>> + ret = memcg_expand_maps(NULL, node, size, old_size); >>>> + } >>>> +unlock: >>>> + up_write(&shrinkers_max_nr_rwsem); >>>> + return ret; >>>> +} Kirill