From patchwork Thu Aug 2 00:31:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10553147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F1CC13B4 for ; Thu, 2 Aug 2018 00:32:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FBB628826 for ; Thu, 2 Aug 2018 00:32:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13DE129A6F; Thu, 2 Aug 2018 00:32:49 +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 6314328826 for ; Thu, 2 Aug 2018 00:32:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 17CB76B000A; Wed, 1 Aug 2018 20:32:45 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 12F8A6B000C; Wed, 1 Aug 2018 20:32:45 -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 EC4A96B000E; Wed, 1 Aug 2018 20:32:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by kanga.kvack.org (Postfix) with ESMTP id 74B216B000A for ; Wed, 1 Aug 2018 20:32:44 -0400 (EDT) Received: by mail-lj1-f200.google.com with SMTP id p8-v6so92315ljg.10 for ; Wed, 01 Aug 2018 17:32:44 -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:dkim-signature:from:to:cc:subject :date:message-id:in-reply-to:references:mime-version :spamdiagnosticoutput:spamdiagnosticmetadata; bh=arGdBWfo+OeE2DLlb78edCGjzCW3AhGuBJnoonsOX2A=; b=hRl/x0zN/DshONyACmKlM1pXULPesAtCUpYmAGHSuLLYUH/cM9EB7hQ2olOHXmL6gu I+mgVGjBvrHCt3mMr2loXUjz2WiE+l332S0sTB7KcR1OQB228NZHmocAV25U550zAeUg zXedwY14BY6e3fX2y2a44y67nAMGhiHKtpaY5lTMfCFlXnrMDESQFsaScas1jc4TuyS8 GUcy1vRfMI03JFqTJW24lykTZz4RIzR3tn7+FMOXLouL/P64EYEf9YLMJMaV5FLwAoqm LWU1Njs0n/RfzphEDKfIqWSzLZT2T0YbmtNcr10wuo4pDySKYNN83E1MUzXRNy/Ee7kO bETg== X-Gm-Message-State: AOUpUlHpa1sHwGlKKCUd0S+rUOXChC5X+b87wjJL8X+xF7bKnaWHTmFY UASloIHQ9dPEvsVAgOkCnhUVz/g8Hs20vGfzP66AAh+6H2zUXECrea5dO/lOW8WxeJR/ZFpQ1Oc g6cxDVzs7l79qrvrTJwxDytNupdPia1lcXNe2k5Jbf/ZyzgkqRd8nZfqKeUYjzORkkQ== X-Received: by 2002:a2e:9a95:: with SMTP id p21-v6mr342208lji.60.1533169963807; Wed, 01 Aug 2018 17:32:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpexnb7MvXkFn+37HIKR+oPJ2aXZdaCmnE0KS49WpzS9YlgjdZsryhLCtJmOfqfTJaR2KtVF X-Received: by 2002:a2e:9a95:: with SMTP id p21-v6mr342186lji.60.1533169963103; Wed, 01 Aug 2018 17:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533169963; cv=none; d=google.com; s=arc-20160816; b=EXL6bw20fDu5h+ejlAV4C/T70MgQRHO6gfS7u9soqXdsye7uBxaFxtbqSNEQNNgONT xZPx55ESsKTRcuaEvvB8NWuVH4no66YFpVwtxtlXM5i1s9IU+Rbd5FrPsQnZ+UREUYcN qg/w7Eygivqr8pShmkLxvpbAPuj0EY66YWhhCBMJPcPpLcMD+iyHJIV76uQg1NJJmONg v9OWat0QSLpNJR+izT5zxpD0nUIWc5pNzZm62VdMOKGSztNnpieC3WOn+dN/UCEzhDTf JyYSQZYjCCjh28yLiiTXFDFf0uvA2x8V/NI5QvnJdjE4vEuqLk6tciuh4MGDjZE72uUc I4YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature:arc-authentication-results; bh=arGdBWfo+OeE2DLlb78edCGjzCW3AhGuBJnoonsOX2A=; b=kCvBJAKuWZl7lm+x5K4mXUCL+XT/WBOiKRGtBPfmSAhFWZqmOBtjDRnxkmZoe+I5yN BY0NxQ6OlZyU+wo/Wr6VyybdLwpyFy2dkNU2UuN6FrsJEJiBfEYYnFnrlu4JNvTp7qGb HL+R9u11hsj6+S/LEDj8dsLSUP0WPs2Xm2vgOGJGb8kZCr74UQrFsen//NWalNSZF6lJ sntz1VAR2pWjSvsZttgT7mcUt1YmaGyDgDN5RiQr2AQBac8InaoYl+jkWMv+81iGTR8v dBCLoEeRCHRqlmwiz6S/tO7dP40PMi/D3tiFhEJ0qcPE030FkHD1WQdDPXJAYF6YZiUy Oe3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=lQlIHJQI; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=G03L2VbH; spf=pass (google.com: domain of prvs=17527a5e5a=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom="prvs=17527a5e5a=guro@fb.com"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com. [67.231.153.30]) by mx.google.com with ESMTPS id 13-v6si155955lfz.188.2018.08.01.17.32.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 17:32:43 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=17527a5e5a=guro@fb.com designates 67.231.153.30 as permitted sender) client-ip=67.231.153.30; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=lQlIHJQI; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=G03L2VbH; spf=pass (google.com: domain of prvs=17527a5e5a=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom="prvs=17527a5e5a=guro@fb.com"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w720WQtq007291; Wed, 1 Aug 2018 17:32:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=arGdBWfo+OeE2DLlb78edCGjzCW3AhGuBJnoonsOX2A=; b=lQlIHJQIgAFNDS1qsWiwMUB9Q0lH3+7767qIRXmCKP7lbGrrdDSmGH2n12DL0GUXgo9M 1NjV/zqPRvcrXmMercBUBZUXYdTfq5aFwfjhImjnnuPC3map8BOsYLLY0NcQ+MtWgyPv jV4TkNp7cfaSSQHjOxA0KVB8vhD/7VK0owI= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0b-00082601.pphosted.com with ESMTP id 2kkfcvhh45-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 01 Aug 2018 17:32:29 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.27) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 1 Aug 2018 20:32:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=arGdBWfo+OeE2DLlb78edCGjzCW3AhGuBJnoonsOX2A=; b=G03L2VbH/6Wa0LhtvWt5L2W9cxLz8LQXLUxSDrk81fX2f75cAEpfvjHynGXqFok/Niogse4OrUkTTLYr3lWKdXnHtMrvHZ8UC05ldLnk5ts46Krypufusg/7tD2XBGgZh05zqCcmgC8jZL0DO4L8RztsUlrXQfQyHTcDtaml0D0= Received: from castle.thefacebook.com (2620:10d:c090:200::5:2fa7) by BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Thu, 2 Aug 2018 00:32:19 +0000 From: Roman Gushchin To: CC: Michal Hocko , Johannes Weiner , David Rientjes , Tetsuo Handa , Tejun Heo , , , Roman Gushchin , Andrew Morton , Stephen Rothwell Subject: [PATCH v2 1/3] mm: introduce mem_cgroup_put() helper Date: Wed, 1 Aug 2018 17:31:59 -0700 Message-ID: <20180802003201.817-2-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180802003201.817-1-guro@fb.com> References: <20180802003201.817-1-guro@fb.com> MIME-Version: 1.0 X-Originating-IP: [2620:10d:c090:200::5:2fa7] X-ClientProxiedBy: MWHPR13CA0006.namprd13.prod.outlook.com (2603:10b6:300:16::16) To BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbd51d0a-ebf6-4290-cdec-08d5f80f689d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0167; X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0167;3:NMiuizapGXlDHbhmLDZdNG86ba6h95VQ/6JDejBBGb4KxRFGic75E7jJW7r5VZBnXqLLCk2sC74H79XCuP3v69xG/DXIrakRg4ULlEMNgZO54cgXMSX05M+zWHFfuUUmH/5ngJHwvPprFtwHQxwjZUI1ftBXZqfyMev/53Pptoy1gq+4h5huEieIGnBqgd94EETdIdXF7vYScB4mpvvkEfn7aP0JQwh18nXZs+vk+NPr8J1/phedhgGG6PjTDatn;25:OpUe2DwTS3YwgYhg9wyEX88UYIhsbDEUpWwdd66Ml9vvu/+ZnuWRxYvsHkX7LBUK6dbYidKnI5OziW2R4cTdCjSMIoVUiWlHp3iZOBJ4oPPRxk3ds6423G5rW6p/QCAeDP15wP26IAuLuE9DXt4UsPjvjLR21IABUDkb75TXD19U/UTrUNGWAL5ojNYSCjGK/R/+Bi1dlBiKf82frIf1reJ0x1qz808n74pHzw3yMiiQFqukI4OyEHT56Euqz15UPJiCkkMdip9A1sFO+YueLs/YF8hIEQjbGsmQPwtdKfYJIlIN4Jk76OXuCU4WbLNBF9x1Kwu0ETBtduGtFKs21g==;31:6H0xx1Px985gQ8S7RJuX57/IQX/0Vnwl7K5FfrlEe6xTNWJM0ViaVXnLCKbMERI1VFi2L9bRSx5SrqFTyuJZfYcqRPiPgfnpyakwC1h3j+WWaZvddWk+AZpXV3k8KEYD2088JxD5A2PwQ/hv3SVVEdhzlyUsHFM4uG7AqIQ2W8afeLlat3K82nKqY093iR8MxIHPpol2Fdn8/7eP/KEwN4pu4AdMRKNValy8M6RL+K4= X-MS-TrafficTypeDiagnostic: BY2PR15MB0167: X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0167;20:fhDT+8tnGacn0QhMFv7H5tBMjmdX1++mMBevidXghc2a0/yg47LV8gBDsXF8pqz5tssTChPoQSLPLOCxTtqWBvl3yfNOMFHZLa7EHOrUGyotXu3fCjnhGHCkeqGjPJOiP1TNHwVgQEInQfOPwzPfb4Y4+cywpwKiPgqR3c8ScdaY0PcNQKIH2QGutZeXcILMpVdkVFYjBaZfzTahkLxJNYVIwPruMxJKodSpGc7vTjvdV+yGcf0zKTHZetQcBVYNa11BUDKGhJwg1QBI46gdeZEjt79n2nWzcyRq36Qm03H7ErjSnfDJ1HNvY1cgD8tcDLqrWQsOPSXr+jkqa0nTCKVaZhz2Rev1X1k4xune7XqYA+39nR+M21f9dS20NIyQDNfg0xVbcfXeAgcJYmOU3jfcSDGkT2bDhR1nJhdDCljkhj1RaBxYbic8DJYWC3vti2zUb7xoAn4CGMSN7OPjhcypxYKaJwcbUF6SDn6aAFuGZplaGX+h+6xtFrQymtpd;4:9RGpASvPzbKYiiX22zEYu5KAEQdkSn7PnDehWS5vDsO86+rcTYoqMRpIS4r7xaHnfY4uZQ4oJoAqRBdGwXJwZRqiOtzB/AAKL0ebYuDeoYGEk+ApC8VDELlV70pFA4Sq+xvYYUlDN05EPL5bgttGsi+MDEAsKMmaSPggG9ZhHO9pqhqK1p2RZS7pdnYrYk7DNrx6YkBG5vJqxNRvjHdcOvqanGo/g83dIKuse6EgvRzFuNVBGNVKB+WxJZuRlx8xzOBgVKWaX3t/Lq5a54yyhclYSnDVi54Iljm9PVIdiWcQ61R+WVxM5lQ2Jb953d5ktM6/8iM04b8CkDjKvlSgXIsq6f2b2y4dtOb+JhJC7eSXi8StjhBYR4veJxa5hbWjDy37BO4mq2lLawUEYngu5Ao4AM1ECN1Vvbq0p9 Lcd6s= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(211936372134217)(42068640409301)(153496737603132); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(11241501184)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:BY2PR15MB0167;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0167; X-Forefront-PRVS: 07521929C1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(376002)(346002)(136003)(396003)(189003)(199004)(25786009)(52116002)(54906003)(36756003)(68736007)(16586007)(50226002)(316002)(6306002)(53936002)(51416003)(76176011)(6486002)(6512007)(50466002)(52396003)(966005)(5660300001)(6506007)(386003)(4326008)(16526019)(478600001)(2361001)(186003)(6916009)(1076002)(305945005)(8676002)(476003)(6116002)(11346002)(486006)(2351001)(6666003)(7736002)(97736004)(8936002)(48376002)(446003)(2906002)(53416004)(86362001)(46003)(47776003)(69596002)(106356001)(81156014)(81166006)(2616005)(105586002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0167;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0167;23:MTj7RsKvi4oilZN69o4ONv4jVKjLmTC1NSF0GhoezPx0PUjesaX57O4h659zHRXkx4FQk0Vep/fb+32pjiH+V4dOuguKpPdD17oynpJRelCZvPolOuofgj6514j8M8QXu/gw3Nk+h2BPuGiwIoBU0AzRxyD9t4xrZAer6M35SfWg1OiubMDVVNLZDtFpYcZeJq1OBah4ZVDuVNThQS+15uJERWj+vc8f3cxIv9oAq6BG9ZGH1fBTfzxHAz8udmGqwkiZtR5A/fK6FmH8jHX4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r16LT7t7959DleqZnVmUtEU3d7j6iGuk/c6MhpqKM3OI5hvo2VPzdNODDVXh5g4zKQABJBFpDTm8rwoEft5NvCEvYlwMc8eYSyNiWxiCz5qPjiblIyX2nkSEtAepbcJqJhd0TVKn5xGrL0F0vWi8YM+Zen3jO+Rytr6kOPr4vOtJd1T+hTGU7I/HjlZhNgaGfxykA40sU+AGM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0167;20:OgQxfKDkKUSLj6e7wiySGGK74RDy6Iu6AGeTq4CWsO0X3GjhreBgfGNnyWRnUbNHVlu7wqnTp5/JVLuoJW83yDPxd443DpiGJbX37jVxdW6L6YC1KIjpSx4YJB2u21v6gYUcrjhOGkjJtNX9oLYIvag3hUQI2V8vNgSDKEIehNs= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 00:32:19.5212 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbd51d0a-ebf6-4290-cdec-08d5f80f689d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0167 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-01_09:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe 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 Introduce the mem_cgroup_put() helper, which helps to eliminate guarding memcg css release with "#ifdef CONFIG_MEMCG" in multiple places. Link: http://lkml.kernel.org/r/20180623000600.5818-2-guro@fb.com Signed-off-by: Roman Gushchin Reviewed-by: Shakeel Butt Reviewed-by: Andrew Morton Acked-by: Johannes Weiner Acked-by: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell Acked-by: David Rientjes --- include/linux/memcontrol.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 6c6fb116e925..e53e00cdbe3f 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -375,6 +375,11 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css){ return css ? container_of(css, struct mem_cgroup, css) : NULL; } +static inline void mem_cgroup_put(struct mem_cgroup *memcg) +{ + css_put(&memcg->css); +} + #define mem_cgroup_from_counter(counter, member) \ container_of(counter, struct mem_cgroup, member) @@ -837,6 +842,10 @@ static inline bool task_in_mem_cgroup(struct task_struct *task, return true; } +static inline void mem_cgroup_put(struct mem_cgroup *memcg) +{ +} + static inline struct mem_cgroup * mem_cgroup_iter(struct mem_cgroup *root, struct mem_cgroup *prev,