Received: by 10.213.65.68 with SMTP id h4csp774410imn; Tue, 27 Mar 2018 08:32:00 -0700 (PDT) X-Google-Smtp-Source: AG47ELszrMUO00ZYZbBpXxYiD9wJjJLuH+92lFlq12AIqqM0QA/5JF4jYcQzZWJz2jV+PDRtHZ7d X-Received: by 2002:a17:902:e5:: with SMTP id a92-v6mr44604367pla.26.1522164720164; Tue, 27 Mar 2018 08:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522164720; cv=none; d=google.com; s=arc-20160816; b=togH+bOTcNMpWE/AXt0Rkj1Vxhg8snluRaiMXr7G/o8B69aKiJO7+OGQWh52B321fJ TjlhjWd7FNwhyNA6uLUinWcnijkzzkMVhzRuqzk08Dcrej7kH4GN4mnMJo2H71aedbvi WMJ1nQn0gf1B6aXGISe7v3p6iEXEwXpfzoq4cjP8Lum3WdtebxWViWvOEMjhpZRJKK/h QYcobHn8CkGi5OueFtquUUR5b0TqXlh8YpQkYINUCly+av40IF1vpuK2C1oXX9Mc9929 yd4okaIPJwHNZBBgyT0GH7MDSfBBtwg9PtmR6YRKEyE5+ZB21yP3nG6FxweP0KAD0iXk g3AA== 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=aISgJno409fgMPKdDfB69myioIuC44L442OTTiFPGvM=; b=ycDJEcobpK+sxbyISFE/Img68C56URAKzbt7cEsS8pmVNG+p2NjnSddcJQli8TpCbi mHFuK0bVecBNMGJlyN6+9Re1iSMlwITC8qwYi6GsNUHA0vop8bQRGskhfnGv2G6tJ0cY F6yGWc5O9N5CmKUvl+7H8aliQz80Uj390Yx7EWXcyhdwI6K7JFJmKwPR/Fsjd9SMv+eJ YjtRNldqGhlLGDyxXp/AV9AVHdp7yJZ09W/pWYmDmV1s9rtah3CAeuIpkRriG0RfVqw9 QYj2HiPxP4osInWjxWaeLJYL2jaaM63PmUu0r+1cw8awqZcU6lpgwTtF+kyMDcrHYs3y ZISA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=PyPjkaSQ; 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 x13si1092504pfm.281.2018.03.27.08.31.45; Tue, 27 Mar 2018 08:32:00 -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=PyPjkaSQ; 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 S1752267AbeC0Paj (ORCPT + 99 others); Tue, 27 Mar 2018 11:30:39 -0400 Received: from mail-eopbgr20122.outbound.protection.outlook.com ([40.107.2.122]:53995 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751120AbeC0Pai (ORCPT ); Tue, 27 Mar 2018 11:30:38 -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=aISgJno409fgMPKdDfB69myioIuC44L442OTTiFPGvM=; b=PyPjkaSQKSsX0bc04dpbDpcGBiNepCEoyKDcAwoS3RJNFPMQJNec8hTJ4MrlWO5qxx4LToUIr/oifftFgdP+tbJtVBEKjLQdtGqrNXvjIJ64DQf+Md5qTCNJ8qI/AUmOycy9KBoaHbK6nVTWCebd0OAmBglbbc5S3HiQkWbL0XU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from [172.16.25.196] (195.214.232.6) by VI1PR0801MB1341.eurprd08.prod.outlook.com (2603:10a6:800:3a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Tue, 27 Mar 2018 15:30:30 +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> <448bb904-a861-c2ae-0d3f-427e6a26f61e@virtuozzo.com> <20180327091850.ybql6l6gavhdieqg@esperanza> From: Kirill Tkhai Message-ID: <6660e4c1-7a52-9203-e901-fc87be328c8b@virtuozzo.com> Date: Tue, 27 Mar 2018 18:30:22 +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: <20180327091850.ybql6l6gavhdieqg@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: HE1PR0402CA0038.eurprd04.prod.outlook.com (2603:10a6:7:7c::27) To VI1PR0801MB1341.eurprd08.prod.outlook.com (2603:10a6:800:3a::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2c169283-fab6-420a-da2f-08d593f7addc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB1341; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1341;3:PJ7+0CZX5jlSvDwBix90L4YLAvOYdFvTAIwa2E2BxLXbffB6YecU2Xvcg8JBfGS5tTR8pLMjR2rqL7fMJxykfkhxIS94Inq39tT9yErEUJ7Bwlxu8oRTL8QGCHWlMolgODLtkYLb3d/1bQE28rJKzPn22PSWwBMSuACk8zSqrUKwN/Y6qlas0TmOiX0k6KGT1+DkIP3PTX+tHRxaKopeSLWhUiof6LTEHUHnigChTDCJbSE15FR6amncuREWyfGY;25:4hhLbo3C3ssg1fgb8Sx7W5/AEjify0YB5IW6OAbaLTR9wDkN9sdXeZ0JLOqBqhYWAprE7snw7MlAlus+8AyYsw3mI3GKFSCeopraibZbXfFztiVI7L9weyj8EghD4tQQvzOXedY4X5CG53PweM1gQogxCcONMHqyD6aiMVSFHOXa6YfP/eG3NPFmVvWlZP1W/769MFgLXTB+BCQzUwcCtgC7ZVYAxT7n2BRBjY2/puM46HZXilZSXwzndcXiqMi1e36qwwSByfYjTk+c+vIFiWoPeg1dojCe8j+CoeCHyjTnyM4giNzWOkRho8YznIdHrlESy5wzWJz+WBLSalk9qw==;31:K5i3LBUP6aFrdZgrMKZD5QNEReMyBlIVkV9Vl11nyGZVOmKp0YUk4lmKM/0+XzUv3YPvHhrAaXTy3t3Tq32onfdkS28ke4UGUK2m1TsuXNzFXdAbkL+fLo8gqffASJbClb7YMkXD4AH7DjggAPK/bMuQP2xfD4aX4IVwqcQNlTX1SXeJ8japVzYeoum9ReQriEDScUxz9dmkvUYo2k81IjGHoblMzeM+7F18cFrVyFU= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1341: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1341;20:eIkpWiatIky4ABM34j8kYc+Jinj0dnp1FgxHfH2dVTAboCIpBQA3r8AJ7yqFnos7AKgcebDDwjIigz1PxbT+sQBRKO14T08PFpY4CBIRdnNI+TA+K3z6cL6nZnNmzM9M77JvD/OcIRT6jq++ZY/TA//Uv3cC2U3blmHEX/aCue1/y/l6yDkNk/nPZCZEfpqAz6aetSz6k3ZTLzyPPuLJN0OI6nvJXBxZ8SkOw/mo5o6/C8bPubvm2NWiNsYeHwbWG9HkPh1kWugn8+S9iBQDeLAist392bBj2Tn6OtIjU/j4RLgBs5/EQKtltFzsKb6H6H3LMqHdO23gWaqRc/urt34cpxYORNY4klQkm4FoJxIcLAFA44IjiuNVyPseua4yOoUiVG0k+mpPIS8LVi7WUnPNN/Ej6iQq3Vvka5bwbEfkQNlCO73SWdVklBQW7uUmj302NNY2O4UDW3eabpuJhCccXeXaKG65hKYJv/j2AFNWoMwZfshPHDv1vBOxYExA;4:g15rwaJJ/NhC7zvBuPA5wJ84cyq7ZofoClkEdU7ErLNrJGdSZJuXpbZaKYIMUoafUXRySttkjW7QdmtVpDilaixox6h82iZI9w+NB4SQQysXoTB8piEIsge3GKVjWyNY1RBW4cTDJhUOHqE9cgRlKjCzWtHDdlytnlPMczgBvutw7j+gRJ7Yn2rlWTXC9sSJbzuF3vPMWuvQ3qQiB/4eDC8kgNCfzvBx2SQOOezVX5tySXwdKaJmya+dC6VS77H5LeYWYZR895mvOroly5mQTg== 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)(93006095)(93001095)(3002001)(10201501046)(3231221)(944501327)(52105095)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:VI1PR0801MB1341;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1341; X-Forefront-PRVS: 0624A2429E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(396003)(376002)(346002)(366004)(39850400004)(39380400002)(189003)(199004)(47776003)(105586002)(25786009)(2486003)(23676004)(76176011)(52116002)(52146003)(97736004)(68736007)(64126003)(229853002)(50466002)(31696002)(4326008)(39060400002)(53546011)(55236004)(2616005)(956004)(386003)(486005)(486005)(6246003)(446003)(2906002)(26005)(186003)(11346002)(86362001)(59450400001)(16526019)(77096007)(3846002)(36756003)(6116002)(7736002)(93886005)(106356001)(305945005)(65806001)(6916009)(66066001)(58126008)(16576012)(478600001)(81166006)(230700001)(6486002)(6666003)(65826007)(5660300001)(31686004)(7416002)(8936002)(53936002)(476003)(8676002)(65956001)(81156014)(316002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB1341;H:[172.16.25.196];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA4MDFNQjEzNDE7MjM6OGQvQkplSEttMHBoWlVlYjhVV2hYNysy?= =?utf-8?B?b2QrYm1vNlJNOHpDYzgyUWdjQkIzaTRvL1d1T1NEQ3FiZVNZYnpsNXAyZzh2?= =?utf-8?B?VjFuRnl6QU1xTFBIQUc0RW5zb2dRRFEwVXZrOGtBd1dIOHdpZ1hjMUsyM3hR?= =?utf-8?B?QmxRME1sUTZSeVhHMFMvUVVMTC9KczA2QnNZMWJVdngvN3dLc2I4SXpWbkpE?= =?utf-8?B?OFE2WU9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zUNzEIHiNx35W1RTVzLY3ToJgNNPmx7uDriA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1341;7:gtlGpp05t4FffX/6Cdpy1+i42+xEe0ti7+nkcfxo5cSfz+JE4xSU6cthlXcUUH75vLni1MGcmq0bVSQQxZ7tz/htkIXQz2BZadZ7SSxV9rMpMEmIAr3Dc6HJunmETFQv4bbvn3u3dj78dNCHDYe9YJlLYTpfp8SA8YpjamSyUNVJiKwytj/xauizymNZNgciyvkB380EF3biTecJOtZ2NpIg3ltw7MVjEYafPwb56xrgFEeNqA9jVSEGGHSbfF4Z;20:y6sldCTnCH6cSP/QK+X1E5HjWr9IIMu0dcXvRxZ5bKtXBp8quRFLX+k0G4u+4afCbAckfWWkxyqXdJUjVTIhpNzUj6lg0mWc2SFH4coeRzDnTMDzQhsRHIlMwXjKhT96gbi7cZCG59RJLZZLNpCo/dGLxivXKnKrG475ABFjyig= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2018 15:30:30.1085 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c169283-fab6-420a-da2f-08d593f7addc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1341 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27.03.2018 12:18, Vladimir Davydov wrote: > On Mon, Mar 26, 2018 at 06:20:55PM +0300, Kirill Tkhai wrote: >> 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. > > I didn't mean the per-memcg bitmaps - I think it's OK to use plain > arrays for them and reallocate them with the aid of RCU. > > What I actually mean is the mapping shrink_id => shrinker. AFAIU it > isn't accessed from list_lru, it is only needed to look up a shrinker > by id from shrink_slab(). The latter is rather a slow path so I think > we can use an IDR for this mapping instead of IDA + plain array. This is good idea. Thanks, Kirill