Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1565696imm; Thu, 12 Jul 2018 04:15:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfnHyXcmmyhaaQjVyT02DLuCa009iW78xlFYKApegexQy8eW6J9YR71dyy+ODQkY79O22bi X-Received: by 2002:a17:902:868b:: with SMTP id g11-v6mr1723092plo.305.1531394156417; Thu, 12 Jul 2018 04:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531394156; cv=none; d=google.com; s=arc-20160816; b=l++FNFul5nnUeADvCxcKy4p2V5RbgIpNRSmnRzvOhdlPa9oEqJVl54PaUzLGIKDhmU w0TnCBuydJnINjOYih7NNOFbbZXONt1oAUsBtaMGunYbOEO7vgfuGpwB49IW6wEvfhL4 znpSrXKVdidz6EpU50q+VnESpwd/zRVwyXk3ctB1LESlPGvI0tWoLIasLqNzsz/zXm/h Lb5sr5vRLchuEYPX/sCzGQN3Nr4SsHld24WD8bweQ+x3g7rFgz446FP7U7fYWQRK/1q8 Az5T/OP7gf80D6nx/W/nwIOUclJnVRC2BwMuv7j9pxWA4uArkh3Ws5XdNFbnne3KXITr ZMvg== 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:references:cc :to:from:subject:dkim-signature:arc-authentication-results; bh=8rDVh5IcJf6uliF4its/YMvyf7zi9MDINxmiKnxOqvo=; b=YPNKCxJ7acPuer011e9j2smi4FPCpWbDVO47/n2jA/tqyT4K5KmIrEIvNUUkndoHEc 5sodDGB8dx1wbItvrPAUH4GZxvvLa0wzLzW1SWwt3e1k/Z8KoE0OAS+nocxPCmgI0pfG c4OF3sjA2fnoCxYyK8UhGKzhIkwFECtm/K/BQTlOoKlqfrzG46Z4/7o3A/shb94MNgGU XhLpZF7Z/UYVhcIMrnxgts+P1w8RTdQUMqFsFluxdhD2dg0oQaXta6o5ALftmXT2yrrL aNbTc/TyoKCsg7IhXVTVG5mlQImI0yftAp9+McxaR76XmrJg+vyyl5DmNmTOeH74I8bN rPQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=aoWnaaic; 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 i126-v6si22714005pfc.296.2018.07.12.04.15.17; Thu, 12 Jul 2018 04:15:56 -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=aoWnaaic; 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 S1726816AbeGLLW6 (ORCPT + 99 others); Thu, 12 Jul 2018 07:22:58 -0400 Received: from mail-ve1eur01on0111.outbound.protection.outlook.com ([104.47.1.111]:45376 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726544AbeGLLW6 (ORCPT ); Thu, 12 Jul 2018 07:22:58 -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:X-MS-Exchange-SenderADCheck; bh=8rDVh5IcJf6uliF4its/YMvyf7zi9MDINxmiKnxOqvo=; b=aoWnaaicE28GSZ5SN/IrbZCtpO0XCWa3j+ADKulpfHhBr+VfZO1k3YsZ4pOO/7WIWCh7+6CHeTwsMTmB1Q1t4AAcDk7s78ZjQwFyXhVWQwxTcDuEPUjWl9XFypg/liBlgD7HNWlZV1tR4xjvccukv5rbBlOLEcaz8Zx5pvs9IQc= Received: from [172.16.25.169] (185.231.240.5) by HE1PR0801MB2025.eurprd08.prod.outlook.com (2603:10a6:3:50::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Thu, 12 Jul 2018 11:13:44 +0000 Subject: Re: [PATCH v8 03/17] mm: Assign id to every memcg-aware shrinker From: Kirill Tkhai To: Shakeel Butt Cc: Matthew Wilcox , Vladimir Davydov , Alexander Viro , Johannes Weiner , Michal Hocko , Thomas Gleixner , Philippe Ombredanne , stummala@codeaurora.org, gregkh@linuxfoundation.org, Stephen Rothwell , Roman Gushchin , mka@chromium.org, Tetsuo Handa , Chris Wilson , longman@redhat.com, Minchan Kim , Huang Ying , Mel Gorman , jbacik@fb.com, Guenter Roeck , LKML , Linux MM , lirongqing@baidu.com, Andrey Ryabinin , Andrew Morton , Paul McKenney References: <153063036670.1818.16010062622751502.stgit@localhost.localdomain> <153063054586.1818.6041047871606697364.stgit@localhost.localdomain> <20180703152723.GB21590@bombadil.infradead.org> Message-ID: Date: Thu, 12 Jul 2018 14:13:41 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: HE1PR02CA0097.eurprd02.prod.outlook.com (2603:10a6:7:29::26) To HE1PR0801MB2025.eurprd08.prod.outlook.com (2603:10a6:3:50::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3306acb-c11b-446d-3a4f-08d5e7e888c6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB2025; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2025;3:0xs32H5yEcVWHZf4XleP4Rc8kqHOxLqdzzXgoDh7cra9pY1rugbqsjigI4NA402i2+RYDu93AtAkU/3Wjj8XGfiz3yANB5PiMBGhyKYCTVXBQse3Zp5y3AidVPa9WxGdmVbQ7Z2WTefc8DudRdA8oVgCv6d16DHsnZoMWSGAL7T5AAspoXobozlm8FJXV0DstYvf+ajrElXcB9QxlJTRcuhAVptxH5uCcx3LBaK1J0tZqq2D0jFBFf3zjkFB11/y;25:FqUE1yoUFzQOIFpZcwG1PQGTpnJdkTlrQmIzzmUQpE9Ijfg7HXIGQ+1rU+qs16uI5Rg+cPm6bEqpqneEM3gacP/Xpbo1n5FPuwcDdNPnlwtij5UVJSrR/qfGVhLYDCeHg9jPtHsPYucCv/4ZOEJ30JTW3A15kHCXC8uo/ChVhUVG2G1ren/HeYr4IXZgtE3+XCQrlYs8HfsHKjNa/UOfurg7ia+F9rVWjw8J/nwiA0lCbNh4wfDLLd6i0qhNtIZd7zNc/PjldgkqNcEPXgTLUspldTR6kmgJnJifnJeQrI7iQnNZPXAaiTpSUm/H2N20WZ2B36N/PwaxlARD2U8Sog==;31:+KwrAFabZGGygz22jXyDs8Z+ha5PLY5qqTBHmg+elUJgMpXfuTJasb3maxm2n4x4pT0aqvENVq4MZ4AU/JNiPnHVVlfhDJ7ufdUvwuSG5zhunf5BRNOP0wGUrfQDmi83UZgAwYbzaTn95iDC6I/z9qqaw4o87G5Cx1hDACPeZf00NEtuM2f0MBpL5a/PsSloZZv59QoJAay1AZ+w3/F4ImXgRyuRjk1PI2fugdPIwIE= X-MS-TrafficTypeDiagnostic: HE1PR0801MB2025: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2025;20:sHhTDmqwIQXWZ4SpDVAdOBGAxfNd6zXypSuedBfVoioAPSddPNuRkQqUEAaPCQ9yUl0Ozc5SwqvJPt41Nj2i10A/e6rlVRkP7f/xWylDELsA0o7xzMUMblKHJOT3O1y8IL6Q94wKJE3Ock4vwaq3j7n9cj20cOi7EqgERSugFRulgJFp4n5Eo8ruudPbjGqkEzA8VwTJTgWoL/DImqXHLJHK7cvkVgdJMGN5hhLtr9PDSmd278M8nOeqTjJIcx7nUsMxEtXS4Szi1hrnXrQa9UJ89kIqyhM6e6XT5ZrjRKORFwV8hRBvd6vxjT+Ar3tS9x243SyGrZiMMAYJp3oFke8cMDEv5Q1Kx/Lqfu1P591k7Ob2XgYw7JvyHn+PWiEDxOnru8C5Q/xfwRWqRVM0TfsQfTBBfCCd3ZXOZgjQoeaIYRTb/3wP/LkyZ1EukcFmHw1hnHif/qC3KcJp+7Up6sSJQRVhOnXA80kuDqsYl5j7kMkSZHkFnQg/p9L24quP;4:hNfplT7POLmoiRVbiStHZJd5t0HCItxxa1hU+qdc7c+KGa7Vr7yKsOibrxEe4Gez4N92JSzEKwUYIdg2qbjEwdp/TIHxoR2IAjkiSS2iBXUS02epWSWLHVB4s0OIugJGIWIvwYydgRKFAT+yMx57o43Qz/QrygrhG/JmXObTu+XpI+oE1Wsm1fsxowI/PuMg2zv1HPSgBzBIj1RRMTDUR1YvKOKuFQ0QZLl7y3mCzvaraF3tNJh04KpHysN2EvxvenTcsHGatyj2PhbYdLPAvA+V2me2yht2GvA+dySTOg6j5aktmtKXhOR9CEWHelRH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231311)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:HE1PR0801MB2025;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB2025; X-Forefront-PRVS: 0731AA2DE6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(396003)(39850400004)(366004)(136003)(376002)(346002)(199004)(189003)(51914003)(105586002)(31686004)(106356001)(77096007)(68736007)(230700001)(8936002)(36756003)(81166006)(25786009)(81156014)(3846002)(956004)(486006)(476003)(8676002)(2906002)(31696002)(2616005)(39060400002)(53936002)(186003)(6246003)(4326008)(6116002)(14444005)(26005)(65956001)(2486003)(52146003)(7416002)(50466002)(23676004)(97736004)(6916009)(446003)(54906003)(86362001)(66066001)(16526019)(76176011)(305945005)(7736002)(47776003)(386003)(65826007)(53546011)(93886005)(966005)(6306002)(5660300001)(11346002)(52116002)(6666003)(16576012)(58126008)(316002)(229853002)(64126003)(6486002)(65806001)(478600001);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB2025;H:[172.16.25.169];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?MTtIRTFQUjA4MDFNQjIwMjU7MjM6bjNsWkUvRVE3alQ4U3BHa29xaVV1VXQ1?= =?utf-8?B?RlUxUGdPSXJrcm9qMkVLTFk4MldBblowbU1iL2ZlZm9iWnZsRWg1bUlNREMy?= =?utf-8?B?VWt6K1JWZVJtMlo1M0w2MG5Ia1JJTTRUNkMxdTd6OVI5aGp3bE5RcnZIK0Vz?= =?utf-8?B?cCt1QVRVZnZINDh3OFg3ckh4eDRtNjhEL0V5S2JrMzBXMllBbVRIWjRvaVFL?= =?utf-8?B?NXhxaXJ5UkVXOWlXeHhJRXBTdWhHN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EXN3Kzqe2zyrUOFl9cSE0yZp7FkhnZn9dG5+VKlHBZ/1arG12trgbI9VdfQ3iA2IkQNmkk+ZCdjL5rKo4w9N00fWXu7UgHhTihRF74bnT38=;24:jvLGvK6QaFacMj3HMSPayz5vnfceQJvr3SuPzeiKtVTAcxCtLCodrmt/T8niRtZtw3TvPjqSbvCuesvs/Jr7zsYOthwPd3/womi4rwKFR6c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2025;7:6NFHlXvYXZE3nBXdjrm51XNyeL28IttSSy3ZF/5+cWaTFrjDPJLxNhoow/U/GckhM6QS9W5SLhEpGlsqjWuqW2B7hUfAVdh6Ei1fIyROJO/MGvhcDpJlvYCEgmkR1h11lh/XSDicaZ37qmbrLrlPsD7U0vFViBz0VDjibgawgyW4QAgkEq8mgwtKNtxdC+qqCfGSuL5hyBTfVaBlIiHRlw6Ec4wGR5+mTIWoHjzrc2vQEUZu29iq4fytDTwkKcDG;20:8io2vCcVsur8UxCbjGrLlOghm8GyxDV9ZgxePwo4gVGz0Osj5O0vmH+TF3frvWldeIYYzq1cjevc6RzdlmrHokLzKsNQtaQh3AUpMAikMLKqJxD1a1cw1tmW+vguZfcqHhmtltcdZsvokZNjxSZChRCtmvWi0UFNJjTQezVan5c= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2018 11:13:44.0381 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3306acb-c11b-446d-3a4f-08d5e7e888c6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2025 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03.07.2018 20:32, Kirill Tkhai wrote: > On 03.07.2018 20:00, Shakeel Butt wrote: >> On Tue, Jul 3, 2018 at 9:17 AM Kirill Tkhai wrote: >>> >>> Hi, Shakeel, >>> >>> On 03.07.2018 18:46, Shakeel Butt wrote: >>>> On Tue, Jul 3, 2018 at 8:27 AM Matthew Wilcox wrote: >>>>> >>>>> On Tue, Jul 03, 2018 at 06:09:05PM +0300, Kirill Tkhai wrote: >>>>>> +++ b/mm/vmscan.c >>>>>> @@ -169,6 +169,49 @@ unsigned long vm_total_pages; >>>>>> static LIST_HEAD(shrinker_list); >>>>>> static DECLARE_RWSEM(shrinker_rwsem); >>>>>> >>>>>> +#ifdef CONFIG_MEMCG_KMEM >>>>>> +static DEFINE_IDR(shrinker_idr); >>>>>> +static int shrinker_nr_max; >>>>> >>>>> So ... we've now got a list_head (shrinker_list) which contains all of >>>>> the shrinkers, plus a shrinker_idr which contains the memcg-aware shrinkers? >>>>> >>>>> Why not replace the shrinker_list with the shrinker_idr? It's only used >>>>> twice in vmscan.c: >>>>> >>>>> void register_shrinker_prepared(struct shrinker *shrinker) >>>>> { >>>>> down_write(&shrinker_rwsem); >>>>> list_add_tail(&shrinker->list, &shrinker_list); >>>>> up_write(&shrinker_rwsem); >>>>> } >>>>> >>>>> list_for_each_entry(shrinker, &shrinker_list, list) { >>>>> ... >>>>> >>>>> The first is simply idr_alloc() and the second is >>>>> >>>>> idr_for_each_entry(&shrinker_idr, shrinker, id) { >>>>> >>>>> I understand there's a difference between allocating the shrinker's ID and >>>>> adding it to the list. You can do this by calling idr_alloc with NULL >>>>> as the pointer, and then using idr_replace() when you want to add the >>>>> shrinker to the list. idr_for_each_entry() skips over NULL entries. >>>>> >>>>> This will actually reduce the size of each shrinker and be more >>>>> cache-efficient when calling the shrinkers. I think we can also get >>>>> rid of the shrinker_rwsem eventually, but let's leave it for now. >>>> >>>> Can you explain how you envision shrinker_rwsem can be removed? I am >>>> very much interested in doing that. >>> >>> Have you tried to do some games with SRCU? It looks like we just need to >>> teach count_objects() and scan_objects() to work with semi-destructed >>> shrinkers. Though, this looks this will make impossible to introduce >>> shrinkers, which do synchronize_srcu() in scan_objects() for example. >>> Not sure, someone will actually use this, and this is possible to consider >>> as limitation. >>> >> >> Hi Kirill, I tried SRCU and the discussion is at >> https://lore.kernel.org/lkml/20171117173521.GA21692@infradead.org/T/#u >> >> Paul E. McKenney suggested to enable SRCU unconditionally. So, to use >> SRCU for shrinkers, we first have to push unconditional SRCU. > > First time, I read this, I though the talk goes about some new srcu_read_lock() > without an argument and it's need to rework SRCU in some huge way. Thanks > god, it was just a misreading :) >> Tetsuo had another lockless solution which was a bit involved but does >> not depend on SRCU. > > Ok, I see refcounters suggestion. Thanks for the link, Shakeel! Just returning to this theme. Since both of the suggested ways contain srcu synchronization, it may be better just to use percpu-rwsem, since there is the same functionality out-of-box. register/unregister_shrinker() will use two rw semaphores: register_shrinker() { down_write(&shrinker_rwsem); idr_alloc(); up_write(&shrinker_rwsem); } unregister_shrinker() { percpu_down_write(&percpu_shrinker_rwsem); down_write(&shrinker_rwsem); idr_remove(); up_write(&shrinker_rwsem); percpu_up_write(&percpu_shrinker_rwsem); } shrink_slab() { percpu_down_read(&percpu_shrinker_rwsem); rcu_read_lock(); shrinker = idr_find(); rcu_read_unlock(); do_shrink_slab(shrinker); percpu_up_read(&percpu_shrinker_rwsem); } 1)Here is a trick to make register_shrinker() not use percpu semaphore, i.e., not to wait RCU synchronization. This just makes register_shrinker() faster. So, we introduce 2 semaphores instead of 1: shrinker_rwsem to protect IDR and percpu_shrinker_rwsem. 2)rcu_read_lock() -- to synchronize idr_find() with idr_alloc(). Not sure, we really need this. It's possible, lockless idr_find() is OK in parallel with allocation of new ID. Parallel removing is not possible because of percpu rwsem. 3)Places, which are performance critical to unregister_shrinker() speed (e.g., like deactivate_locked_super(), as we want umount() to be fast), may just call it delayed from work: diff --git a/fs/super.c b/fs/super.c index 13647d4fd262..b4a98cb00166 100644 --- a/fs/super.c +++ b/fs/super.c @@ -324,19 +324,7 @@ void deactivate_locked_super(struct super_block *s) struct file_system_type *fs = s->s_type; if (atomic_dec_and_test(&s->s_active)) { cleancache_invalidate_fs(s); - unregister_shrinker(&s->s_shrink); - fs->kill_sb(s); - - /* - * Since list_lru_destroy() may sleep, we cannot call it from - * put_super(), where we hold the sb_lock. Therefore we destroy - * the lru lists right now. - */ - list_lru_destroy(&s->s_dentry_lru); - list_lru_destroy(&s->s_inode_lru); - - put_filesystem(fs); - put_super(s); + schedule_delayed_deactivate_super(s) } else { up_write(&s->s_umount); } Kirill