Received: by 10.192.165.148 with SMTP id m20csp4608341imm; Tue, 24 Apr 2018 05:43:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+fExUjddW9yhPyRwFxRE79HQDkFmmNygIYMXOSCxrCdb1AwDL5QYQYhPOxcqEKTC4+i/44 X-Received: by 2002:a17:902:b187:: with SMTP id s7-v6mr25106962plr.170.1524573823711; Tue, 24 Apr 2018 05:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524573823; cv=none; d=google.com; s=arc-20160816; b=K/CktvvxcbSBsHlB3qELrFsO9kXKnUFS5iVovy7JMFWOLD73E16F+JNzLzhSXnEEEs re9IhXFwTTWEncvhQfC5ygIXLZ4MEc5TxFfLoKtkba42qowZpfL8x9s70LOzk4Y+R4hq Mci16T0CZcAzreDyvAGIBP41XbqwjjJBxwALBt8LP8XuLrVmb3DxFo5fq6CzWBf+qbG1 AhNKVow9PVEwsKGcPaJoi+dQ4zTd3+eVuhEXNGn8fk6TKi+fMZhn5+jeJUSjo4Zo9Mwn 3n+2onP7Cl7WRrX561SvApc8oxWvihgCKU3XYgIT48anD+kROuenq3G0H9FC8aa7u4Sh mp9g== 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=LVXeBqWTSuI0PI+zURvsy+V4jFsMFNs4oVqKP0uFtYI=; b=zqC1B9soXZx6hDfP+lF3rO08ohcP3y+m+sRRlmvb0aOS8BdopNjvuVGFtAhskYWnEJ WaqHn630oYZLS9KFbJfwA+JABJnA9FdsKM9ZE96tATFEJYAeTfFyJuecQL5KALRWxwNd /LiNQoW0O0Ovkg/BxT+OdPayLLimCsTC1M/3CZEQWGV6EZlIJ5RA3obwjzIRPUCumhAT ardO0ZhUHAZKxu+Sk0DFwP0uSjElIKotAwyGGNFwp7gP849o7f29/1HbGCKQHyNf05zx njwvdslMK8ZwhRUyTfRyFWjHbIugKiDNQwdWHoWpowDBW7kXQNp4CFQVeRT/U0qghITG VjxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=S+h/EBLo; 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 o69si13501489pfi.322.2018.04.24.05.43.29; Tue, 24 Apr 2018 05:43:43 -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=S+h/EBLo; 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 S933001AbeDXMZG (ORCPT + 99 others); Tue, 24 Apr 2018 08:25:06 -0400 Received: from mail-eopbgr40096.outbound.protection.outlook.com ([40.107.4.96]:20827 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932971AbeDXMZE (ORCPT ); Tue, 24 Apr 2018 08:25:04 -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=LVXeBqWTSuI0PI+zURvsy+V4jFsMFNs4oVqKP0uFtYI=; b=S+h/EBLoKj/bgMPIrXMINIPQGOADGuDZZTlrK3KOVGdqkub+2OdDIRDfQHbN1OAqUEjmnO4A4FFjhIEQYe8rJ6rT9Ip97lxF9EHMvoTFA5GDbz2rlHPduAhrJJ6XygZIhSDkR2Bo5Zza9LGr9W/+aB/jew7YPxNI0qCdhyq9L+E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from [172.16.25.5] (195.214.232.6) by AM5PR0801MB1330.eurprd08.prod.outlook.com (2603:10a6:203:1f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.12; Tue, 24 Apr 2018 12:24:56 +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> <7bf5372d-7d9d-abee-27dd-5044da5ec489@virtuozzo.com> <20180424121516.ihn6lewpidc34ayl@esperanza> From: Kirill Tkhai Message-ID: <402281e6-6fea-3541-1435-a2f81e705e2b@virtuozzo.com> Date: Tue, 24 Apr 2018 15:24:53 +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: <20180424121516.ihn6lewpidc34ayl@esperanza> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: PR2P264CA0026.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101:1::14) To AM5PR0801MB1330.eurprd08.prod.outlook.com (2603:10a6:203:1f::8) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(2017052603328)(7153060)(7193020);SRVR:AM5PR0801MB1330; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1330;3:kMiH3kOmSxxCksCxpm4ooeECA/DtUd3WTqkpqQCXizyDgkWcFNJRvCu9oXa3fYC8lwH7K16os14ZP5GBCDRr058t6boJneJK7ktYdgFzggOEJOu2SINrlPIpe2V4Nw+sP61SY1S736axGttpmNZF0LnP2guE024hnB45Fbxw2RmR2a0cpzfZFqlFYVI9hjdneImmKhhRSdvpI1WRWrNelM1w80pQyJMNxYkZ3yqLDgDRXh7IlIzDiLItjhwgW1aA;25:YDw1yoNkK6lCaB6sLGCZC4HMSauVch8nann43U7rhzD0nUDMeA9gGk8ydnBVqN+w22Sg/GHNphwWvtsSEY1AkYUDDo4YVB83uG2jbgk8rPrX/GHYzQl9LNy5s3vnD5jde6Yu1v/0+QNqh82+gFyOAaxXd2zYlSaP4QqrxHw0BKnrHv/b3i7Vw/cJzYlaecGv3C+cP6PU3P2MpmbDQ9/6TjlgFudqNyZmbK5jfzjMhevGonm2he3OnBVosGmXcVFnmCRQwsKQXmAYvcoi3+5KlEsRqJQdSrmlBvqF0t9qFvlLFQRg3vKNeAYMsPRW/3VTZlg9QO2pRe7dBdBp4nn0oA==;31:GToNy9//fVNapghGq3WNTtO9xfD8JAIhntey/sMfOCWbmGW15Ro4Rh5uuWSv2YZ3ENGGTmC0RcpWEK8cQ0fglSfGJ/06CMIJRH7k6R/CcRlBBMc/H2iwpLuJstH/cgXUxjoX0t0CK4Zd2OUWAQnlfaTVVpd4A7gDB6JgNGWNP63OrObHCgsGssaCVwcWT5l2YALvLdacvQEJ6FIc0UHpzjvH5i8L1y//fqg5TA/KwO0= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1330: X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1330;20:CL8Nfnjn4KLJ3zqMw5qcFc1DqLKWenAgZ7vIKNdLLhrbrq6pUuvIXjsTbZ8ANC13WCrs6HF+if5n+sRlvc7LeZxm/9oUoKCdEwwwkYmtidScWHCMabvdtTAChYAeWMTnfudNh6VeATg0eYc7naFYbzCXnIg3u2clcncvMVq97b4X6qscTvxOb2ywFSPGhsmH/BQ38ICdnnoF2QG0pVmKy4P8ZrWcBwYovr0/kkWMN/bn6bsbVdD5oTIxiQu/4ez7cLF3t6A+2V1TY2tpNS+ah9xErX80miXI+wkD6ItI5EI575VFiSd85VngCCgBj5vn9UUUBbyIrDzRLKUvtvkbt4sImhuwsBYETekCzk80n0dAsnDGiENSaFb9tGudkP7Mijyat5MZ524V2DQlAM+AhXmyrliKvBnuBWhfKlDM8W3iWnIGZ6fQVTvzs2+uMEEyCmLvS56DRh2D7mTk35mrYZnwARnVlV/vo091isxJAcVAJInuWLdxPhd8CuhmGZO2;4:7Qr2oajEhuIevkD8vK/8S64hCPhpOvmCObzbudsjnzzXHP52FFJawXrnpu8Bm85R2wL377vOP6MjZM1j+GStAGcSxHGwlqJzs6vuEnPhe7I/DMnrQOJvn6mgiJbLEHR2gzXmbyUIE27/gVMhYR+XbdJBl3z3R4ROZAWA483Gnu/fSrpvQ5Fedog74vD3De63OoTgB9++ZW0He+6/v5uffq6ChW5NuC7aELEUH0LGz3N3VeLIywLiqcmwupeTotAnwKffIFlX1r1r5+36ZdeMDA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231232)(944501410)(52105095)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:AM5PR0801MB1330;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0801MB1330; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(39850400004)(346002)(376002)(39380400002)(366004)(396003)(189003)(199004)(52116002)(16526019)(81156014)(52146003)(8936002)(77096007)(97736004)(23676004)(2486003)(36756003)(8676002)(31686004)(6666003)(86362001)(6916009)(106356001)(65826007)(64126003)(76176011)(31696002)(478600001)(50466002)(81166006)(93886005)(25786009)(5660300001)(3846002)(2616005)(6116002)(2906002)(6486002)(59450400001)(386003)(53546011)(7416002)(66066001)(229853002)(47776003)(6246003)(107886003)(65806001)(26005)(65956001)(39060400002)(446003)(68736007)(11346002)(476003)(956004)(105586002)(230700001)(305945005)(53936002)(7736002)(316002)(16576012)(486006)(58126008)(4326008);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0801MB1330;H:[172.16.25.5];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjA4MDFNQjEzMzA7MjM6TGpENGlqNFYwa2htc3Y4RmpxbmN6aEs4?= =?utf-8?B?bFd3eXZJVDNIYXhFVlZ2SmJwdXdIRDlKRFBSUTRWb1BJaDJvN1pncUhxR0dY?= =?utf-8?B?dmFZcmNEeDZkQ0lsbWJyTnkvOS9ZR1paWEZ3amhxMUxZZ0NJQmk2ZGJUS3ph?= =?utf-8?B?V1JvbHY4cTdlWjMyL2VVeVZjOTdnS1pLU3R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FNy/oRfKPe4rQQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1330;7:Gqty9D7zOGoAJ24YZ0vfD2N5DcX0lFRy6bqeiLmwJzhEWw5XQ/kfI3BMf7AB9Ri3yHNcOxskmCUvRhkENqHgn6VKoOEa2mXSwoeAPsJIB/4TS/0TzgkizaIDwtCfXG7p6kn/smbOwJNBuOxJvl2b/FiBbd3Gn8lBhhoreACnkddG7q3XRSp9Q4OKInX387jtm6kwY1VZUzv17Kt5vsbv7UWU+Ye9SUpaphUchRHwu1nbOnNHuZraiJKMvW5OwdAJ;20:T5sSewIrfoE2rwXgru6tBya5+5mAQF1HebquAYcSi8YnhYBqVn6e7zKxo6u69SblZKFyvH2vvGIUqbboNAW/q/OSya149OvhBb+JfZmcCw+qU1nZUCbn/BgRB0/vzW+PJCjjN7gkkeEomy1HUSsQ1A+cqgkZAP87AIesDo8B8V0= X-MS-Office365-Filtering-Correlation-Id: 27317125-4f3d-4ce8-f817-08d5a9de650a X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 12:24:56.2906 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27317125-4f3d-4ce8-f817-08d5a9de650a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1330 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.04.2018 15:15, Vladimir Davydov wrote: > On Tue, Apr 24, 2018 at 02:38:51PM +0300, Kirill Tkhai wrote: >> 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... > > Well, it's not really a duplication. For example, shrinker_id_max could > decrease when a shrinker is unregistered while shrinker_map_capacity can > only grow exponentially. > >> Are there real problems, if it defined in memcontrol.{c,h} and use in >> both of the places? > > The code is more difficult to follow when variables are shared like that > IMHO. I suggest you try it and see how it looks. May be, it will only > get worse and we'll have to revert to what we have now. Difficult to say > without seeing the code. > >> >>>>>> +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 fail to understand why it is so. Could you please elaborate? mem_cgroup::id is freed not in mem_cgroup_css_free(), but earlier. It's freed between mem_cgroup_css_offline() and mem_cgroup_free(), after the last reference is put. In case of sometimes we want to free it in mem_cgroup_css_free(), this will introduce assymmetric in the logic, which makes it more difficult. There is already a bug, which I fixed in "memcg: remove memcg_cgroup::id from IDR on mem_cgroup_css_alloc() failure" new change will make this code completely not-modular and unreadable. >> >> 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... > > Yeah, but (ab)using mem_cgroup_idr for iterating over all allocated > memory cgroups looks rather dubious to me... But we have to iterate over all allocated memory cgroups in any way, as all of them must have expanded maps. What is the problem? It's rather simple method, and it faster then for_each_mem_cgroup() cycle, since it does not have to play with get and put of refcounters. Kirill