Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1429617imm; Fri, 22 Jun 2018 17:07:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJe2GifvWyIh479IyrmqgbahsDQx/gG0dErGZD8KP/t1li1O8luTDyZATLHh7s8wbEVMZEK X-Received: by 2002:a65:6186:: with SMTP id c6-v6mr3094985pgv.360.1529712459214; Fri, 22 Jun 2018 17:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529712459; cv=none; d=google.com; s=arc-20160816; b=sMJyE3eDriUUYBdSmCK1L2Pb6JdOf5BFIaItxh/D6EQ/n7eXGHrR4w4XX4Oa4CySjM YFvz3TTugmcGePAHchOqG3lDMdPMn4TUMhjy1bncj5nSHo6pe6FeuJUBO2lYLF0aXS1y LsDoLLTEnmmCGGhFUpXurLPx08Gi5i+LOGYzPwUrQs3tBagNNCl7NzP7AhWpCHoSzz9j Ajx/iKBMqFPNNMtyyevEZCGeLkdI4xkh4wXPK11KRsvuzHlRM4FzSyR3n2RPC8Ve5P0V iSKCgQPzP30Qgg5DcmY1BDMU3wjtQc1Y3pMIcHGPHCP4HGFS8NnZ2em4SruoZzKgT6Lq OFfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=MWZxNmun151cjq/FkqsdWNDH49tV+VdYLY8U5dMeAs8=; b=eqSJP2MwuF0Itbrusmt+wgrV5y3RDoCmRb/nnZlOnhXPlkxRr8hQ2dYM3BGDuMVqEv VI5VBU5AUvHWmsC0PZGFuiAb9df+KZKZCWiYm4+LJQ8DYygh1QPny95uMCuQTA++oGA6 vi/XRbAo4E6OIxHJLuGnZtHNCXsSXs4lZgqsws74XUke7Pa6keaoeR/3fviqqn1/Zxt/ Us48AEAsVIpJAgXl5WgebJitCkQVGHSoVzPFstLkkQaNEVO5hjcptwC0hI5BnGDQ/KIM FPyVSzwMGAQuc2k1oQn9tahtLotR5fG0/Wr27oyWZxP99/CxF7/bpOWE7eSvmoLSw7pI wDFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=mqEAahs9; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Gw4lPLqF; 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=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i62-v6si8632317pfc.255.2018.06.22.17.07.24; Fri, 22 Jun 2018 17:07:39 -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=@fb.com header.s=facebook header.b=mqEAahs9; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Gw4lPLqF; 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=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934393AbeFWAGm (ORCPT + 99 others); Fri, 22 Jun 2018 20:06:42 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:35072 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933987AbeFWAGi (ORCPT ); Fri, 22 Jun 2018 20:06:38 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5MNxRG8015066; Fri, 22 Jun 2018 17:06:27 -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=MWZxNmun151cjq/FkqsdWNDH49tV+VdYLY8U5dMeAs8=; b=mqEAahs98hJJDUAtFK7Ka4tr2l3sUdz/IVaDt4uew+ghuClxuEd0n4dDmLyn1gnXhpHE lyqI1+73BW0vGdyAmbvVFR9g/vG0kkzr7mV52w3FbPAtDqGndFq3sk1bLJN1FtHcQKw1 xeH2FLeGWr9mMkI7H0dUnSGL+u8CFmkIy6k= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2jsb1a01ax-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 22 Jun 2018 17:06:27 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.33) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 22 Jun 2018 20:06:25 -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=MWZxNmun151cjq/FkqsdWNDH49tV+VdYLY8U5dMeAs8=; b=Gw4lPLqFs9/6Iq55NikQEr1uMdP018zEun0TwY8oU/yEvHOLAFUaMkjYXTQDLUZ7hP6uMvofj9JpEqNmiz0R1VJao0g7kOeZL1y5cdD53u13lruo1n9aLTYnqwLdbPNgytISQNZYaoj27Q5brzCd6YeMwhV4+BzBZWa1olprNCE= Received: from castle.thefacebook.com (2620:10d:c090:200::4:d066) by BL2PR15MB1076.namprd15.prod.outlook.com (2603:10b6:201:17::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.21; Sat, 23 Jun 2018 00:06:22 +0000 From: Roman Gushchin To: CC: , , , , , Roman Gushchin Subject: [PATCH 2/2] mm: introduce mem_cgroup_put() helper Date: Fri, 22 Jun 2018 17:06:00 -0700 Message-ID: <20180623000600.5818-2-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180623000600.5818-1-guro@fb.com> References: <20180623000600.5818-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::4:d066] X-ClientProxiedBy: MWHPR1701CA0021.namprd17.prod.outlook.com (2603:10b6:301:14::31) To BL2PR15MB1076.namprd15.prod.outlook.com (2603:10b6:201:17::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8461d43a-42e8-4858-d836-08d5d89d2816 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:BL2PR15MB1076; X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1076;3:PJLNA79PHx7h0T/UPmadzi1BXW9l91jAPSwgxgnYkq4IowNzArkQAF558BI6chapq59ysyDnxGy2CthUVMILgVFlQ7Fl3QW2pgFqrgijZ9HpaYqlDNgMWdwJW66ATER/0aE0QD25ALsmG1f2MuoXGmizoTufNue3LD/Kb07OjIQwMkvv4JKWbTw5gIQ8vMddFC3ArmDI5DTxeDA2jHpkCOZ8LcKS5BhrTJtL6sNuL8LX37YcCd2n9h2UzYxVv+jz;25:9ii/5a1vKgdjG7CVY0ngprgU98wUZAm04lOfjqvKOjdmq8qxbIHF80Xr3m1NF7K5cuzltxh2QqwqHfIdq+CAsmEMo+how06FIOhmmbr5GoyAX8SHOfhLL2hLe3alVObDBtFqYuLsMSlEXHExFg1Wc/nf/iC90qg/RBIWxn+LUxvntt9QbvpBrgUTMnpk6LAcVxnPATEa95TaN+d0V4g0MKA26iHjT50Vi1Bob87IVlqKOGdXzx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DXgijC7DxrWeeoj5ihNoU5iq800CfLAKMC0oVHyUMbyIiZlh37CgiiPzn8/A6lkO1qx0FMniXIQQUVuHeWMfL8mR1Hl9zPZhwuwnMl2qCLKc/sUV25CKat04UlxoK+/nDhm+HoTaQMpUve7iwGJZGC/4hA3fXIELr639+dhVJntMXRYHJFrAToxNE85BtC2WXlhgenu+wU8mJhhyjUENCp81l/vcPfJVGSLhPbKd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(211936372134217)(153496737603132); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231254)(11241501184)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:BL2PR15MB1076;BCL:0;PCL:0;RULEID:;SRVR:BL2PR15MB1076; X-Forefront-PRVS: 07126E493C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(39380400002)(366004)(396003)(376002)(199004)(189003)(8676002)(50226002)(446003)(316002)(6486002)(86362001)(2361001)(76176011)(69596002)(81156014)(48376002)(11346002)(81166006)(8936002)(4326008)(186003)(53936002)(16526019)(47776003)(25786009)(50466002)(52116002)(106356001)(6506007)(16586007)(7736002)(51416003)(386003)(52396003)(2616005)(305945005)(6916009)(5660300001)(6116002)(2906002)(1076002)(105586002)(2351001)(6666003)(68736007)(53416004)(36756003)(476003)(486006)(46003)(97736004)(6512007)(478600001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR15MB1076;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-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vkv3lWJazw3dBW?= =?us-ascii?Q?5WGrDk5I5WefxuHnXfpa6ei1zxBVbdJ2JOUGhjFjJ0P+RN2Noz6gFwOjdn31?= =?us-ascii?Q?907IGLVRIyIozBVy/pLlwM9WYYbWeSKUroXWOYMxJ6+I0ETZ1F4fYTfsPLK/?= =?us-ascii?Q?teUZCEpzQJQdufK4eZAyIvECqZZbyuFZj3w3XUjJFhhVlBO/3Mu8rit3ji/R?= =?us-ascii?Q?7YCN4qd2Gjw9N+ugA/eStmHAa8taNuj79LqXq+O1EJnxhe7tPST2nMlUSY9w?= =?us-ascii?Q?nlF+MnA58NLCTGG4U0AEDR55HwWAFrk9upZ9OM9X13tQe0RYL1Loyr2b1jKu?= =?us-ascii?Q?Jo/lnCL7S+su9hKaq8XmE08Hr/7K0+ijafEP7XQADsuLluAKEIw3ScxKs0PB?= =?us-ascii?Q?X079jRshS5yD/lMocMvlb1euFVB98p8PsDOI2iA?= X-Microsoft-Antispam-Message-Info: g+5/g4nLYjCPbQOgbli8qaV81X8uzXJD9/sA8LMW8qxjNPkT/3UExIyMGWOZ2+guQU4CJlwaQr7laxgJVqFWitjmB4Br7W7+KZALVxgg6zsKojQzsfYehpg+57W02nOvX5yIEiDeyzKqcWzUQbVjM0pDyH2uw/i6OmQhY+hjxF2POrwzd4oH8oaSWmjbC1muk++UMXp8PDEENfY9TXuSjnexbYLwRki0U8g4+xmNunDdjzK00BYqfW6cZe14Hdey6XG3o5QUmjRoBNy/gb1VURTyw0iFfYsCChdD7UfW0Da175lXn7A7wqBD/l80JLAbMrLxkXH8LAiInZBIoFlzlM0YHEcwU6w5+VMwOzbWd+c= X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1076;6:hedtA6ViSYGAvmxYIMRyKX6ai73iCNi4ssPpfQlDoK5vRIzjJf5h2UJ6EViOC4SyBf0HAb1cNgNA47s/GSMSgkkFa3hPsqCGWFA2HEtXLCOoBn/Z4JdIwP89AtLBdxM0IGhf78sdAzuDhoR2i3ydU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FOYcegFJ4G4z1lN/YNNG/RngsGso= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2018 00:06:22.5593 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8461d43a-42e8-4858-d836-08d5d89d2816 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR15MB1076 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-22_03:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce the mem_cgroup_put() helper, which helps to eliminate guarding memcg css release with "#ifdef CONFIG_MEMCG" in multiple places. Signed-off-by: Roman Gushchin Cc: Shakeel Butt Cc: Johannes Weiner Cc: Michal Hocko Cc: Andrew Morton --- include/linux/memcontrol.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index cf1c3555328f..3607913032be 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -383,6 +383,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) @@ -852,6 +857,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, -- 2.14.4