From patchwork Tue May 22 10:09:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10417881 Return-Path: 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 D19626053B for ; Tue, 22 May 2018 10:10:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BED3428BAB for ; Tue, 22 May 2018 10:10:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B211328BB5; Tue, 22 May 2018 10:10:02 +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 74A3828BAB for ; Tue, 22 May 2018 10:10:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F52E6B0276; Tue, 22 May 2018 06:10:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2CC206B0279; Tue, 22 May 2018 06:10:00 -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 194666B027A; Tue, 22 May 2018 06:10:00 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f198.google.com (mail-qt0-f198.google.com [209.85.216.198]) by kanga.kvack.org (Postfix) with ESMTP id DE8896B0276 for ; Tue, 22 May 2018 06:09:59 -0400 (EDT) Received: by mail-qt0-f198.google.com with SMTP id n33-v6so17498909qte.23 for ; Tue, 22 May 2018 03:09:59 -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=5ox3ByQ6fbpe0Pg1I/MF5jOQuTUDdoxlIlC7LNI07p0=; b=XBLw2sQ7EbeKzQ7MAeAKxdF4yDSYBPeQakQm2D1fXxc/MKkhj2jVBzrg8+jBnmrI2h jHcjk3c06yH0Kh4ipNDlNeeaTlKipY4JVbr9rZx1f5WbCx1h/CbsSTURU3mCoyWyXO2W aQhZviKKaDNz6Tz3Xt7OgALj709g+iNqLqvZROHILMtdOoPAqBP/ikykKEr2PRDRCDT9 TGJLwW7tI4wSOP1VASQZsCgpkD9RSOQeyeeuLp6pTahwoOCP0nDKTLpsLvnCPjmlvNv0 IjFXg6+t2wopiqhuv6Mj2LczdG6DpoCN+hicqYGO5dqRs7GZ6cNQOjK8wRd2SSwwu7KD vj3g== X-Gm-Message-State: ALKqPwff7Xz/sBQ7LL+Wx3FpqGwkBvMFIag02KnLc/UoDOXvErmNuLn+ 2jLnnuYluCVQF5Uz969ViMka0fFgXq6eue4Ihm3qoJ5XrsKkz8Fbx2NUCBPsHzQEZ8Hr7Gjhw7m lMK91E2MzwjmjuID7aXswxxG274v3pXWZ4PkbEFwYnShHaK16nGdrlNBQ6A88dn2G1A== X-Received: by 2002:a0c:f6cb:: with SMTP id d11-v6mr21208816qvo.41.1526983799702; Tue, 22 May 2018 03:09:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqcJdTysZa4bKQdgh+M2Qsgq/ozIxiIqHdHZiJLipXFoydhIabrmW+5zRDDe1/2N6tjK+ZC X-Received: by 2002:a0c:f6cb:: with SMTP id d11-v6mr21208784qvo.41.1526983799119; Tue, 22 May 2018 03:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526983799; cv=none; d=google.com; s=arc-20160816; b=izd2v5uEZMLDGhAkoG4gJZ/xP4hgz0EBWPp6plAkfEA82lxs8zXgVmEgEVDVH4wwqU a8SqFF8aRwOxU1Qscjj3kvm9NBQb0kUyqfXm/sncO6bAekeW85DxlVwKwKWLkZ+1gEE5 iYBHsvYtkHGZYyKqkbYKHLJfjltye1MrziQZq2zZ2nCQ8GACPHYgd03RAAjtg/ndAln+ jH7DwSesIh3IaqPNIcg4pgMlkQwH7poy+CZ82QNZGAOED8A2QW/4tM3AdEyQvehkdnFl pHXSTApCKA/acNDDIjv7IJQ4aSaMpAkTpCYcj4anJpkPTrouxCKle5BFWj+AfNqEL+jj 7fYQ== 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=5ox3ByQ6fbpe0Pg1I/MF5jOQuTUDdoxlIlC7LNI07p0=; b=0azwR3PWIGfRqwUJ9J5L9/J2QuIe28dKVcoXfXMQ9c+Rw8WOYS/W184U7Q2GdvhODG VbW3vZz171V8G8J4OoqIGqCM4jRxNbPqq/B57bGelD3/kMrEucq9Xt4cozU4Srj2oObI Joeh8BBfyyudfkksyQ4AOhho7r35vXsAbF9ISEy8rDdnlNthvP3Zgx+liTgKCijETzui WqrI7BU6QPp4sJEi9jC6C/8HaY1+KVNcFUwbFSrhgXqKl5VVEQVyahgeXnR1cwzpQ+Sq KIzEMXTVBljpS7fYpTDNq9kPd3o37C078IchU7y+Xx2u2d0heSxTSyG9Tr5OS0XldQwK uXcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=JRvbpmBD; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.3.119 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30119.outbound.protection.outlook.com. [40.107.3.119]) by mx.google.com with ESMTPS id i1-v6si6567409qvf.174.2018.05.22.03.09.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 03:09:59 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.3.119 as permitted sender) client-ip=40.107.3.119; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=JRvbpmBD; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.3.119 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=5ox3ByQ6fbpe0Pg1I/MF5jOQuTUDdoxlIlC7LNI07p0=; b=JRvbpmBDF7kIgjGlvwMC1PJZuwWfw6xQjefgEpgseaaTyAFKgDA1f5lFvmjh+Ejd/wt6NDV82RTL3t8HECuNNcctcgKo0Gb0jRVG/J6GLVhrOnkfIgmw/vhklX8Pz/wYtBVESnOrilf4XDDXuefHoUKrUIcw80ieBuW1TkCvH70= Received: from localhost.localdomain (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.797.11; Tue, 22 May 2018 10:09:54 +0000 Subject: [PATCH v7 15/17] mm: Generalize shrink_slab() calls in shrink_node() From: Kirill Tkhai 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:09:53 +0300 Message-ID: <152698379298.3393.3040399931339145602.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 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM6PR0502CA0027.eurprd05.prod.outlook.com (2603:10a6:209:1::40) 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)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0801MB1332; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1332; 3:VdWHoSrNpHFEZR0tT5Ix5f/QJ9+U4ObtNy0yjIYn+mYoTM03h6C6PWvI/HYX7g+QP8z2rJmH/ZnaToE8Acr523lDeF81u/HXhJLK2LGRJwM5jWq76KauX3thoEro3WJ1N+vZWZhCYRwvlUo7mLrdkKe2rrzXDCWZhtj/T3pf6LqIZ73yXdaW69T09C0hV2m8/IpQL+twV5/QhPAEQZfMgBj47eeHnIZzL/qol+mN8fgxI0ljk+ZnfuYeI5inDTTg; 25:3Qc/9kfCo+wGJ/VQ9Sr55dvQf3FaMitXC3Ln4nxK13BmfQ7hdwv1WIcu/I29qz/KRb//XLEjeqieGN7dSQ/obdBqNpfMUlI0fMbrbKaulm3WURwU6pOa1YO9D8ltPNgk2nSmpnvrolDBmWH/AU+ba5Li5mIlSq+P3VkCHtpAiFlwbIpS1LA3KrXDrjus9MLJKbf5utbeAV93WRMHVc7U5wEcW6duGR2Y9/pnvWxLR4THxxSQPplGE7Z11l4hF3pF4vEJAjrgZIiuL5zLJL/YHBmVU693Eag80qSfZ+Tf1FZlAm5Z1pzQc0CpWoPH9u9hrbTgbEJA3Qe4pRI/m8fSIQ==; 31:CPuyL7gCgxxxQWzfE54S2ff20j8/wwiAj0dnZrS8Y+pjnC3yeRKSe8FcC3pnjwHQHnmi/x14cyyx6ayFmT9CmN1VgNpjDuoNJN8ToYt+YSxFRXK3JesDQUL8h56PrFBjzYzzNV4iW+5wlh1LltmFIQEoTiQwLe/MIIRB+cGCCYeN0ZLNJyvmm+3tAy0QH+gXgCwZYq6Q1CS7KYe9rN5fwMHP8ncH+ALvqtBPPz4gGOo= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1332: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1332; 20:Gdrq1/c4ZnzC+pgwRyZYyHFV0GI2nno52dOpxpf2CNJILT0V2wwVAVBog0Md4lF20dz+n25CQAD/oMX6keqZb2ecySpcqIIW5SXJ7vjPD2vHFtlVaG5ArtjqKXDI5Yl9H8iA7MOEAE2oTdqNo/mdT2osKlm7X4C3PbJsCBIEprtKk9xMorAH+GWs1NierjtSjU5XWRMJg0+iRfwtikhaQwiKUfgrJneZzGtY3tj/jHoJSmEDT+xMt75zwiMBNDHnpfCzklbMmo17V1suFrXV/tAw6Z3rTuF1ImM3OAZ3EHOE9QH903uZUYmviiiCQD+vYgcEmLggrPlazlX4RxLtdMRLjbY9NF8ncpPmSYYLm4n/eWnaRP2hTtrDnrs4zNyDbPyIZz9RsJrPKFnJTI27Mv4MBcqZNIxLQcdHnxgvXWTpXP9H+hZ7rzXXsllV9tE7t5WHHGa2uJW4LqR3WzkUZMjXBlbQOIrkHwvfvViWzg479fEbyjqZ58wNO0qC9Ncu; 4:1vaWDgnhVXxAF9e0ZbzvU1+OjEiKkFHW8U90d2hN8fQPV+nzqLmgykgGSyYe3wT52noPXFID4tLnzvhXsQNHpr6rhyC6qBnIsoibk+qi66XA34n4E5C3+HgOFsSdHEKTipvACCnroUTgdn8h0RVzfrFGjITtd+6ItUk6NsObso4jw4OlQ9+0VUeVZit4hfXB2FwXUlk4f9a+JRmGVMOwIG/6oipB1QM1yOYUuDTYx7xYAFdUYW8PCmjnNqR6TBL5TSdbZA6v477teR30NQCa0204OAfM4WNyri3UEAJFmbt/iOSUin2ltUnFpUHkqvI1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:AM5PR0801MB1332; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1332; X-Forefront-PRVS: 0680FADD48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39850400004)(366004)(376002)(396003)(346002)(39380400002)(199004)(189003)(2906002)(33896004)(55236004)(6506007)(386003)(52116002)(7696005)(59450400001)(2486003)(23676004)(305945005)(6636002)(7736002)(3846002)(6116002)(66066001)(47776003)(26005)(230700001)(103116003)(7416002)(186003)(61506002)(16526019)(50466002)(76176011)(956004)(476003)(486006)(11346002)(446003)(39060400002)(86362001)(53936002)(9686003)(5660300001)(55016002)(8676002)(8936002)(81166006)(81156014)(68736007)(58126008)(316002)(478600001)(106356001)(105586002)(25786009)(97736004)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1332; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjA4MDFNQjEzMzI7MjM6TFFTYXYwWFFqM016eFRVQ0NSTWJDQjF0?= =?utf-8?B?N0tZaDlBZTVvQkdaYTYwRkxnSE02ZExPZCs5bHcyeFhOTlZZYUN0TkRieXBq?= =?utf-8?B?RE44SXFhQkJjT2RGOUpZcEx4YkNPdkpYTGpxbFM0Yk5SMHZoMFhKOURvSnNW?= =?utf-8?B?c3Vxa3NnMXhwTUYwaWpGT0Qvck83UUR3MFl3UnZaTWFrSFlDL0thMHJzaHhW?= =?utf-8?B?TkVHWEJsTmc2UzVDZkFXQ04rTUFqS0F1cWFSb1Y4ZEVLRis3SWphSlRvMGtu?= =?utf-8?B?U0JLWWZnbFJvVzVVTGNIc2tRUWZhSGxna2xsb1dpQStuVkRNbERRblpIQzFC?= =?utf-8?B?Z2U0ei9XQ1krMUl4Z1Z4SmQ0NW1Sb3Jkd1pRUFgyY2ZUSGJDVHlMQ3BuV0dK?= =?utf-8?B?USttVGl1NzlRVkljdWp2bE5iVmVZWGVIRW13V3VHeXc5ZDNsVGxGa0RSdjFm?= =?utf-8?B?alNNbytSSVFNcUFlMDNOZFUxL25rS2p2SFgvODFvb0U3S0cvcTI2RkpqYitI?= =?utf-8?B?b2FMMHp0elNTeWdqSzlhZFl3Y1hpM3h4WnNzL25MZy95ek1aL2dtb2s0NVk5?= =?utf-8?B?dmwwUno1Um5tRit0ZTB2RWtTTGU2YnJuK3I5VTJSM29nTTNFc0xmUStIVVEv?= =?utf-8?B?VE5CSHkvcnRmN3ExVnBTdjV0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WCuVlrx4rwi/WFIxbcI4HPmgtJY0NuVw4ZhcMxEYm9JbQUmQ6RwEfTy0650gZSujXgDXQ8fE/IUrhVWtRTtUOCHozcNM4Uvmcu4ySLv9yvWtRVewS48B6ErIlWial0=; 24:xlnibw0giXenANBHZeSQzUxZ9gWzRTu8QXSbmOFCmuY2K/fZsoggCz1LAcbrTWT0bj9QIHPy417x0w10fFlDVaVHQ773dYtv/pNiLR75gXo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1332; 7:1oCmtbKMVsHNQRdk+u5YTiH0adD2qWl0aMtae1atY5BnmsiqqrOq7KLXrkTsp4PA9vPjVm8o9Od0Dzb+xvsA1Xvp5rwiPWYFBRaNZkAaZpcILLpC9dZcgPexhAaBEhs+ZL0c3M7m8L7QppGm+M3/m1fJJDSOK02Aoxhmg42MK2AZ1j3+fHvpjj8LAWEiY1Z+NHMzb+wcsmvkXiGp68TbosUJCeNsfFY4enfLZ+b9EfqQUpqq+amAHp57fk6jwmLK; 20:WCKuHI7PmNGisJsopF3AvYlsL8GUc56TdMB647kI9HWWA/SngCQVY9/vO1NxC3c3quhEzFCQpTKrCkEUGpfeyshr63srOfi26fT7yEP9G2RId08W8KMuMLbmKsFDvYsZ/8YyBz26xFuNVRRUdtK3SEHH1uN39KBuB1w87OTNXCA= X-MS-Office365-Filtering-Correlation-Id: 48d9509e-e574-4a68-a2fb-08d5bfcc2b26 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2018 10:09:54.8177 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48d9509e-e574-4a68-a2fb-08d5bfcc2b26 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1332 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: X-Virus-Scanned: ClamAV using ClamSMTP From: Vladimir Davydov The patch makes shrink_slab() be called for root_mem_cgroup in the same way as it's called for the rest of cgroups. This simplifies the logic and improves the readability. Signed-off-by: Vladimir Davydov ktkhai: Description written. Signed-off-by: Kirill Tkhai --- mm/vmscan.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index f26ca1e00efb..6dbc659db120 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -628,10 +628,8 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid, * @nid is passed along to shrinkers with SHRINKER_NUMA_AWARE set, * unaware shrinkers will receive a node id of 0 instead. * - * @memcg specifies the memory cgroup to target. If it is not NULL, - * only shrinkers with SHRINKER_MEMCG_AWARE set will be called to scan - * objects from the memory cgroup specified. Otherwise, only unaware - * shrinkers are called. + * @memcg specifies the memory cgroup to target. Unaware shrinkers + * are called only if it is the root cgroup. * * @priority is sc->priority, we take the number of objects and >> by priority * in order to get the scan target. @@ -645,7 +643,7 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct shrinker *shrinker; unsigned long freed = 0; - if (memcg && !mem_cgroup_is_root(memcg)) + if (!mem_cgroup_is_root(memcg)) return shrink_slab_memcg(gfp_mask, nid, memcg, priority); if (!down_read_trylock(&shrinker_rwsem)) @@ -658,9 +656,6 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, .memcg = memcg, }; - if (!!memcg != !!(shrinker->flags & SHRINKER_MEMCG_AWARE)) - continue; - if (!(shrinker->flags & SHRINKER_NUMA_AWARE)) sc.nid = 0; @@ -690,6 +685,7 @@ void drop_slab_node(int nid) struct mem_cgroup *memcg = NULL; freed = 0; + memcg = mem_cgroup_iter(NULL, NULL, NULL); do { freed += shrink_slab(GFP_KERNEL, nid, memcg, 0); } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL); @@ -2709,9 +2705,8 @@ static bool shrink_node(pg_data_t *pgdat, struct scan_control *sc) shrink_node_memcg(pgdat, memcg, sc, &lru_pages); node_lru_pages += lru_pages; - if (memcg) - shrink_slab(sc->gfp_mask, pgdat->node_id, - memcg, sc->priority); + shrink_slab(sc->gfp_mask, pgdat->node_id, + memcg, sc->priority); /* Record the group's reclaim efficiency */ vmpressure(sc->gfp_mask, memcg, false, @@ -2735,10 +2730,6 @@ static bool shrink_node(pg_data_t *pgdat, struct scan_control *sc) } } while ((memcg = mem_cgroup_iter(root, memcg, &reclaim))); - if (global_reclaim(sc)) - shrink_slab(sc->gfp_mask, pgdat->node_id, NULL, - sc->priority); - if (reclaim_state) { sc->nr_reclaimed += reclaim_state->reclaimed_slab; reclaim_state->reclaimed_slab = 0;