Received: by 10.192.165.156 with SMTP id m28csp1295293imm; Wed, 18 Apr 2018 07:28:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx48LAmz6Myyx3PPofgIb/dVfbK+VsUIRFFfyJyOpeJ+kM1rC5CvbvuQpQWRDGa16ekak6fZm X-Received: by 10.98.40.68 with SMTP id o65mr2183757pfo.103.1524061724566; Wed, 18 Apr 2018 07:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524061724; cv=none; d=google.com; s=arc-20160816; b=tqBqh7N57ihWA3f8wXquEfIBAe+W679wK+PuZAye4S/gkw5aFy/Gztrdq8jhzdaXfZ 2I/fju1phVS15AJDJ6eEdeVAmqqFsPPUwvMWriYAwyS7morN7gIumyAESjXoaPxZtqu+ bXxpul1N3b2rXTEG788XvOPWXS7x1CrtfuH40BKKc0uVs5/ZiJ0LdgF1rd9xAiSXxjEB EMrf2clCuBIXS9NrIcqCwn4ylazw5MT4YpdjlHmEsvnPBut7Gyd9wRU76GXywICtv2j4 okxWkahZ+L/l8YdNNzGOZ6Zvvle83pdseuLj4ZtKfpKJ3YkZDL5Q3KGFjOLurbP3V/Pi ti2w== 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=kfAPFRS5NEe++o6IMXC5FcRk3mUuS1/GM7jaLdI+YMk=; b=TJrOvM1xG5avIpaN44XjKw/Lwj57gy1D9w+Kna4bROZvBuQb9HG4AUH77ktCYdKa64 Dmyx6owANzG8QZ6Ya1crX4Mggbz5sVtqNQUGPbEblsMpRPenyZUHwD2rEL+8mfFFAU4+ CwMzbaBbJ/o6O+uXi2yZ8NVa3XCaLbGKGfOfELge8Bk5N9Ce50gRT2OAPz7mLBAS2fIt wJQWvWX5nJwxa+M4Yiu3De9h7mbhZy9F/z+HjpOwyZoYi2jZJIMT532QLsknorDkzuwv ELYxtx/kEA78m7qvNp6iLETmXhv8dYybuNsolZphun9A7Qpk6W9y231ITBjYp3hvcAtG /Ujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=ZPNoRt5I; 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 p1si1168320pge.659.2018.04.18.07.28.29; Wed, 18 Apr 2018 07:28:44 -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=ZPNoRt5I; 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 S1753519AbeDRO1S (ORCPT + 99 others); Wed, 18 Apr 2018 10:27:18 -0400 Received: from mail-ve1eur01on0119.outbound.protection.outlook.com ([104.47.1.119]:10538 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752687AbeDRO1Q (ORCPT ); Wed, 18 Apr 2018 10:27:16 -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=kfAPFRS5NEe++o6IMXC5FcRk3mUuS1/GM7jaLdI+YMk=; b=ZPNoRt5IRU/hyDDsrcA0cpH4+hCK6253S0QFkAZeYrK9uAnIroMe6ZGecRaykKF6vdtjhs2dOuNcfZzVqOolaxdZafcGmrL0h7b1iuMEdYdvA+FqOdPaGl7SclbETszDsP9KhIGcBFau3htOJgQ9hydpHbf4ng6r6uf+jCROfsM= Received: from [172.16.25.5] (195.214.232.6) by AM5PR0801MB1332.eurprd08.prod.outlook.com (2603:10a6:203:1f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.12; Wed, 18 Apr 2018 14:27:11 +0000 Subject: Re: [PATCH v2 01/12] mm: Assign id to every memcg-aware shrinker To: Tetsuo Handa Cc: akpm@linux-foundation.org, vdavydov.dev@gmail.com, shakeelb@google.com, viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, tglx@linutronix.de, pombredanne@nexb.com, stummala@codeaurora.org, gregkh@linuxfoundation.org, sfr@canb.auug.org.au, guro@fb.com, mka@chromium.org, chris@chris-wilson.co.uk, longman@redhat.com, minchan@kernel.org, hillf.zj@alibaba-inc.com, ying.huang@intel.com, mgorman@techsingularity.net, jbacik@fb.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, lirongqing@baidu.com, aryabinin@virtuozzo.com References: <152397794111.3456.1281420602140818725.stgit@localhost.localdomain> <152399118252.3456.17590357803686895373.stgit@localhost.localdomain> <201804182314.IIG86990.MFVJSFQLFOtHOO@I-love.SAKURA.ne.jp> From: Kirill Tkhai Message-ID: Date: Wed, 18 Apr 2018 17:27:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201804182314.IIG86990.MFVJSFQLFOtHOO@I-love.SAKURA.ne.jp> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR02CA0102.eurprd02.prod.outlook.com (2603:10a6:7:29::31) To AM5PR0801MB1332.eurprd08.prod.outlook.com (2603:10a6:203:1f::10) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(2017052603328)(7153060)(7193020);SRVR:AM5PR0801MB1332; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1332;3:aEOLQP3zVZkFTCdWKNRrpR4kj1PjV6p4dv/JB24vcvp2HTXgR8lDxwXwZnd9DwoHH1IbBcOkUp3gM/oXSepHtoCyOSvIxjaQQoQcrg/Z2xVBP7ZCHrGMcQq09oQqNcgZADlIF7z+Y7+1Coj/j+PvDORh5xRIxNKnEP19adA093ojibXkvrR2BTLABMC4cgnNofIayDImolJgepz0+QarjKoKw4uY07jdqcUuJBKc1qSPTCrv7K1rvw/mH02iL2k4;25:8dmqX09zjURO0H9eROodr2GLoqnRdMIRzXNhaV/bcLvWEca3d7uANuc7a6Pi/wjWRAiCtdOQHSyRQ6Nm89tCcrFHUpq890r+n6VX0EEM2l6M9BW/PealKIjp+yilN6kKhCHcm2kqBONs0SyH7i9dMcyyMq0RA2NUTay0ZJNmb5TId/FXJ6PQ2uF0mF27YiR8Q/ZPHyHSqboSseopb1dK2IglVlgX/31TDLSrPIJTfuu9z1RcOoT4XLrs5caCDrU22mvaZcB3Roiig3w0jzgQH5GR/DXAEq8OSaLESULa1DjfZjldH7ESXvI++GYqbwKKLpiT08B50hDuEz6yWQdVKQ==;31:ZtKU4VrQ3fWFqirkoHlHlVSy9ZVgnnLDVE5QaZOAm0PSNihbzrq+LRzZte2X42lT2nVBxGjiKJSqLvUwktI4JlkfMyBsSlOmsmmq8f/8C+zqpkEtdWuuy15Y2PIo3f0xznAI+uJVkxV9qN8xrPXM9ijX9R6FYUZpDztd6uyuSmg9wGpCDvkb5lAQhQuZY+Gt7n8JzmenMdIJ8+u+OQpXYkeRRjSRTBxp26n14X65+mA= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1332: Authentication-Results: outbound.protection.outlook.com; spf=skipped (originating message); dkim=none (message not signed) header.d=none; dmarc=none action=none header.from=virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1332;20:GEb8oIuhhn+SBfRfQbu3f3jevYlDJ2QEiwyluMjOTcw8Daw40TRlP6IFS5mG/wzQ8vtoWKeK+kN53DFZBLBeoDYVxUnoXX+cMqrcFNh2v/1RAys3kXbcpPpNTuW+s7QCNJ+mu/lf5LO3liNDA5W/b1USEY9dBvWHEP4uKyAOLGWkBJ7MuLBNYjWLANX+FoFT4rsYNmo2kJMWzD5HmsNQMp8jbj4M7LoKJKR1gMrcDJzAUvlyy1IKbpKP5lYzR6f24GpPGSEIpAvn0+pR5AUs1IS09ax84xeSUL1POIstyaT+CvLACSjLbhDDH/OQlGurSUnm5MSB3oZ4I8wQ0H6zTUIIEaFAfKu/vjSN+TCqzj+ybxMljtTTEsG88MazigBcpkn/F6Ct2LA+rr4BYm51TqcOV5tsnRABlgUNFCVE8OW/jguepGjAIKQXeSL4/YUMzpPWWrM2f96n7cTva4crZRTuFHusDlu7TgNOL2sbxh8m/aFSFYYtPFrGpblCJJVG;4:dE4gbaakX2wWdBFDP4vP72egvsilEVM9LrH9ei5k+c9X0X83jVKfPciica06TZzxyO1Qe8EicCd1MKOdgCx4gHzozs6ZYxgR0hB8WLQ0O+jyGHgWyeKMl6F2ICmMsiyp34za2eRY2FYBknDsmZdXaIWbi12vV7opoyKOYEkLPj8cjvSOnxyM36rmCuNNgVjeS/HFFj4wxSyfn+LDZkyJZBL/jFlXP4up3YwBo+BkQwtJizwbljUhlWA170zOWHbGQlvPV1tL8RggZGNRcHf+nw== 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)(3231232)(944501368)(52105095)(3002001)(10201501046)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011);SRVR:AM5PR0801MB1332;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0801MB1332; X-Forefront-PRVS: 06469BCC91 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(366004)(39380400002)(346002)(396003)(39850400004)(376002)(25786009)(230700001)(478600001)(6916009)(106356001)(31686004)(6666003)(6486002)(305945005)(229853002)(7736002)(65826007)(5660300001)(7416002)(50466002)(68736007)(53936002)(81166006)(11346002)(956004)(4326008)(58126008)(2616005)(8676002)(476003)(47776003)(16576012)(66066001)(23676004)(65956001)(52116002)(16526019)(3846002)(64126003)(6246003)(386003)(36756003)(316002)(107886003)(76176011)(52146003)(39060400002)(86362001)(31696002)(77096007)(2906002)(2486003)(26005)(446003)(65806001)(6116002)(53546011)(8936002);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0801MB1332;H:[172.16.25.5];FPR:;SPF:None;LANG:en;MLV:ovrnspm;PTR:InfoNoRecords; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjA4MDFNQjEzMzI7MjM6NXowRTcwell1WDNWMlFXc2ttQVNiQWwr?= =?utf-8?B?aVd2MndCS0dQUWs0d0crUjlFZVEveVAyZFBkSW9FOEt0ajNJK080V0FxcEFJ?= =?utf-8?B?bzhaM0UzT2NnQ0ZBeFpSaERGcWxxUzg4SXRWeTVDS011eG1pLzVrV2hKc1hR?= =?utf-8?B?ZFpWUUhOQmNjU2xNNEVsWWdhRjBDV1lIdE1zL3hIQ3MxMURrRG1rQVY5bXZo?= =?utf-8?B?TFB1MWI1bTVmUDhQUnRMQ2ltaUdicytHTG9XV2swZVlqTGw1Q1BJeWUrZUx4?= =?utf-8?B?cXVCZ1RnNEpCQ1Y0dHNXTVVkNFloUjJYcjlKMDVLemtOT3MzUjY3M3ZJR2Na?= =?utf-8?B?RUxveE11L1l2VDRRMz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co4ZizXocW7BwEsJZAsQzXvIiTmIc3scSueZ45g5w1lD93qF5DhGIEh0qYjNtmzSuDLP/ZUDbeQAtN2klJjZdfDUCeKo1xSZM= X-MS-Office365-Filtering-Correlation-Id: 1efea578-b6b9-419d-e166-08d5a5387a1f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2018 14:27:11.0938 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1efea578-b6b9-419d-e166-08d5a5387a1f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1332 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.04.2018 17:14, Tetsuo Handa wrote: > 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. > > I'm not reading this thread. But is there reason "id" needs to be managed > using smallest numbers? Can't we use address of shrinker object as "id" > (which will be sparse bitmap, and would be managed using linked list for now)? Yes, it's needed to have the smallest numbers, as next patches introduce per-memcg bitmap containing ids of shrinkers. Kirill