Received: by 10.213.65.68 with SMTP id h4csp1483265imn; Mon, 26 Mar 2018 08:22:25 -0700 (PDT) X-Google-Smtp-Source: AG47ELsYTxQSRXLbbvdjYOFhO3ECZyawlWeEfqPEmQNokxQtckKYlmkn/Nv+TobE0VGmjYD3mGqI X-Received: by 2002:a17:902:ab85:: with SMTP id f5-v6mr36879099plr.380.1522077745709; Mon, 26 Mar 2018 08:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522077745; cv=none; d=google.com; s=arc-20160816; b=AMz8rTe+rfDfxk8AghcK8en0Kgusw85nQoAhIunKZE1bIxq4uMl6zjPLr3EsXL9RZu oipqii412kHAUAOj7E3bVUExPplXK4LvAIR1IT1Q0NvHFmzxZu8SFvCq9MCDjNlTQIeA HwBeHsKCWknkxhOfHuTsqbcIKltOAB8dplTgN5tcT7vx2XnZrCt+VGotT/MjZt8lwexK G/xlXIMGgD0RENT/OMvk9GVIYl1yDw37WsLgDBcFpeNXz+abzIcRUHaYMFIANtD/6Thz it2pef2bC3iVRSvd2rax21P93SCwbv6OzBQzL4RFx1uDyruKsmGwvmwXGEmD7JJ5w4ox y5rQ== 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=SoDZwmnoeH6OvZOXIclGYlw7SFAaGaaXf9Ft4pfz1WA=; b=Hf23BVZVHVd/O9lzzIX3TaZLmliehHVh9wxnWpjgTFGD6W268ORFjU3HJsjY0pGZqw WVHARpgycvTgxHIhBJ1vlIjYardgdGp/n07t8GEnRXGuvm+5gigPLmHnzcXDchemjtd8 6wBl2+2QGX3x39WMI9EnMRQZyY5e4QK6zY6Oq1O4Bs2XVb+8pmwAWkAOWhqF05aM7zCp JEoKVp/DElKIevpk8ZwDb0HcH3Zx/K/SQcGbJN610N0tpdN6gMkx8n6gV2YJdbSoF33G yAaPUx/cEjuu48XdMQLqjE3ACapvZjhktcnJNAjhSbp0jV2Axm7urhOOgjF8FO2qe2Ui 5YsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=GngoChAU; 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 d8si10361331pgt.246.2018.03.26.08.22.10; Mon, 26 Mar 2018 08:22:25 -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=GngoChAU; 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 S1752123AbeCZPVI (ORCPT + 99 others); Mon, 26 Mar 2018 11:21:08 -0400 Received: from mail-db5eur01on0127.outbound.protection.outlook.com ([104.47.2.127]:45409 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751840AbeCZPVF (ORCPT ); Mon, 26 Mar 2018 11:21:05 -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=SoDZwmnoeH6OvZOXIclGYlw7SFAaGaaXf9Ft4pfz1WA=; b=GngoChAU3Vye77aPYnfn/TU5TzefAg4VNsM7xZs0tlDT8v4oeW6BO4NYLFZiWEwyKstJxpCVqa5O/9+hu9mXoRPJUTMv4JubDN4chwMtKNQTKc8vAcpF2KQpi45nsp9D/Q28ZuGvU4U2rGtHUAQhMgPXsl7uEgyECJE9qlVdZsU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from [172.16.25.196] (195.214.232.6) by VI1PR0801MB1343.eurprd08.prod.outlook.com (2603:10a6:800:3b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Mon, 26 Mar 2018 15:20:58 +0000 Subject: Re: [PATCH 02/10] mm: Maintain memcg-aware shrinkers in mcg_shrinkers array To: Vladimir Davydov Cc: viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, akpm@linux-foundation.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, shakeelb@google.com, jbacik@fb.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org References: <152163840790.21546.980703278415599202.stgit@localhost.localdomain> <152163848990.21546.2153496613786165374.stgit@localhost.localdomain> <20180324184516.rogvydnnupr7ah2l@esperanza> From: Kirill Tkhai Message-ID: <448bb904-a861-c2ae-0d3f-427e6a26f61e@virtuozzo.com> Date: Mon, 26 Mar 2018 18:20:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180324184516.rogvydnnupr7ah2l@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: DB6P193CA0006.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::16) To VI1PR0801MB1343.eurprd08.prod.outlook.com (2603:10a6:800:3b::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 69762b07-2d83-4a5a-73c7-08d5932d2eb5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB1343; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1343;3:UkwmDXFZRoxuEWftio3J87KjwdGEZaIu22Yp11VkQJ5LTO7cZw64lIsdm0uucCIJlGU/mqb64MKLVaUuDuPAWRiQ3SFGSpt1ON5AsBTg4GvKi1HGz69Reuzv6adTMYmSXvgSukouqzlzrbih8eHyNwWDodKSXSSAeSmgmQxfwDJYGoOUhi1FsbmLs5/pTREGh0V0J5EekUe74s3VEwCoWn+UtX7rJzyx1b+AmOhLyjn7LdLxY9zXCQEMt2lmWoE0;25:VEjV+JMODajs0+E+5iIyEAj8MV+LwRSU8DYxjJBZ1C3ck3MbhnfSMVc86HH2X78SZcHoBce53vqkLecuyfpVzuwcKxRmQR0ny1fmtrEWzN+Dn9kdzgrkwnqOEBj2M5y3XiU1q/L0LQk0v6qhPCY4yWzQ/4cmRDwhTbD75CQwVJEcgv31Zv2OkGNGAPyLYt7QaTRpJKFt7SNYjjSV6XNDpCmzwisoOChGuQWUMcehi1Udmv0HNoVzFAFxno5hO2MDMtP0bAPafggxAfJzcR2XNcvN0D+5lmov1/t4U9Nk/K6p657l22CyL3r/qzCJjwBUY7q+3UOtATkpBw8l0WbDCA==;31:iAIWIq5VZcvPwYZsgk3TpnFf4lajILoDw3cLDR/5HBAAOAV4zFFNB/aBQ8RLBNBadyHITuFVW4DaFb9KnqNbxSyn+p1ZVFG3ZBJMxlP5DkaZZ1IWrayGGPu5dDPvFEdqyO3IZgXOajX5xrsTTn+HN2DjkkhlxVyJMQOlHuZzigIdnK/GwvhBOvzh2j0T0YPaJGfZyathTfY1dHfeIaZ5Lwc/LIHm/uB3rxF1EFGCzwM= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1343: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1343;20:7/YpYQc8BARXjd0+RrebH+n/saV8wmk9mqBm2jTwue9D/Ycn6bXJHPR8v59OxiDY+TfPwRpysvP2pGf58FbvElvtefofXlE25pqVbNpJNXNPMnmDhFLxaFJXcw2H9g4SUXkv3Me9qqp2Gg3rqA43dwTsfO16kcE74ZwEBUL1OoUfWOSmvA5vEwCucg3Xd3QIKS8eg+wlSeaAhMAYICgQabWgRvvhRjfiRYxnl0XFfiq/JLFTCFzgbn3Tdzi71qotqHlh22wuXyR31szx5vfQq5qikhGqBSe5XAf8FQmeccO6DCs/3nlmkTogcPnohxwqZ6zUETIXOlOq81amZyQtEcYkIxFCPLtsywUXD78tEfQnYBeUt8AZj4AGc3MOB8VEHuFlsNcPgp+1YPVGL8DTQyewAzqmQW/kQlQOCaVpsQToPuDu4RiCJIRa4weQVcO3GO3UK+jJPExdH7bbPKSUbgnaWkHn7779JZh8K4EGq8CdgtxG9yp5fr1JbmePbpVA;4:N1L+yvcPAVa1c7crAbJ3q7oagYPyWq1rW6E0VFkOikXxTmVVo3LkEo1hbMb1cN8eGZi1t50WYnZHSmCZo6pK/RhEI0/7RZEyFNHhIe9F50E2PNwm+GQGidR1SptppJE0fRXEXl2tAS5dAMZAAnhYZrOPwKOuECwi5jzXNFWOkwXDRe+sIOEKwId6VNNIgCorZTq6H6Gz5ZkHOfee43kB5y1WrhMv5VMhfKSfzmlxbkyMpQ5s1Zw0qmzKOm6mkLUz/3jYlX0lb5teZkqJ2Mus6g== 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)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(10201501046)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011);SRVR:VI1PR0801MB1343;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1343; X-Forefront-PRVS: 06237E4555 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(366004)(346002)(396003)(39380400002)(39840400004)(376002)(199004)(189003)(64126003)(76176011)(86362001)(65826007)(52116002)(65806001)(31696002)(65956001)(66066001)(316002)(8936002)(81166006)(81156014)(59450400001)(31686004)(68736007)(229853002)(6116002)(486005)(476003)(486005)(3846002)(23676004)(8676002)(16576012)(2486003)(52146003)(106356001)(55236004)(186003)(77096007)(53546011)(386003)(5660300001)(6486002)(97736004)(26005)(58126008)(16526019)(39060400002)(6246003)(36756003)(25786009)(4326008)(446003)(956004)(2616005)(11346002)(6666003)(305945005)(7736002)(6916009)(53936002)(50466002)(2906002)(230700001)(105586002)(478600001)(7416002)(47776003);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB1343;H:[172.16.25.196];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA4MDFNQjEzNDM7MjM6S1NjcnZSNnFBOW10dXBBZHZ2L2tkcmMv?= =?utf-8?B?RWVBUThMWDJkd0ZDUTR1VUxnbXJ6KzFvR0lNMktPZTZlamRXSHpxaG5TTXh0?= =?utf-8?B?UG9sTXloV2FwQ1owaGZpQ0pGZk5ld1Z0ZWhIUHVLdVc1aWhMTkxYRTk4bXhE?= =?utf-8?B?UCtqeC9FTEt5NnJJdjY0Wm4yRkFZTHM1YTJkYklPZVg3c2VsSkxDREJpejZU?= =?utf-8?B?dnRtLzF6b2h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Output: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1343;7:WPbZu0nCbnrnuh2dAE5PI4cN67FB6FQ/xbFWPdfReF4w5/Q9GRmPXXFL2EXSMCjZ11u8Iah9FSp7E4PlhUvu0ce01Tk9srasJDmqrG++nRjsgXcTE0CdXLHV/UYTdmOyLu2jVEvn+T3dESt6AeukwGl2b+uURs5R3e6LmldRJEceXW3DdS+ETuvRTIvscdSEIgRjI6vmi16+MZ6e2JVgg87S9xjHySTVvCCMPh/4YC+O1YhK2c9e5N0DOZpP5mBr;20:F1YUYas5t5eovH724zs156FEKeV6KzUia/xJVSwPAhN0Y37bNdComr4z3yHbzJEL8zU5eX6MarXqJA1aRQZR1x4dVN7R63YEt9o1kv9zCTcRqL2BJFgL/1O7pMiO/MjeavT0Yf/jqbyxXdLi05HRm9xpCxGIMEB0ZREtRKnqYPk= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2018 15:20:58.2216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 69762b07-2d83-4a5a-73c7-08d5932d2eb5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1343 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.03.2018 21:45, Vladimir Davydov wrote: > On Wed, Mar 21, 2018 at 04:21:29PM +0300, Kirill Tkhai wrote: >> The patch introduces mcg_shrinkers array to keep memcg-aware >> shrinkers in order of their shrinker::id. >> >> This allows to access the shrinkers dirrectly by the id, >> without iteration over shrinker_list list. > > Why don't you simply use idr instead of ida? With idr you wouldn't need > the array mapping shrinker id to shrinker ptr. AFAIU you need this > mapping to look up the shrinker by id in shrink_slab. The latter doesn't > seem to be a hot path so using idr there should be acceptable. Since we > already have shrinker_rwsem, which is taken for reading by shrink_slab, > we wouldn't even need any additional locking for it. The reason is ida may allocate memory, and since list_lru_add() can't fail, we can't do that there. If we allocate all the ida memory at the time of memcg creation (i.e., preallocate it), this is not different to the way the bitmap makes. While bitmap has the agvantage, since it's simplest data structure (while ida has some radix tree overhead). Also, bitmap does not require a lock, there is single atomic operation to set or clear a bit, and it scales better, when anything. Kirill