Message ID | 152698381022.3393.6474755436628067805.stgit@localhost.localdomain (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29C296053B for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 22 May 2018 10:10:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17BF628B93 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 22 May 2018 10:10:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A43528BB5; Tue, 22 May 2018 10:10:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 297C228B93 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 22 May 2018 10:10:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 00FBD6B027B; Tue, 22 May 2018 06:10:19 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EDAAF6B027D; Tue, 22 May 2018 06:10:18 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA17D6B027E; Tue, 22 May 2018 06:10:18 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 944466B027B for <linux-mm@kvack.org>; Tue, 22 May 2018 06:10:18 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id 76-v6so1800254pga.18 for <linux-mm@kvack.org>; Tue, 22 May 2018 03:10:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=tWjUH3aQSkDLyaAS7FoKkPrcBmqo3htyyZpge38DjNM=; b=cCuq0hrDStPsOIXMWOpH6CczUBZcdiFObgkrF9nISoU+elT//LfVnXzKacDqtQk6Ji eFFzSx+HBW0ySjwVufxXcm/rgeDJMyl39nvjywHBF5GuMa1MbpsJL0b7RaWexVj4UTeU hlrwRrlimLZ64M6Z7tLhiGfD/rgC+rmGqr+vNRIqS/PoM+b95nLKcJgxNrrKxeX9CKnJ 8y06zlNFOk9j/KsrEiI9KzBnTP2FfR9GBSQLuEl/D6u6VvlzxOf5StFBTMlRC/s1HMU8 kaBpwxWTyizMiHONGUH1zLV9x8SUvzkcLlSJcNpKEz0uOuGxBjeq7P+CeQ2+JRIgdSja OMZA== X-Gm-Message-State: ALKqPweB2nRH4yvM3HYPWRCXG+igik4dGQKJ1dids3xOghDLR898om3i 17lLr0lezpd/95po8PFZ4CcEL84YtoqHsUkj8hoEpdsZM4Lv3cK8sttuLV5c7DXLr2Iioarutcs xx9UtMOm2tRs/Ts0rzLlTHXbfoR0XGyIvg1J40Zni7lItWz/4M04571tNNd2m25BR3A== X-Received: by 2002:a65:45c1:: with SMTP id m1-v6mr18631476pgr.229.1526983818267; Tue, 22 May 2018 03:10:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqzs3dGX8Nmu22ZJUGLykBDJu3zr4aNp8wKP07hYVvvHDGvoQdAWkhuCVCpQsyfJbb2QtUz X-Received: by 2002:a65:45c1:: with SMTP id m1-v6mr18631451pgr.229.1526983817502; Tue, 22 May 2018 03:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526983817; cv=none; d=google.com; s=arc-20160816; b=SwlGpwBL5aLdkojRysSBFsMf1QWeXKg5R5ZpVMFQ4N8oxQ01QwVVuCjRZnUQS0D+s9 NCZyM3izVejaimAU5dsRF9kglv7zmT/zQiewYqEuAjMj0Og+/+ur3X2ApuySsaZ2kGPB UIpMlRQvKUQ9un6vDa6iDMLP7KdEYfvDxI4KQDlquCqC1pbGFSEa4G5DzS1vj1oTOv1j g+TUl1E1z0FcbhS7AoLSvq8IDbCByWWnnnVePcvb4rpJ9pKzMBLECc170wh2XfRZo0XI HMXBl0EyBr4tyXYCMifMMncs34NwJ8BR4TBfiGAlcQC0NOQr7ZvQFrCr5VvznPUpLJh/ pbEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput :content-transfer-encoding:mime-version:user-agent:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=tWjUH3aQSkDLyaAS7FoKkPrcBmqo3htyyZpge38DjNM=; b=kMr6lnkK7vQ8PUJujaL0kD3e9WGlsfPK/Wf1KOBK9dtf6Ll7TGLSNmYvzOlIRJGUY6 GCGv6xKVGUifHDSpjLJpqd1Nqd+08U4IOKOaeo3MlPeV9xmjZtlQZW3F/LVN0AAKM+Gl UFd+zA2ncp2e2jdh15KfJ1O3EJ0L6zT3/am4gtx2EB7W8JBH4CXuhpVfDV+lPIM03Re/ amMCy30Y501XsL6Hug0Z8HUj/VweFb+HTa1IGjmVEl6Lh8Zp883TukQAaprnMstxXtgz 0PvAyM4auIKkrAubPTrGYDSeZQJxSHkhliGaQeVToB+8RcfXyQx1fEtRM0OLO0xVD0Rz o3zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=DeK1hDXk; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.112 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0112.outbound.protection.outlook.com. [104.47.1.112]) by mx.google.com with ESMTPS id g12-v6si15720163plo.406.2018.05.22.03.10.16 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 03:10:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.112 as permitted sender) client-ip=104.47.1.112; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=DeK1hDXk; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.112 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com 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=tWjUH3aQSkDLyaAS7FoKkPrcBmqo3htyyZpge38DjNM=; b=DeK1hDXk2+oECV4faq1lmJkqGKtKNLDwHVzitJtnt1QRegsmwBazeW77/Fap7VDRPx/b0Zsh++1Lxavc7bPoDgmcBfwX8IYvpseJvTuE0k8Pz1mngAkiag9F1y15xAX549chEUBZyUkPFi7lNbaS/1e1kmH7jDnlO4A6gLZATr8= Received: from localhost.localdomain (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.776.11; Tue, 22 May 2018 10:10:12 +0000 Subject: [PATCH v7 17/17] mm: Clear shrinker bit if there are no objects related to memcg From: Kirill Tkhai <ktkhai@virtuozzo.com> To: akpm@linux-foundation.org, vdavydov.dev@gmail.com, shakeelb@google.com, viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, ktkhai@virtuozzo.com, 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, 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 Date: Tue, 22 May 2018 13:10:10 +0300 Message-ID: <152698381022.3393.6474755436628067805.stgit@localhost.localdomain> In-Reply-To: <152698356466.3393.5351712806709424140.stgit@localhost.localdomain> References: <152698356466.3393.5351712806709424140.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM6P193CA0021.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:3e::34) To HE1PR0801MB1339.eurprd08.prod.outlook.com (2603:10a6:3:3a::7) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0801MB1339; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 3:9KCjjF7FvzdmccFhhZn7DGKf2O2A7BKjM23t0yHis3p/fzKYbDiSHALowyXGI2QceI0Li3j0qq8JH1sD/X35yziI1QPhrT8aXpVVq1XdnSlSmYAYpJ9OrSukdeCuNuEhORDIaraIyB/SCS2WdHRNzaBzO/THMK1TnNeGRtl5vcxLXzgeOKO3OmG2zVavQMwdDUnXmw5ITaFav8VYP672WRj2WBsRkLQ7pCFO9UlcE2Vb5hvgH+HbmY6/a+hvddGA; 25:lQGaEgG7MGSLAoyJJMBGZYEdJj9fZROeXYwJkIHgYboKNulSg56TgSE8JZKmCv5DBoQrpE9Cmxh8RLDx7iK5A9mh/ZGWXa/rNLJXdQ2VXDzFoTvIez9mzuqhDWiYiNr/T5Q9vTvRpqqZFvzhUy5NmrmknLSG93s31bLnDG333HRtzYBsKXJ7q356N3WS7rZJafyWWvWEwGSYxHP5+jpb0QrhX6eblgaD08bA15gDOl6+MUisjd8rfpZ8f6Xy1Qce/EOhPCJ1F2HFaBVdF/5lnqmli1lXo0pE6Q5ElLaUcFZmYLAn44qgC1HKvC032qyCm7BfGQNT+pHYXWZXM7ncNQ==; 31:D++XoQRRJ+ivFrr2tnVAqAwJhzu2J2PPzcn195vJMQa990TR+OtJU9wCQn8TXVXFZjE6UNHFYBG+ehdb4iZ57nWBUIxeNYlxhSMnNWs5t0O2LgqOi7AGrsKRCJ6XD4U6f9NJqUNJcUSyk5LhB0I/SdJ2fd7fA81e/FpuNFXPSKlMWtBhh4YE51pNo/0KhoPWzz4g9yamkWLZffElnrZh3ICWkhss/Y6a5YFgfgqCNpM= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1339: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 20:JotN/IrSCQ85/5zrS9ZOoMNu03vAkCMycWfQitbInvM5cCmdiS+Dt8irSGGdducOLmwsopW/x4ZiEQ958qBoJXZGRaWrZaBBc+reIGzsDuAWphGJTjXf0oysK3sU6frFgTOYNyIMm7JPrTBkgEx/p6TLrN76ffEM9NLMKK7qgzDSEtJ2sD4dg5zWHwYTxdQCwcuLpiVkGRbzF9ub2q4mnOSyHQTWE7zXZgPQqTrmc/f6/Ad9/CZGifmOpDCUy2MHy5G1adfcmFkEqL7qKAJJazLjchtcMRo8ruxESFbzcCKHcAwIxDpnDt6lVYxT20gQjgLVrqLip5h3njWKOSkwNHQ/0YYgBr2rGvH8Srot+soQUrHeSqddC2LhXhD09kAHKkRwf5tw+7GR8dCghxggPgMN7R6kAkPjRtXWPaL6MmZ2ucH1vfFmaol1RikR+FwgYTk4klETO9L4di0UN/dTOBOfuwtbE1zIx1XfZUqjeXRfWFiny/LXbuWfaO1OJAKr; 4:c51wEAemHicsT5ohPrSyhaNDoTNJkZ+1V5OI+jmn/ux0wiYoxISk79wSgwKl4Fb2GLUe4upwpX3NeeZPtpClNzFjyby/oFH3IzUQDQBkI8HCfZYUInE4+5SfCjxj2MihOONlgjbJREjSHm9kpZnArneMxvnYWxLS8PNy85utJ911SkMj+zYQSZrq1SQd6zYoEKZOrqicaFo5SYSCxM2PHYZbdu+bquGjJtEpsnGM+YcpMlPKABSVeNCtF9XDJjR2Wl1DXUoiDih/esv1kmhKiwxYMfsGHZKkyON8Fw6stouHZcY8r8AGx8BcMTBscmk9 X-Microsoft-Antispam-PRVS: <HE1PR0801MB1339A2E06104A51827507BD9CD940@HE1PR0801MB1339.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR0801MB1339; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1339; X-Forefront-PRVS: 0680FADD48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39380400002)(366004)(346002)(376002)(39850400004)(396003)(189003)(199004)(7736002)(25786009)(2486003)(6116002)(6506007)(386003)(16526019)(3846002)(8936002)(186003)(61506002)(7696005)(106356001)(47776003)(486006)(39060400002)(446003)(476003)(23676004)(11346002)(86362001)(956004)(52116002)(68736007)(97736004)(478600001)(316002)(8676002)(9686003)(55016002)(103116003)(50466002)(5660300001)(81156014)(59450400001)(2906002)(66066001)(76176011)(55236004)(6636002)(105586002)(26005)(53936002)(58126008)(33896004)(81166006)(230700001)(7416002)(305945005)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1339; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4MDFNQjEzMzk7MjM6dGxQOThVcFZOOTBTWnhWZHBBVTFpRDR2?= =?utf-8?B?MjFkNzlXdUcwREJnV0liN2Zabjk0VXRuY2VzamhoV0dnYzNOWFVTWDcrUnRK?= =?utf-8?B?bWtrYjR3MU1hTkI4QWpacDJ0REYwRHJiakFPbUcvZHZKNW14VWE1dDN6cVV0?= =?utf-8?B?cDdpbkg5a1BQSHB0S01Jc3ZpU0o2SzJISDQ0QW5hMTJ2cU9Mckh4aXVIN3FE?= =?utf-8?B?Rm40WDdiQkdqK3V1bmh1RmtYMDRSN3RtdzVpcmI4ZnBQMEJscktCQWJld2Z2?= =?utf-8?B?WHQvNk5teDRZTjErZWtwNERhWEdoRVNWbFEvVHEzekM2SmZMZXVBSDUwN3hF?= =?utf-8?B?UlBlS0dsQkdIQlNaSmpNRUYveVF4M3M1YWJleHp2ekhHYk5OQ21GMGdLdDc4?= =?utf-8?B?NWVQZ2IxVW1KU1BxMkZVbmg2Wkl3UmxXS1hGcHlkS3A4RlZGM1BYb2RNa0xr?= =?utf-8?B?R0V4bFRMNFZ0WVF2UTI3cE9uSVlKS1o3NlNrdzhnRzNHUHBTZ0N5TFdSQjR6?= =?utf-8?B?VVNvZ0x6dD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Kpjk2P+K15l7CoF5rdrcWUxXjfZUZL5ZlmY75Wi9vrvR/sz46rdkW8lAqNbY4iV3hHzvT37g/glBbeQHwF/3IRgjFYGe38eemaXec4aYr0JDo0CdJ+xA5ViFv30G1Q==; 5:AWOZOo9XRmy/uFXG/NaaW1UsnEgUX7v71DHbKjFiULAJJpFgLfNyb+1utQ5o8pvPFiVX6FjTJ2C1OKvFnFpWBgqBakG79PmPWqZib/pAmfxQ2mlu1WooxlbB7raU0CjuKXDWiJO+1KjNZhnYzvleumY1jF67egI6I/HVb1Rvfxg=; 24:IAXoSUOjV9vy4sqhN8CZLqYBKHzqR9Bro8cW/WzGbcbBvFXoxXoaT1Fk/JFcN7fF8VDzGTuxS1z5yi7vIphh0clwV6OmsYI0mbYhjh2JPLQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 7:IhFCW/kfJ5DW6EQIc3SLCAh3mfrvk/LaWkTe7PAkuXXuSwJtROn5oOsNrxFSgTqz2MFNwABO/xxjzqKIVYaU27tbRX3Cxi3VF63pkn8hWtbqU4LtcbweJTmVjZtO/LRnx3Dlg6vn8zObPs31b4090Ja/kOSrTseSSjMDVrWEVtB/psz3XEAbkOwuBMVOIbXAvqHYPuXGsE3XzdKIMYjNfD49ylBfVIcGdMTL3klM4CpgT3NHU5/RLaBK166O7cOe; 20:i8r64vXjiB4KatBwh4qbZMSTeztQg4xQ89xSUutP5tsaiAELNG2kYMiWHWUcC09SNSK5uQDFJEoqDx0yWlUTRPf2AhmF3eTmwg4tpN0pL1YhqPQgbV3SRzCQo7Fqr2Sc7J5dU8cat4gSAfiEVlBWayT3RuxWmbRyUx9TmWgvV8c= X-MS-Office365-Filtering-Correlation-Id: 7b78cb92-a465-40b6-f7c6-08d5bfcc3601 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2018 10:10:12.1874 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b78cb92-a465-40b6-f7c6-08d5bfcc3601 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1339 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index b3ae1373c99a..c487e4300b48 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1293,6 +1293,8 @@ static inline void memcg_set_shrinker_bit(struct mem_cgroup *memcg, rcu_read_lock(); map = rcu_dereference(memcg->nodeinfo[nid]->shrinker_map); + /* Pairs with smp mb in shrink_slab() */ + smp_mb__before_atomic(); set_bit(shrinker_id, map->map); rcu_read_unlock(); } diff --git a/mm/vmscan.c b/mm/vmscan.c index 1425907a32dd..dba5f72956c6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -597,8 +597,29 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid, continue; ret = do_shrink_slab(&sc, shrinker, priority); - if (ret == SHRINK_EMPTY) - ret = 0; + if (ret == SHRINK_EMPTY) { + clear_bit(i, map->map); + /* + * After the shrinker reported that it had no objects to free, + * but before we cleared the corresponding bit in the memcg + * shrinker map, a new object might have been added. To make + * sure, we have the bit set in this case, we invoke the + * shrinker one more time and re-set the bit if it reports that + * it is not empty anymore. The memory barrier here pairs with + * the barrier in memcg_set_shrinker_bit(): + * + * list_lru_add() shrink_slab_memcg() + * list_add_tail() clear_bit() + * <MB> <MB> + * set_bit() do_shrink_slab() + */ + smp_mb__after_atomic(); + ret = do_shrink_slab(&sc, shrinker, priority); + if (ret == SHRINK_EMPTY) + ret = 0; + else + memcg_set_shrinker_bit(memcg, nid, i); + } freed += ret; if (rwsem_is_contended(&shrinker_rwsem)) {
To avoid further unneed calls of do_shrink_slab() for shrinkers, which already do not have any charged objects in a memcg, their bits have to be cleared. This patch introduces a lockless mechanism to do that without races without parallel list lru add. After do_shrink_slab() returns SHRINK_EMPTY the first time, we clear the bit and call it once again. Then we restore the bit, if the new return value is different. Note, that single smp_mb__after_atomic() in shrink_slab_memcg() covers two situations: 1)list_lru_add() shrink_slab_memcg list_add_tail() for_each_set_bit() <--- read bit do_shrink_slab() <--- missed list update (no barrier) <MB> <MB> set_bit() do_shrink_slab() <--- seen list update This situation, when the first do_shrink_slab() sees set bit, but it doesn't see list update (i.e., race with the first element queueing), is rare. So we don't add <MB> before the first call of do_shrink_slab() instead of this to do not slow down generic case. Also, it's need the second call as seen in below in (2). 2)list_lru_add() shrink_slab_memcg() list_add_tail() ... set_bit() ... ... for_each_set_bit() do_shrink_slab() do_shrink_slab() clear_bit() ... ... ... list_lru_add() ... list_add_tail() clear_bit() <MB> <MB> set_bit() do_shrink_slab() The barriers guarantees, the second do_shrink_slab() in the right side task sees list update if really cleared the bit. This case is drawn in the code comment. [Results/performance of the patchset] After the whole patchset applied the below test shows signify increase of performance: $echo 1 > /sys/fs/cgroup/memory/memory.use_hierarchy $mkdir /sys/fs/cgroup/memory/ct $echo 4000M > /sys/fs/cgroup/memory/ct/memory.kmem.limit_in_bytes $for i in `seq 0 4000`; do mkdir /sys/fs/cgroup/memory/ct/$i; echo $$ > /sys/fs/cgroup/memory/ct/$i/cgroup.procs; mkdir -p s/$i; mount -t tmpfs $i s/$i; touch s/$i/file; done Then, 5 sequential calls of drop caches: $time echo 3 > /proc/sys/vm/drop_caches 1)Before: 0.00user 13.78system 0:13.78elapsed 99%CPU 0.00user 5.59system 0:05.60elapsed 99%CPU 0.00user 5.48system 0:05.48elapsed 99%CPU 0.00user 8.35system 0:08.35elapsed 99%CPU 0.00user 8.34system 0:08.35elapsed 99%CPU 2)After 0.00user 1.10system 0:01.10elapsed 99%CPU 0.00user 0.00system 0:00.01elapsed 64%CPU 0.00user 0.01system 0:00.01elapsed 82%CPU 0.00user 0.00system 0:00.01elapsed 64%CPU 0.00user 0.01system 0:00.01elapsed 82%CPU The results show the performance increases at least in 548 times. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> --- include/linux/memcontrol.h | 2 ++ mm/vmscan.c | 25 +++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-)