Received: by 10.213.65.68 with SMTP id h4csp763519imn; Tue, 27 Mar 2018 08:20:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELvp1mRLCadEx9aLTSiUlIj6kuy7R/4bVoEJKx8ygvX8CT52nPbNaB/eILyoqMcV3wHjf2Uy X-Received: by 2002:a17:902:8212:: with SMTP id x18-v6mr36498661pln.372.1522164026034; Tue, 27 Mar 2018 08:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522164025; cv=none; d=google.com; s=arc-20160816; b=bRD6Z71MoPCn6AG8sn6hDuKIKW9+vYqfJQrOv+40gplCrYehkWGkrNma1VcAORosqD jUGvEiKnuwYuKvNaqSJE6P/aiUkLVxUIhFBtHV2C8e38GwG8/JRVpCXoyEXDbcDAJ8ox 0XNRBUnqHLl1GPhBB16PVHzMZFeHlTZByEW8oqaMajU29UicUMfZuckwyL542WEC80U0 0gyzbCf9eX0sMbhuOE/jhqu6AHQl+VhcM2Cxk4hK9wUS7PoRBiefowVCC771l2Kc18Jh xMBjqpNhkfL3qFkI5Kp+x97ofuQFbHusN6CZiw0dJIHGQfjYhecn7uRN8kyQL1SHL06p OahA== 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=cyjTHj2HKJ43REfVGsDH4fyr7giTKjC0X1nO8//N8sg=; b=yrF65ENFncsfgPWjHLrPbOEpMhVqT9kIaYz37MDn6wA0t1+fVCrduu76RSTxv2YpoF 1CAOX+SZ5HCToY6nRDgPUJG5KNj3RxBRpKbopyrHUp/Iekuxpm4I9Ma1c+I81iBHQxBA 1++xGS1izTzDVsiqJvRloK1xXbTw9Nb9wimenS06PzceXB0wDcU/0ZMOik5/8XWOmKVd 9QKLhX8yTCJ3ELE0xqiA1PTgCtqYk9wn5XHZJ853OFk31G2O9wgerCGIW7WrGLhBn+cF r38+KLzVqeWGk9EWk9/Ab49I/Rj1JA5M2YR83JOcCNgGL3pMsZQ78mTb0iQAppXlVRsb T9ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=K6DQ59rn; 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 y65si964956pgb.588.2018.03.27.08.20.11; Tue, 27 Mar 2018 08:20: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=K6DQ59rn; 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 S1752511AbeC0PRm (ORCPT + 99 others); Tue, 27 Mar 2018 11:17:42 -0400 Received: from mail-eopbgr30112.outbound.protection.outlook.com ([40.107.3.112]:63215 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752077AbeC0PRk (ORCPT ); Tue, 27 Mar 2018 11:17:40 -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=cyjTHj2HKJ43REfVGsDH4fyr7giTKjC0X1nO8//N8sg=; b=K6DQ59rnjniDk1jJjFXO/+eaB0htBzinMhDfGEc6woMwN+V0mUnWv5/0zjIK3vYZYpSIMI72aTJuRW37dsSLPpmfEd6Fnf83Q+PzAmyfpLt/aBHgNioEM3cbYlwXVpPnjMbllrXCd0z2ABGmJjzV0vIhqY+x3jL1HrTa5EnANq4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from [172.16.25.196] (195.214.232.6) by VI1PR0801MB1344.eurprd08.prod.outlook.com (2603:10a6:800:3b::8) 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:17:34 +0000 Subject: Re: [PATCH 03/10] mm: Assign memcg-aware shrinkers bitmap to memcg 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> <152163850081.21546.6969747084834474733.stgit@localhost.localdomain> <20180324192521.my7akysvj7wtudan@esperanza> <09663190-12dd-4353-668d-f4fc2f27c2d7@virtuozzo.com> <20180327100047.gj4gtmt3necmtpzw@esperanza> From: Kirill Tkhai Message-ID: <830e05f4-5105-be40-6414-9a90b610d5cc@virtuozzo.com> Date: Tue, 27 Mar 2018 18:17:31 +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: <20180327100047.gj4gtmt3necmtpzw@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: HE1PR05CA0189.eurprd05.prod.outlook.com (2603:10a6:3:f9::13) To VI1PR0801MB1344.eurprd08.prod.outlook.com (2603:10a6:800:3b::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a1d8a6c-eebb-47a2-d3cd-08d593f5df62 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB1344; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1344;3:IsLuDRIf1u5scsrXVCwTKKVw4TQVEv1j+V1UuyFNyrqngnTDXpHwEvEFBLhWzZPPl654UR0T6nU90F/udJBxbqCtdwCZN1A7xFZSJuZSgXBT3wn2jWbzlqsq43MwIYsN6s7L2hHYN6JMhPLP0KsRQJwHUDEgJzrkGEjXW2QKfGOLECKzSDXdVKRvqbEBn6CBkxWB+RAPFvgCgWd6aCyoZ91wS09Z3K5j3VEM+heZDSr6Lok3ZOAiJFttGhAgIGCl;25:5a2T2eVLXSnyhpUaNVQXuTuMbfuC+P1hHgD/lV+ZNFO8jziRidqzFG+ZKyUkYK67AADsD/MACAmmpNQY0hj1P2DVqLHLg7+Er2o1hB/Ercd0+4G+J6qS5bzf2DF43aLV08xYLEiW7Q1OhR1IuhJspTyKYOgnK0Oca9VzGr3+2Hc6cJO4+wbaG99d+zyEx0oAxw2GMTzfvFaS9rKbNFfscPsK0sIKoWibf7YmqhyWPebjOfJDDNUsBLHUtMzmb409VUdvrUy0mlBiyZgtCL1PcfIvx3h8A2BCdVptgyxfFvHRsPggPnDlTe/3bn3RDl1zY0haTeZp4F2HXDP/+mw6Hw==;31:Lsn6whyP1WfDu1AF4J2yZmYl2qEbWbMalYJ8eWm/s/DmtSq9knr69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tKLSKmvRwvdnqpN6E9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851); 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:VI1PR0801MB1344;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1344; X-Forefront-PRVS: 0624A2429E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(979002)(6049001)(346002)(396003)(39850400004)(366004)(39380400002)(376002)(199004)(189003)(52314003)(57704003)(230700001)(2616005)(76176011)(478600001)(93886005)(106356001)(316002)(6666003)(7416002)(2906002)(8936002)(6916009)(6486002)(11346002)(36756003)(476003)(956004)(446003)(65826007)(86362001)(58126008)(52146003)(229853002)(52116002)(2486003)(5660300001)(23676004)(305945005)(97736004)(6116002)(16576012)(31696002)(3846002)(25786009)(50466002)(55236004)(68736007)(4326008)(65806001)(7736002)(386003)(105586002)(64126003)(81156014)(65956001)(81166006)(39060400002)(6246003)(8676002)(16526019)(186003)(53546011)(26005)(31686004)(66066001)(53936002)(47776003)(77096007)(486005)(486005)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB1344;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?MTtWSTFQUjA4MDFNQjEzNDQ7MjM6YXUvSFh4R2FPWjZBTHJwTEEyRVozS1Rn?= =?utf-8?B?ZVlEM09iV0pyeXpWT3hmandobjhTOGprUmtnOVVJL3FNS1BKTGlUSDA5cEd1?= =?utf-8?B?SXNrcCt6WTI4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QvVUmr9UaPzszuzRNM9QEXsNYpNL+LPaRpi2yYKWlleoHZlb6Q==;5:D90o7PaZij9JiPqIZciHTsdtD9usJmFSEnFg/HWC6dJDe+j9Dw5S0L/3shPDq4NgirbA4iLGVN2bNrwkcRVLy+DMWej4oe3OrLeEJpxdys1QQX5B+8IySmAxYqi4PzWbD8Eus2HSKB7dUUY4UNEMJaGv9yIlFvyGOmSLJqVhHf0=;24:Z7GYKXiogRQ1tMBBpKrH1SOglpdNT6Hj85MdSoiGlOASmiDSd/Ue5hLxFNjCQ1+7JVWrE2N9l2hf1RZfTU1q7Qn2keQpGPkyMZXiCg4mmUQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1344;7:CLaNGyRHsDYUeAlvneIdBePX+MQ0w3k8468tLUEfxqYjm5WDiIA/IIot15z/iNVA2vFbYNhRKerMsvYnCSeSPdhHREiqVd10MgmlQ9ajpnZ3ueA5TQDoLTBoicoVC3Q4MmrvHmjJBJVzMD/7WBHO3srwF/Ld3syucWlSDkHi4IdV4QWvpTed4a4WpGaDCgqX8UkG1hDKG5xu66HQ0WClBWFpaKs1FkOZuSPO3nOwpqYWPScBFUTm4G68lPW4HrvQ;20:BmBpx8zd8e4pGRWsNd1qyKKM9/7oDRACTpw/f+9dPWIUkTgXC9vSkwtEDaNIaGcyYIReXuVky+j0SdAOsQVyjrals2PltkAiNuqzwmOrusYKQ6IRCUIT5j5JHC+Mhu+rJ2r88zHeHcpaEZax6yotH05FD5hp54lgm6019+3X56c= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2018 15:17:34.8109 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a1d8a6c-eebb-47a2-d3cd-08d593f5df62 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1344 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27.03.2018 13:00, Vladimir Davydov wrote: > On Mon, Mar 26, 2018 at 06:29:05PM +0300, Kirill Tkhai wrote: >>>> @@ -182,6 +187,9 @@ struct mem_cgroup { >>>> unsigned long low; >>>> unsigned long high; >>>> >>>> + /* Bitmap of shrinker ids suitable to call for this memcg */ >>>> + struct shrinkers_map __rcu *shrinkers_map; >>>> + >>> >>> We keep all per-node data in mem_cgroup_per_node struct. I think this >>> bitmap should be defined there as well. >> >> But them we'll have to have struct rcu_head for every node to free the map >> via rcu. This is the only reason I did that. But if you think it's not a problem, >> I'll agree with you. > > I think it's OK. It'd be consistent with how list_lru handles > list_lru_memcg reallocations. > >>>> @@ -4487,6 +4490,8 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css) >>>> struct mem_cgroup *memcg = mem_cgroup_from_css(css); >>>> struct mem_cgroup_event *event, *tmp; >>>> >>>> + free_shrinker_maps(memcg); >>>> + >>> >>> AFAIU this can race with shrink_slab accessing the map, resulting in >>> use-after-free. IMO it would be safer to free the bitmap from css_free. >> >> But doesn't shrink_slab() iterate only online memcg? > > Well, yes, shrink_slab() bails out if the memcg is offline, but I > suspect there might be a race condition between shrink_slab and > css_offline when shrink_slab calls shrinkers for an offline cgroup. > >> >>>> /* >>>> * Unregister events and notify userspace. >>>> * Notify userspace about cgroup removing only after rmdir of cgroup >>>> diff --git a/mm/vmscan.c b/mm/vmscan.c >>>> index 97ce4f342fab..9d1df5d90eca 100644 >>>> --- a/mm/vmscan.c >>>> +++ b/mm/vmscan.c >>>> @@ -165,6 +165,10 @@ static DECLARE_RWSEM(bitmap_rwsem); >>>> static int bitmap_id_start; >>>> static int bitmap_nr_ids; >>>> static struct shrinker **mcg_shrinkers; >>>> +struct shrinkers_map *__rcu root_shrinkers_map; >>> >>> Why do you need root_shrinkers_map? AFAIR the root memory cgroup doesn't >>> have kernel memory accounting enabled. >> But we can charge the corresponding lru and iterate it over global reclaim, >> don't we? > > Yes, I guess you're right. But do we need to care about it? Would it be > OK if we iterated over all shrinkers for the root cgroup? Dunno... In case of 2000 shrinkers, this will flush the cache. This is the reason :) > Anyway, please try to handle the root cgroup consistently with other > cgroups. I mean, nothing like this root_shrinkers_map should exist. > It should be either a part of root_mem_cgroup or we should iterate over > all shrinkers for the root cgroup. It's not possible. root_mem_cgroup does not exist always. Even if CONFIG_MEMCG is enabled, memcg may be prohibited by boot params. In case of it's not prohibited, there are some shrinkers, which are registered before it's initialized, while memory_cgrp_subsys can't has .early_init = 1. >> >> struct list_lru_node { >> ... >> /* global list, used for the root cgroup in cgroup aware lrus */ >> struct list_lru_one lru; >> ... >> }; Kirill