Received: by 10.213.65.68 with SMTP id h4csp755282imn; Tue, 27 Mar 2018 08:11:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELsrxPQgWfFMDhBhVoWXdLW0adzkW7QZtCruWXW1T1wlOlTQ0XZ7TzC8t6801PZZU09q/wyv X-Received: by 10.99.45.131 with SMTP id t125mr27055982pgt.267.1522163515256; Tue, 27 Mar 2018 08:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522163515; cv=none; d=google.com; s=arc-20160816; b=etE/9EOMqaNpnr+E+9pkq9tk3AFMlANN0nZxxYJ9zK83q3HOYMW1MrRxBFc/O04nw0 B4d12AXbWXchWu0AGNIIS1xw6Xg87YYGZM+XMXx7q/+/KZGDU5fCILGgHVvvObX4Ja1P NdrjEo9cYr6LZHnyRgyWeZKTLjgiYmjAlxeaq907bIsbPtqWumhUkzwVR46SJ3H5+vHD SQdE/ZGlHpj4WSINlybsdYKbPpMf7538OKTQXD7ZRIszZCJl9bpIbFpyyWbQiUHyETm2 kNVytkUqTlirMK6UxsyCSFOwrO/o10HGx2SYFu2c8z3eKuDC5GgzuZIXIGohq3nD64mp 2EDA== 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=FqgWzd6CeF973YPxdJ91mu6PS9Fd+STfvROEahU/aG4=; b=Hpsfw/MfY8pA1XDv5mTRZqbgSjDTeYsf7yMVTCTshut1HJlPjx13tZms+ywelF2wdw C1IkpasJ+z3tU0jjgBWKn/tQRjbZjH1WAnB2yWpteljZhfOddbMMa9SqKq9RDmgSyStJ Kyngy8ZUkQhVBkL8AnaoGFcwNeQbrOePfrIQGrRNcIezCxaZDIuUIR+FR3BkaORfC4CU /XfRj5xNhZHf4IQordA98gY392rezZqSnul+1THRGUhIccAZcVVWMdx8pNQVEmXcf3tK 0sd2mIYmqO+eSiirfs1ac+qym5eaiB5zIBoRTgVHgyAthQstHD7MPOsRxrBJrrwhVyl3 p3XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=fcsNZHcw; 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 n10-v6si1429363plk.689.2018.03.27.08.11.40; Tue, 27 Mar 2018 08:11:55 -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=fcsNZHcw; 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 S1752800AbeC0PJr (ORCPT + 99 others); Tue, 27 Mar 2018 11:09:47 -0400 Received: from mail-db5eur01on0111.outbound.protection.outlook.com ([104.47.2.111]:1994 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751973AbeC0PJ1 (ORCPT ); Tue, 27 Mar 2018 11:09:27 -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=FqgWzd6CeF973YPxdJ91mu6PS9Fd+STfvROEahU/aG4=; b=fcsNZHcwPbmDofujZq+1StteoH9ZvaSZ+hYUhKL5eltj+oodqxefPiOpiDz/M9DLmgC761WPmQ2FarrAmhHs3EszeCVxEw27lZ99pSW95N+1WsbB6p9pwfxN6ZnJmDzYYJcYtzkz8ktd9XT4bETGK0e1z15gyf2b7kSP84bYQaE= Received: from [172.16.25.196] (195.214.232.6) by HE1PR0801MB1340.eurprd08.prod.outlook.com (2603:10a6:3:3a::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:09:22 +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> From: Kirill Tkhai Message-ID: <5828e99c-74d2-6208-5ec2-3361899dd36a@virtuozzo.com> Date: Tue, 27 Mar 2018 18:09: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: <20180327091504.zcqvr3mkuznlgwux@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: HE1PR0202CA0013.eurprd02.prod.outlook.com (2603:10a6:3:8c::23) To HE1PR0801MB1340.eurprd08.prod.outlook.com (2603:10a6:3:3a::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 482818c5-0f27-4c0f-a689-08d593f4b98d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB1340; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1340;3:v4mMuoU2q6X+1XLrKYi1IkgZKllGhjNbpmcbuQH1pxXn0Dak26AknKnf/BYFH7IQ4h5j9eIkWHry8ZXCk8xnOKLGqTiPZYVvilyyuMYLaGWBgUGDIEgdoF5DeKTiTmt/bMqKuBMDirnfEaJWcc6uKw5raORUciQu8ik0bVcylyuyO40j/Ica2vzLBkhx8c2rJ6Cta03r+z/pJljg38pFT/KDFe7UialuQyl2xJk9I80hxEAc9opBsWrFP7XWZ1G4;25:sjdBVIzxmb+8aec7jjwudsh0lwF6dAIovu7YBtiRHKsIhJQ7F9ZhfwbK4Mvch7SOijQJKme75leGh9RelJIHFCVhXDzqGVHQKlUui95bSU/ebA/JSNzRsDBsU7kl9pvsa/kNtPF2LeU8zt530baG5RiP+dudvdrpLBw6QT7uLi2c9v1yoFC1iGeGmedjJAH8Y0xWwllrLEG98Gy4MoLxUSd3UGYXx1jyEp14OhfSDfKbrLF+evlFSobZhGPpM2UI/GTTcVa6790YxZEPxLKLxCXghgcnb2hiV4HOvvcuY9S7yq5Oc+3l3aaV+2DIK7jbkK5e6BSgUQtkN4viiQQElQ==;31:30j4emvuFTT4fkilgvmuOuUumb4IeGC62E5BUqUGFgVs9/Jj7PqhAi8uPt/h3Z7dUcnL6K63IV1PD/2eQ/vOdhDX8bVzYJlWl3THJG+L9AEW2IaRbaRJ25XXlwRkuBNnAPFvmFZ2CPzkFscnmJyhh2RPjSqwtXpQyx/WclkTZaCpfBdnsEMAww3oO4WMKLqXNAt+E5JNNz/Fp0D60b237nvnTK4KgAnb7t0iXImgcKI= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1340: X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1340;20:ZKMfbdg1hReQu3DDEDiQPMainckKC4USagWYBHjrQ2xMmtAsX1AblLJ9AeNHPCAatPZNzM2QW6XSd8xpzWhDfrkFEiUKAHuUUBNyADiPlXAaC6ICNuxmen1xPVDHd0+hYZdxEYsJsuNpVFuBmTRGeZ2Ht3aHWbTOKyi/2ugAwmoc4ImoxgfuRH4fJ2gWeLmoJ8pNmD4TofFXowySsDuqBobV78Iuon6A63/HiWv0Z1/6oKOQhUDl+OItZ0yFLHbTx5HRgS5/4HsBwP51swWdJwC1i8XtjZnzYx9cRJSKOf00MKtMKWuchbKYT7RBXd2Xr1JJgc3hT8sKkruFJQVdIAun7uqMw8DrF4yPhoMNbQr/07SzV3m6futM+K+e4k5LW0y6i3P9EtP6X3i5anSUnmu+13YnMT/LZgX1fKehhE3pfilHivg5N66FETAkl9LGEX7U9DcTXCdSJ6d3g/YOCpXrn/o519grvkVEYesU634DkWhKtdmO4hi4r2xZ5dj8;4:j9mQ5XSc+UI7GE9IRnMhmth95rsKfIhWKOzuqFTUp/hKz2KAGb3maFtHWGpqOLjIAx4TOpDSfi1ryOm+Dml95fBqRqsj0dZZVZiYP/T8s6xG2f8lNKzLBRIExzz3qjue8yUi3Yf/oECqsnlX7aojv5S5iGXgKZnBguHAFVJ+D05I9EDZZaXg7jCISYMULHQfKMV/6ePIqkuBHc2T28/qjzINjUT79gIdZ/DgFxboXfxsbw3necQdsoN6C1aRbmerLwUXnclmbD3Gp4c+fIVgsCZ48OPyc61QTKZbyEuZee+qFulAm0xmiatyEZnOLrfY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); 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:HE1PR0801MB1340;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB1340; X-Forefront-PRVS: 0624A2429E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(376002)(346002)(396003)(39380400002)(39850400004)(366004)(189003)(199004)(52314003)(76176011)(52146003)(52116002)(230700001)(478600001)(6246003)(86362001)(2486003)(23676004)(2906002)(7416002)(31696002)(58126008)(7736002)(65826007)(6116002)(3846002)(59450400001)(47776003)(5660300001)(36756003)(65806001)(53936002)(65956001)(66066001)(6486002)(305945005)(4326008)(25786009)(93886005)(16526019)(97736004)(186003)(77096007)(446003)(229853002)(50466002)(39060400002)(11346002)(956004)(68736007)(2616005)(16576012)(105586002)(55236004)(64126003)(8936002)(81166006)(26005)(53546011)(106356001)(486005)(6916009)(486005)(81156014)(8676002)(476003)(31686004)(6346003)(316002)(386003);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB1340;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?MTtIRTFQUjA4MDFNQjEzNDA7MjM6MjJ0bUNqazhSbWI3SDA0RHk3UFBGUmF4?= =?utf-8?B?SEtKMGR1TlUvMWJjY1FNSmpSZmpJSkdSTmNOU2hzakVBdTZqRElzU3BiMW54?= =?utf-8?B?Qm9YV0pEd1NCOThWazZIZVJHSU5RbDlxeFFQTGx3aGhSRUJTUEtPWW5WdmxT?= =?utf-8?B?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sw6EgNa2VeeOgfTl8JnmyCpeXB9czsJmF9mbii+IaXPGN5Zf/+i3jYhy4Re8ogok=;24:lhrqyNVeQ2QPTSKZ6mPUSMQ8cA3bT1yZrZRR7E/FOU2nViMYfspn1tatkem0vG4GW2b6OGn9YXU2Mvav+RRTfjKtpCmR5OcxB598djtefXY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1340;7:e544gVMOwlH7Vbj5iNttu5qNeZtsZNRzgNM8lmBIBBjLstHMfmbXH5MMto7A1ROnVoiQH10RhlJC//EbKyZaxAPnIAzwdQy1q80FwtMl8vzgXk6aywKgb6T5xQVvqVZ//SNsCmYhQgKjXKjIe/DWpiPIFE8Rk3v48chqTtTSju4B4iYu5hmhIqSSUT8pJWglOvv7cFKDwb5hG5fKXFNgEdDK5Q6YKdIx4/QFyWbynyrtMqgBUw/w5FfxqcaNXtYz;20:9TIVIY7dOxnEJHXDZ0sp3akXZx/2MR7RyZrj0B1iVgObC75bt18J7qfYf90MDfB04ODZk/nVug4kU861bWA0IB7M5W+4SDX5P5TtwlYH1uHG2hneAlq01Zes3AkTDVkrZK+2TinlXXYUy9SR8S/m6aMJ8GBnW1SI7h9hbNJ0q1w= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2018 15:09:22.8414 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 482818c5-0f27-4c0f-a689-08d593f4b98d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1340 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27.03.2018 12:15, Vladimir Davydov wrote: > On Mon, Mar 26, 2018 at 06:09:35PM +0300, Kirill Tkhai wrote: >> Hi, Vladimir, >> >> thanks for your review! >> >> On 24.03.2018 21:40, Vladimir Davydov wrote: >>> Hello Kirill, >>> >>> I don't have any objections to the idea behind this patch set. >>> Well, at least I don't know how to better tackle the problem you >>> describe in the cover letter. Please, see below for my comments >>> regarding implementation details. >>> >>> On Wed, Mar 21, 2018 at 04:21:17PM +0300, Kirill Tkhai wrote: >>>> The patch introduces shrinker::id number, which is used to enumerate >>>> memcg-aware shrinkers. The number start from 0, and the code tries >>>> to maintain it as small as possible. >>>> >>>> This will be used as to represent a memcg-aware shrinkers in memcg >>>> shrinkers map. >>>> >>>> Signed-off-by: Kirill Tkhai >>>> --- >>>> include/linux/shrinker.h | 1 + >>>> mm/vmscan.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++ >>>> 2 files changed, 60 insertions(+) >>>> >>>> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h >>>> index a3894918a436..738de8ef5246 100644 >>>> --- a/include/linux/shrinker.h >>>> +++ b/include/linux/shrinker.h >>>> @@ -66,6 +66,7 @@ struct shrinker { >>>> >>>> /* These are for internal use */ >>>> struct list_head list; >>>> + int id; >>> >>> This definition could definitely use a comment. >>> >>> BTW shouldn't we ifdef it? >> >> Ok >> >>>> /* objs pending delete, per node */ >>>> atomic_long_t *nr_deferred; >>>> }; >>>> 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. >> >>>> +static int bitmap_id_start; >>>> + >>>> +static int alloc_shrinker_id(struct shrinker *shrinker) >>>> +{ >>>> + int id, ret; >>>> + >>>> + if (!(shrinker->flags & SHRINKER_MEMCG_AWARE)) >>>> + return 0; >>>> +retry: >>>> + ida_pre_get(&bitmap_id_ida, GFP_KERNEL); >>>> + down_write(&bitmap_rwsem); >>>> + ret = ida_get_new_above(&bitmap_id_ida, bitmap_id_start, &id); >>> >>> AFAIK ida always allocates the smallest available id so you don't need >>> to keep track of bitmap_id_start. >> >> I saw mnt_alloc_group_id() does the same, so this was the reason, the additional >> variable was used. Doesn't this gives a good advise to ida and makes it find >> a free id faster? > > As Matthew pointed out, this is rather pointless. Kirill