Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4250461imm; Fri, 18 May 2018 01:48:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqq2FnZS0dTQsKk+2QWNALeZVqbrQSvyGcHnDxaeGXlc0cSjjSdCN7/QZlYk2EHwSHKb8g9 X-Received: by 2002:a62:a315:: with SMTP id s21-v6mr8580169pfe.168.1526633335924; Fri, 18 May 2018 01:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526633335; cv=none; d=google.com; s=arc-20160816; b=ZeeibuzWgrfU4W/q9EVIw09UZcjY/RLH4tpWUaER8DKVz6fceKo8wdJtrhkhR6FLv2 s9hqij5LyT0EYsOG6a4IDxZxgcwurN+Hs++dY4Qq32B1xI/xBVUI+IUzNy5crvuYcbmE LW8mCbiQi72LDpZbfjvwxERBIRAuLbdQ4GOdav6Zr2DatlbaGfiygjatug3g2YBgwXaV r0zlJQYBztf06+fbgBWQA23EvWy6Uo4a96e9BtNn1d6gBHLF15Gnc1iheDeXdOw0IGS5 AJoRFhZ5uH8m4IyEPlYEl8QfEwdFWkaXeNv0Wu9Z/y3bpLq7egBJHIDGc9LO2ZdfEZvk aiow== 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:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject :dkim-signature:arc-authentication-results; bh=oW11i30zBrKa96sU5BVO6oG7fycJJIVLB7zRwT+/oyo=; b=LOX9LtgOKz+7KnfPavUeQ4P95QD2+MNrRTNX4/ixu5zvLJQDclcrcLitoaQ5s+SliT K4tDO4EMdpIo1uLTYkhSwDl33MhsMqNLnQEkuv+2tCQxZmOkK7yzF5sscPbL9s5zdpAC ec+VgpsXEdr8ryOjpPfuuFGAGbdxXoXgNJEsEXQh4pdk75V6BtjmVhlwWuomIDJPvx7/ 6AcImORT4D1VwR4XFcBkMu4u4aUq3kLHB/4Ud+JPLuQOKyG3dJmjcoGr5OMdLzU4bFy7 i86NYlpMTiioaMBxJNGxVff3ra58egpJmpNceYT9+rpyo+cnzpzvk7M5knyrmtrybdNo 8maA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=g452Jfh0; 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 c5-v6si6975556pll.449.2018.05.18.01.48.41; Fri, 18 May 2018 01:48: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=g452Jfh0; 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 S1753769AbeERImC (ORCPT + 99 others); Fri, 18 May 2018 04:42:02 -0400 Received: from mail-eopbgr50107.outbound.protection.outlook.com ([40.107.5.107]:2468 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753552AbeERIl4 (ORCPT ); Fri, 18 May 2018 04:41:56 -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:X-MS-Exchange-SenderADCheck; bh=oW11i30zBrKa96sU5BVO6oG7fycJJIVLB7zRwT+/oyo=; b=g452Jfh0UoXmJIjKzQxIq/3EMAX9zHW4duGwzMuWbt/DWqaHONuEokEcAij993H83AWB0SZuv300R1uvFs4+zjfQaFPB7jU9lSXFGnGl9s6t7zBH+ModMFVpiiDTYhIObDn1Us+W13KXRHG4/qwCKrbGLJaimP429ptU4qr74jQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (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.776.11; Fri, 18 May 2018 08:41:50 +0000 Subject: [PATCH v6 01/17] list_lru: Combine code under the same define 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: Fri, 18 May 2018 11:41:47 +0300 Message-ID: <152663290733.5308.16296237702670050699.stgit@localhost.localdomain> In-Reply-To: <152663268383.5308.8660992135988724014.stgit@localhost.localdomain> References: <152663268383.5308.8660992135988724014.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: HE1PR05CA0128.eurprd05.prod.outlook.com (2603:10a6:7:28::15) To VI1PR0801MB1344.eurprd08.prod.outlook.com (2603:10a6:800:3b::8) 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:VI1PR0801MB1344; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1344;3:V4EF+s4z18HRiq9syr54QRXGP1QNk1VCBIaHqCFEdZ0zoz1IkFQGTmpqSpEe26Ry9sL14xWQyujHNjQTpzcKmSWswiEyYJrScRsvVglSyoZu0dNjrYwQH2IimKabEIp86NAvsNPw4m/u/e/RlM3QGjk2Z1UWcJe9VD6fLiHLg37ZlukM4fqnjdAti/mqJ5AZqeLbsXwrGBHVxDve3oy4sIkWZcYTZJ7YqDAFGrDdTVOiCyG4+nM7mdFOSrJVfHtQ;25:eZKyv/VYQwaAwhtQW/PLD59ndSBNIJKhQ8Pnb2j6ChUp9LoI8oXCDCdqwiHtrz+Cva3Fe1hDvL4lC527LBwxK2R3+cwm44DpAXCkFotRcwRqivodtM8J+7w+lCbB5lF58qpqSzk9UEpBEh6KQ/9CJkgLie39wbL32lxZaeaaZah7IH1Js8AT7G9QY9ypywG2QQgw0kfa5qH42Z+1WJ9CxINWuADm9bCzzV43ppkNY0rUNH8MELxFo6zzejVrFPZ4zo3R2HRHtfbOPUdb+RpQve4EbNdvn2VoPfviF8fdJdM7AWlnzhI9UsYlm3zOXHHwF8SFiS6nAjd+0kXEFpg7Dg==;31:ihoOViVt68JNvKgTg3CpWeF7BcY6mg0k0tRc1+72gByv+LDjBobnjxUJW4qxr9Nj4Op7D0sfic051nAgBH3qrv2u7D8lIz92ov9+IrrXf17p/FpD9kpVv8AVQxtRogfVmpignOwNh23RoohN8CjzmvAX9IM8CcUenJsaOYvUXkJ96gjhOdNIsVEW0TC1q7vSvVRzFnYJPhWPMwjqjXXMvIHyLELUgom3b8t9mn2AMDI= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1344: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1344;20:WGH+n7t9/pHsU9QMnfokkV0/3mRm4XmGLSMxy0hpf2Dcazx8ohiH+zzpJU+OY3k5ClUlor08sEZp3ACmH+6+Hlgg+XnlcmVw0IWznP+6vO1TFusi5sIbc4KPjAG4rONppezS+nOPCYGJ/FboCgy5o0qE3EiKgUuRNdBDFOGddR3AbcZPXSv6/c3Kmwe072yaDCMoUkDZls5gdiQpw5/TRXKUjLpUOr7osqvqaMGZr2LrtJPK/JpIOUA1xx0Arvgad5J+wieSEInmwSG0bfpNSr2+HdzdBau+71/W/3otH0UX94fGcSki/vQcYSSffwsLro+0nDkIA4W2Uq1ShU6ErelQfAdsX0PTS4GZaMpHU3E6JDPyaLxIZzCeMTSk3cNQRmCY/DSOWbnBDSzCS2zyHZripnHvGB0ffewg+732dLzMmsLBIm2ymclVgZk+LM6oFspl9+0p4UGjQyv/HrFXoubX4FMrLM3tCwdZtu/RwgjRTQgVA4mL3TD8mjLXfmdE;4:fbu1gTfj1mG6sI/rTQvW6g1ycPyLxRM92bfHILXWHxAYkh5ttDxgoh4FpCNMxKh+1G42A+5NB3VHPXVH2lz91sxPKGQ3BUB+7KfIXfWy2KBu9+Jut6+aiEIPF/F8dTdq2d89ERm/CP27uSLwDYEZtMZDMG1hBTGzUn2hClZ6Ct9cB6Zj02AAnKvjqNiHUFZ4JLJl6YNvslWi67KWLe+p6WpaXyK7btqUEMYqFDMYlYPrGkoik9WT+AWvthBvkyjNhH8k7fnwvkZquJOLEtBUJQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:VI1PR0801MB1344;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1344; X-Forefront-PRVS: 0676F530A9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(376002)(366004)(346002)(396003)(39850400004)(39380400002)(189003)(199004)(6636002)(3846002)(6116002)(9686003)(6666003)(97736004)(58126008)(53936002)(8676002)(446003)(486006)(81166006)(81156014)(476003)(47776003)(66066001)(956004)(230700001)(86362001)(8936002)(11346002)(55016002)(478600001)(103116003)(50466002)(26005)(25786009)(68736007)(316002)(2486003)(7696005)(23676004)(7736002)(39060400002)(52116002)(305945005)(105586002)(55236004)(106356001)(5660300001)(7416002)(6506007)(16526019)(186003)(61506002)(2906002)(33896004)(76176011)(386003)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB1344;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?MTtWSTFQUjA4MDFNQjEzNDQ7MjM6d3RoS1J4RDdVclJsSW5lK0hyU0NiWWtN?= =?utf-8?B?UlhZTWNBNVp1MUZ2K2trM0xualRaZTBQdUpmNzRPS1FNaWFIVzRreHFGYlZN?= =?utf-8?B?bjdIcFhMU25VRVNiOHVYUXBTZkpFSnQ3VlE2TWpOazVVVVE1bW8wSGFNNUpp?= =?utf-8?B?OFI5bjhHcXl4R21vNnBDelFIcjlSM3ZkcTd5WkFqeHphR3hWYi9vMXJEeFZH?= =?utf-8?B?YXU1MDZsem1qWmRjMlB5MUk5ZGFKaFdKQWsxZE1nbnZiZHJQamloY3FLVDJa?= =?utf-8?B?UDU3WEYyUklJQSt0RUJSby81MTZNSElxdkxiakZOR2xYVzBuZk5XY1g0MVBF?= =?utf-8?B?eFJteGRUbmt2RERlK3JmUWZVaDJTY3ZjaFM4dy9JUFhNL3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4JhELXeP/clBFQko= X-MS-Office365-Filtering-Correlation-Id: 4a817e13-4f4d-43b4-5096-08d5bc9b3434 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2018 08:41:50.5370 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a817e13-4f4d-43b4-5096-08d5bc9b3434 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 These two pairs of blocks of code are under the same #ifdef #else #endif. Signed-off-by: Kirill Tkhai --- mm/list_lru.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index d9c84c5bda1d..37d712924e56 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -30,17 +30,7 @@ static void list_lru_unregister(struct list_lru *lru) list_del(&lru->list); mutex_unlock(&list_lrus_mutex); } -#else -static void list_lru_register(struct list_lru *lru) -{ -} - -static void list_lru_unregister(struct list_lru *lru) -{ -} -#endif /* CONFIG_MEMCG && !CONFIG_SLOB */ -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) static inline bool list_lru_memcg_aware(struct list_lru *lru) { /* @@ -90,6 +80,14 @@ list_lru_from_kmem(struct list_lru_node *nlru, void *ptr) return list_lru_from_memcg_idx(nlru, memcg_cache_id(memcg)); } #else +static void list_lru_register(struct list_lru *lru) +{ +} + +static void list_lru_unregister(struct list_lru *lru) +{ +} + static inline bool list_lru_memcg_aware(struct list_lru *lru) { return false;