Received: by 10.213.65.68 with SMTP id h4csp281346imn; Wed, 28 Mar 2018 03:33:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx49TehTrdFObgj54BS95DImodXatRkMCXPlmSFeEqzrHxEdp0wtzqIQTNb1HJ/7MMNY7GUoj X-Received: by 2002:a17:902:30a3:: with SMTP id v32-v6mr3216834plb.123.1522233191299; Wed, 28 Mar 2018 03:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522233191; cv=none; d=google.com; s=arc-20160816; b=uDGSaeJuyfgH4VowufA6IkqbTEdiAsYHDyutPV+FjcXbk7tRwO2L6vhBTJ9WP+ZJRf EZG/m1B78RAd7tlDFxEkHINSHDU11fohsSUpych9B9JECzfsYY5JWEahEW+clYL05vIU G2enOR05rOBQRNo7stwYjpWjS0tTVwhnGTzATuO5e+OjEUDa+rkmHx+kYsZbcACskH5T DNO0yHYYAZY0ziZ+FwO0CIw1AUENaTcVoZbgME+HkGWrJ8ZgJ9Uu1HXoTw3SpqyPyDGB wwkPMhngyewk+hGz6/rmTZD0FYykPrgaXtXy5AeeGr0r6Qz7TRgCnqDpngvsSh1BUpqH Rmvg== 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=/gN5EBGZi4/44pW2YPjwDuflgAkGBcngl4I5Lz1c4e4=; b=Aq0d+1DS9X86L7KLcFMwnMwBHrAt4VpGQUzYYHipbU6sVia8AvUfnxBKYxsIdxe+Y0 a/q2N4UVpktcRup/putse7cHi0EVg7X5tTKJA8G3X27c/YSouE07703aY71JlpQqQiMT znWFcmVHf/PhaEy7ZAGcTCf3DrTbcYH7Fsr5VZbqusPaV7Te2ZuUOc1X42kwnnAP9PFb nAoL7ViQzTeO49on1TEEfIOuQ82fE7RP4k9D/CFnvrprSm7QuoVnKS9H+6jyCfjyPQW8 aLU7l0e/zcdMlBuudUdMnPuFte89H7hpR+oIz+wuMqTX6otZFdPGF/Ebywx2gV63b0M6 ZLhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=MBrlfs46; 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 u70si2536429pfj.341.2018.03.28.03.32.56; Wed, 28 Mar 2018 03:33:11 -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=MBrlfs46; 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 S1752879AbeC1Kac (ORCPT + 99 others); Wed, 28 Mar 2018 06:30:32 -0400 Received: from mail-eopbgr10096.outbound.protection.outlook.com ([40.107.1.96]:9488 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750774AbeC1Kaa (ORCPT ); Wed, 28 Mar 2018 06:30:30 -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=/gN5EBGZi4/44pW2YPjwDuflgAkGBcngl4I5Lz1c4e4=; b=MBrlfs46lNY3CMXr3CGQCZT0Fs+MvPFYqvBpQLeGdJqUhjt8fDTjVZwwK8cElNmZT3MsT/HdAgD9Ir2Pk8Bwu+yrJdbKIa9LzWgF1XT3Knpf0R06c12RN9lwPFZimzKwiLnIs7UkITUjRrFV8uaw19qwjkthvGym3FV3c9hN8vA= Received: from [172.16.25.196] (195.214.232.6) by HE1PR0801MB1339.eurprd08.prod.outlook.com (2603:10a6:3:3a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Wed, 28 Mar 2018 10:30:23 +0000 Subject: Re: [PATCH 01/10] mm: Assign id to every memcg-aware shrinker 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> <152163847740.21546.16821490541519326725.stgit@localhost.localdomain> <20180324184009.dyjlt4rj4b6y6sz3@esperanza> <0db2d93f-12cd-d703-fce7-4c3b8df5bc12@virtuozzo.com> <20180327091504.zcqvr3mkuznlgwux@esperanza> <5828e99c-74d2-6208-5ec2-3361899dd36a@virtuozzo.com> <20180327154828.udezpkwkwzcftnqn@esperanza> From: Kirill Tkhai Message-ID: <635e8bdf-9280-c872-49c3-d3e293e1b332@virtuozzo.com> Date: Wed, 28 Mar 2018 13:30:20 +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: <20180327154828.udezpkwkwzcftnqn@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: HE1PR05CA0127.eurprd05.prod.outlook.com (2603:10a6:7:28::14) To HE1PR0801MB1339.eurprd08.prod.outlook.com (2603:10a6:3:3a::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 781606ce-d404-4dc7-c64a-08d59496eaac X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB1339; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1339;3:wE767EDEzyu0yva1qlzbsMLoMqTbSNuwcHMKJK33vy9oJWwiLty0wppk0UHHKUKza+mmYNNpuLHUWMfRBMrbJ3FXXC1060g/LW3iGXZoqRW16IiyAjJVTdvrT8VJJwLkAnC1fVxEKo5XoeMrVb4s76KqSHY1FTSuxoKnim38hz0GfhZg06eweWiO5w8MT+s7N1yhB8AiTBrPrMTit/8TbSdBBK/wimi8R2Bcz+T2vV8EHr4W1S8PCb3bLSUerzaK;25:LWtUw+WpAOg/ous9Lc4neXw7wtlD63ru+KEgckxRVrHOFINqcUFKkTJSPqc+HsVV/Gnphorgxj82kDJqUkOTYnoZQ1Z/WIX+94MP5HXPInSpU7MAG/zM8hzlOcgYjIMW4dQrhsQ7QvSxjzTbCd9+Ozh/e/B5dsM0RnCRDRppuO3ftyf/MaZdslD//LnAJwGKNIhbfcpX4mPmjbYSuiNK/3VlFn5UeU61HspObhOoQBxN/oI0K1VogTn5r3SvvL0dqTw/qcc4q+mB+qam9r1XaJdxxHoJC6RxASq3cZWyv7yce29vVkBwFIqWyCO6qjPxAsTbI98628ye+RtG9ZcBOg==;31:dskCzcsOjDfR0EP0VvQipVHBeDzx+ZCrxYvMJif/BbMckC6XGK4N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Wu4YD1oWsQN9ENqIFSo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231221)(944501327)(52105095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:HE1PR0801MB1339;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB1339; X-Forefront-PRVS: 06259BA5A2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(366004)(39380400002)(346002)(376002)(396003)(39850400004)(189003)(199004)(52314003)(5660300001)(230700001)(6246003)(106356001)(65806001)(6486002)(66066001)(25786009)(229853002)(316002)(65826007)(65956001)(305945005)(47776003)(7736002)(476003)(53936002)(7416002)(11346002)(6916009)(2616005)(956004)(36756003)(478600001)(50466002)(64126003)(446003)(55236004)(8676002)(3846002)(8936002)(97736004)(6346003)(2906002)(68736007)(81166006)(81156014)(58126008)(16526019)(26005)(93886005)(4326008)(186003)(86362001)(6116002)(76176011)(52146003)(2486003)(52116002)(59450400001)(105586002)(77096007)(31696002)(53546011)(386003)(486005)(16576012)(39060400002)(486005)(31686004)(23676004);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB1339;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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4MDFNQjEzMzk7MjM6QU5FUDBTeTYya2VPK0dYd3BCbjNrdk55?= =?utf-8?B?dXgvakcyTlBLRTVrQUMvUWVTTG5yUnVVQVEySXg0M0k1aWZsS01yTHloYnJV?= =?ut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0GE617fDa/kw9pBbhrqL39ZxY5yrFKvhYqFNxcRp2j3PCuHLmrSW7jHlN46BB4Pr3V3ap4DoBkERlmInXAYxvrTxe6Q4RlNAi3bQORNLB4=;24:/1XzLqge9k+sNthIMoY3LZBg0cr/eE6Yj5NZCNVxXF0YQerV90F9Ak3plTAcBCGwm0HNuYFbJd5pgQ3pMS3IuE8Nq36ulYVCPNAKVt4jSYc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1339;7:K94CWhrGgYFvtSmTiXKjyFLrQSQKrhC2FeGWT1n5c+kpU/6TBzhD8nKYOoE9D3Yn5cz2F/DlYcSNNHagnVIUlqter2LZElHG8CBG/cH7rjAGFisL0St4HxeZha4xYaXM8Ra8ehd+opqFhQ7DECE7RyvX7jjI3tqgeTEnNvKGcubdrcD+I/AKVaVbtiCy4/Xiy/8Mutsy1UPQmG4HjXQOp+iDMT8hTtX9IUO8zI20siv8xBZebOMEWEhFbKHgQVCP;20:+yhOGuLwrwRvYrckCAdTzFd+37DD+dhNidb4rmJkt9Mhf1vjFnhvVoTymh000gqdJtBqHn2/hanYOn5PIqn1+qUxUCOA8l6gMoeUT+SGuwet7CXQEpuKEo6+RkUK5b8QYvzYe3XkyEKqjhpL/inAaTDcG+aRksqvSyIURORe2m8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2018 10:30:23.3020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 781606ce-d404-4dc7-c64a-08d59496eaac X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1339 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27.03.2018 18:48, Vladimir Davydov wrote: > On Tue, Mar 27, 2018 at 06:09:20PM +0300, Kirill Tkhai wrote: >>>>>> diff --git a/mm/vmscan.c b/mm/vmscan.c >>>>>> index 8fcd9f8d7390..91b5120b924f 100644 >>>>>> --- a/mm/vmscan.c >>>>>> +++ b/mm/vmscan.c >>>>>> @@ -159,6 +159,56 @@ unsigned long vm_total_pages; >>>>>> static LIST_HEAD(shrinker_list); >>>>>> static DECLARE_RWSEM(shrinker_rwsem); >>>>>> >>>>>> +#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) >>>>>> +static DEFINE_IDA(bitmap_id_ida); >>>>>> +static DECLARE_RWSEM(bitmap_rwsem); >>>>> >>>>> Can't we reuse shrinker_rwsem for protecting the ida? >>>> >>>> I think it won't be better, since we allocate memory under this semaphore. >>>> After we use shrinker_rwsem, we'll have to allocate the memory with GFP_ATOMIC, >>>> which does not seems good. Currently, the patchset makes shrinker_rwsem be taken >>>> for a small time, just to assign already allocated memory to maps. >>> >>> AFAIR it's OK to sleep under an rwsem so GFP_ATOMIC wouldn't be >>> necessary. Anyway, we only need to allocate memory when we extend >>> shrinker bitmaps, which is rare. In fact, there can only be a limited >>> number of such calls, as we never shrink these bitmaps (which is fine >>> by me). >> >> We take bitmap_rwsem for writing to expand shrinkers maps. If we replace >> it with shrinker_rwsem and the memory allocation get into reclaim, there >> will be deadlock. > > Hmm, AFAICS we use down_read_trylock() in shrink_slab() so no deadlock > would be possible. We wouldn't be able to reclaim slabs though, that's > true, but I don't think it would be a problem for small allocations. > > That's how I see this. We use shrinker_rwsem to protect IDR mapping > shrink_id => shrinker (I still insist on IDR). It may allocate, but the > allocation size is going to be fairly small so it's OK that we don't > call shrinkers there. After we allocated a shrinker ID, we release > shrinker_rwsem and call mem_cgroup_grow_shrinker_map (or whatever it > will be called), which checks if per-memcg shrinker bitmaps need growing > and if they do it takes its own mutex used exclusively for protecting > the bitmaps and reallocates the bitmaps (we will need the mutex anyway > to synchronize css_online vs shrinker bitmap reallocation as the > shrinker_rwsem is private to vmscan.c and we don't want to export it > to memcontrol.c). But what the profit of prohibiting reclaim during shrinker id allocation? In case of this is a IDR, it still may require 1 page, and still may get in after fast reclaim. If we prohibit reclaim, we'll fail to register the shrinker. It's not a rare situation, when all the memory is occupied by page cache. So, we will fail to mount something in some situation. What the advantages do we have to be more significant, than this disadvantage? Kirill