From patchwork Mon Jul 30 18:00:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10549555 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 D46E414E2 for ; Mon, 30 Jul 2018 18:04:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A9FB28A68 for ; Mon, 30 Jul 2018 18:04:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06A9129451; Mon, 30 Jul 2018 18:04:24 +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 A94E42A81A for ; Mon, 30 Jul 2018 18:02:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C98C6B026D; Mon, 30 Jul 2018 14:02:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 679386B026E; Mon, 30 Jul 2018 14:02:27 -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 4CA9E6B026F; Mon, 30 Jul 2018 14:02:27 -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 B9BCF6B026D for ; Mon, 30 Jul 2018 14:02:26 -0400 (EDT) Received: by mail-qt0-f198.google.com with SMTP id k21-v6so10902508qtj.23 for ; Mon, 30 Jul 2018 11:02:26 -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=scuHpibUn0Le6Cs82Dm7fG+4MYqegz3zxv5qDEXXdWM=; b=FSdIjGUmCjg0XA9Sb9hmjfHhSgTL3iY/5XQjPiPYrfNoHnDB3e0z3B84pBfwjqNaG4 XnQYNnhguS41A1e5VKRPVZmOLAnUmdqJuluur+EarnENLuCEaIchJmhLj6BjwLiOfaBJ gYp1x6cgNMPokWopxGSW+zd2XMp+mp88cnDcWZwJcEPiJKEDwsumXSmB4veYBPCIvasC jJREsjpHsh5oAr7btnsQIYj7pdxAwsIpne2/zh3rSxNUYus+0+iD6HzT5jcx+mehyZEg I+ICMFEdZBli1yysk705GAhI73QCK8QJxFBDzSSwwif4efrlzpQoDRq0Lye8C/zss3N+ 55MA== X-Gm-Message-State: AOUpUlFI+Fi4SdwgfXQLFDnEEc9eL90eiQQ8u/FeGGCKAXM3CALWL2IE jMcTNRiC1csvCEgYO6Xhb7/UHOeMp690jtvXyPSBpgd7OjTnHVyvsOoi4BzptG+ypQa5mmqj15X Xn9wszVrzcCAzbhtuoUSZr+Tt5ngoFHA/kXH05nAOOP/JQEQc5H9YamFyU4RoJCQ8pA== X-Received: by 2002:a0c:bf09:: with SMTP id m9-v6mr16049897qvi.2.1532973719269; Mon, 30 Jul 2018 11:01:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdUjDvJFMQajE6MiUlARkrafsbNJOBE/qz64Q8LCMLekotiXi/k8bCa2be7i4smEW85z3QJ X-Received: by 2002:a0c:bf09:: with SMTP id m9-v6mr16049851qvi.2.1532973718800; Mon, 30 Jul 2018 11:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532973718; cv=none; d=google.com; s=arc-20160816; b=CfYigmb6MhIi633VnXSpdBbwhrH+pe9e4S6SPjkQESvVQs3pOwJQCDptLkoDa43+Xz 04vfpVvjkt/c3vTlrFSIRfdt0XwQBvaVdGIYHyhaN2QeSwCo8iR+yor5AeTZJ3IrBlfj 821KNknIbmB9LNYFS1Q8CTnbqonhdGy8IeIFBHwNjcPF/GTl/ToMe906VwizoxvkFalw DwPTbQ2KTg4s/WOGuQ6B9hIQwFCkLwwyUcGb7va+x5lYO0Zs1ZYExIAEoBH7n/H4WxTo SxVdGdpOEVEfQR0t48ykUWSstheNWKLLsv2N/+RQT77oIrDqpuCNr9kK6SvLRiBLIHQ+ J7jg== 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=scuHpibUn0Le6Cs82Dm7fG+4MYqegz3zxv5qDEXXdWM=; b=TOp0esgxnkU0FbTbp30I0NXxIxcLit+qQoMORNqkbmhuHWOjHKTRbaC/YYOaL8WpBN wloDsPAbuWMtvFtzdzONkftlmA7RltJ+4bfHGQeRSrttiMLQI+Xajx9095yvqc1WdUCJ UTdddfToLTAMlfcKsIV7o1/C0YlxWBeNtvhnHoJ+yneDvVX0x3jvfliPiWslGaiGHU1s HLkA57wrp+d5DG4JURldZOKPC0oQOXiIwtJoh7+nP56NQaDqRZJ3ki3eBcKGmURK+C9r avAenA81Yq6j3KP63a+6t1n6gbBZeG+w6IhH06fMd4/+njMwLz4ub/aWY6PhvGe7ht/h n84w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=Rc1Qa18c; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=emb5oZkB; spf=pass (google.com: domain of prvs=17496daedc=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom="prvs=17496daedc=guro@fb.com"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com. [67.231.153.30]) by mx.google.com with ESMTPS id a44-v6si5773946qtc.270.2018.07.30.11.01.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jul 2018 11:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=17496daedc=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=Rc1Qa18c; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=emb5oZkB; spf=pass (google.com: domain of prvs=17496daedc=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom="prvs=17496daedc=guro@fb.com"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6UHouvi010810; Mon, 30 Jul 2018 11:01:32 -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=scuHpibUn0Le6Cs82Dm7fG+4MYqegz3zxv5qDEXXdWM=; b=Rc1Qa18c+u7rB6jpduVm02w1pAa0wVN34GXkWkVCyloTP2pWIt23vZOpPIe8yps/CLp7 p5zdtxOjyqcHF6Xq/v41ukISEkKIrvwmQpfn3Giq3ulqV0xEXACPf3uWEpVWG4fRzl6P wajjwhpzn/nWyYR1AifbiJvxZV/m9Z83jM0= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kj53g0ghv-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 30 Jul 2018 11:01:31 -0700 Received: from NAM01-BN3-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.25) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 30 Jul 2018 14:01:29 -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=scuHpibUn0Le6Cs82Dm7fG+4MYqegz3zxv5qDEXXdWM=; b=emb5oZkByn82N4+xxB5IU2w8U82y+506VVFjXZsv8lW8biYBbyfz+4dZTXq3ILdB1e9srjfUBh80JJHBZX+MUbXRISA6Xtsxje2N+9N/HTpItfoyJsj60bkubpcAqrT8wGWe8hMqt7IGUidNQchkAYf0n3urxrSutCaQrCtDqV0= Received: from castle.thefacebook.com (2620:10d:c090:200::6:484b) by SN1PR15MB0175.namprd15.prod.outlook.com (2a01:111:e400:58cf::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Mon, 30 Jul 2018 18:01:24 +0000 From: Roman Gushchin To: CC: Michal Hocko , Johannes Weiner , David Rientjes , Tetsuo Handa , Tejun Heo , , , Roman Gushchin , Shakeel Butt , Michal Hocko , Andrew Morton , Stephen Rothwell Subject: [PATCH 1/3] mm: introduce mem_cgroup_put() helper Date: Mon, 30 Jul 2018 11:00:58 -0700 Message-ID: <20180730180100.25079-2-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180730180100.25079-1-guro@fb.com> References: <20180730180100.25079-1-guro@fb.com> MIME-Version: 1.0 X-Originating-IP: [2620:10d:c090:200::6:484b] X-ClientProxiedBy: MWHPR15CA0060.namprd15.prod.outlook.com (2603:10b6:301:4c::22) To SN1PR15MB0175.namprd15.prod.outlook.com (2a01:111:e400:58cf::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1aa46cf4-b16b-41ec-0512-08d5f64678a2 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:SN1PR15MB0175; X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0175;3:EObc8fDgTFaQTwI25z0yY9fuqYoJfJFPjuU/eDG8GHgIuSMJJ2qGgIwugF2VD9LwjoTyzPTgv026rJ1SyYp12d1jCwDpA4Q3dqrLcLLGvgPcydlvDQ4jQQ4NEHVrCzaruavRWot8Mf81Ib/hX4E+TmlYwNdrSomNqgQAVXGvhdGYbeMhlrS5vvLyl+OZ6URm+pPluiLbztMRYeF3q2jPtkeIw8TjCotwUODbY912sYh1nWi7vlc/9OsFsP2U0MH2;25:EvHC8W7QxeujOCQRK7Z6JtPCszhR0XOjET2jQfMxvpil14yh1YP8n6mbMQs1KyL/Nr+cFhupnPfKURl1syevYD1gftNgMgOeByZ5Q4I1fdirHjtelCWS327RGWqzcBzVFA5ByD/n2EOMPEfM/TQ8EG7fSsI6oagJtbdA3GscHljpNLGj0o4PhGSjg40+EPbSMcIMmmi2q5DD8LeB/W8NtMsOx9LMRWOIbNutMlj2Y/YVIac6ZiEvHlzmv7c0RpS4D7I/H5jebXhXfDgYsbMUkReiabILhc4AL58JFjDarmr5k0GMROCLGDCuj6NBzTcQWHfaUEE2WsgKHJPD/EgXBw==;31:ijRt+ZPS7mrgStyYqIWCr7NtYyoicQgsAxZ5/przYHz0JNwUQjW6sGkQd3FyVoNEEwtF/QXDeYcTXwxE9rYGkCRz/YhxijSdwwQQpG/5i0Es/29fdBGtZ34tuW5/0IRw2zAmDTTG2Pk06o8rmdpyx8wtgB6/v1zOG/e88LgQ1C7PQwHzZSmyeXfvsRoF8+hKPdju1seHj9yGGpDucbEy638Od9bQV5oklJRthkVWmdE= X-MS-TrafficTypeDiagnostic: SN1PR15MB0175: X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0175;20:2929LKuKKlVya0Ok7L8rlviLBtZw6cl68/zpoCHIQw3FLQh3EvLEPdX5ELegIpocJlVJy9r9OplqIrSuFthTye2kivrZHZGF50JiDKiOgN1muZR6sj93eRk4V2K+agjMkF9qyJ9bInEPDptLwVQgujJNOtSpOcaw/JF5sVkdgRxkt1xgph+v3wWokuj9eGuU/8N/Wqrr5u0J9NQGoQDa7Fyy1FPwLRTCl4QIwwdA+U/46fzuw2sIZYeEE+a0TG14Ay/ar+uMqT1qEV0MOgnet21kXnJ43meytRn9WXxEwS8YGcHegyN4SejWF116RCk16m8huLcjb77/zgesMFqR1tjDMypUzxIemA/2thMpx0PQwQ/hYRyzDQ8Lvd3mb6riCOILDJADo4i4Vd6OjZ+6X4capP1ZaZNG7yBJI5cFRDq/tzKsHsnCRSmdfVnu/cu/CatNWzztY4Zapb9xXw7A1pEyx8JyQGjyzLokOGtcxHA92IRODGulLsEbaX3/eMQP;4:7mCi/p7fMijYgC/i/WNzLfiAMpSqdvzkKRCFVcAK1Ys/xk42bTFJC83qJLXyRTMnZHIEl22SvaFfWpEgAsH3sktXYuIcuz50YBmMGByh3bEYnnmXJ7tAUVjVlS6BmARbVwe8Mc3gFk04+RaU78CcP02a7jTEbdpYOOTejJ5W5GCqZeaz6VKI64OGuLJAwSgmK6hqbaD2pgnbhV9BbL43Ro6s0ibbrAyPknh21Fg4W88HOwONE/ZEd3Pzxf8ARqSARM57kx/wQ1fsT/5pExIA3tmJ48B4ALUNWqcsjJBzNS/sv6K3WR+1tVe9DHBl1kyCgUkdL93CsboxlRtSPMoPO0QwoHd3kzuWdYBuRNWJ8WnEK94/2SwpU/fGMbyn3ZF9nCZy+px6Gm48BRzsP3rSs6JXlLz29vRVatTTVU Q4hcM= 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)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:SN1PR15MB0175;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0175; X-Forefront-PRVS: 0749DC2CE6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(346002)(396003)(39860400002)(376002)(366004)(136003)(189003)(199004)(36756003)(6116002)(8676002)(6486002)(16526019)(6506007)(386003)(186003)(1076002)(86362001)(69596002)(76176011)(52116002)(51416003)(52396003)(81156014)(106356001)(966005)(2351001)(105586002)(97736004)(8936002)(81166006)(305945005)(7736002)(53936002)(6666003)(50226002)(25786009)(53416004)(478600001)(6512007)(6306002)(7416002)(5660300001)(2906002)(6916009)(54906003)(2361001)(16586007)(316002)(11346002)(446003)(48376002)(50466002)(47776003)(476003)(4326008)(46003)(68736007)(2616005)(486006)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR15MB0175;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;SN1PR15MB0175;23:amZL3cxWKSlIupBBdSWTHL2RrzFAvwVWfLi4okpZJl5eqBTshKVx5ycizY/dNIPj82G6PwiBLHo22eYAEeqHGOa3Hyg5f/cMkpnG3yxJAAPaHh1ZATnTDm9ndNl2uCVAolBSDxXsLdKsL7gM+4UgfP7M6pkblDa23tc/vKDxV/MRdCpUB0VKRCwCMt3zHJty40IWIzurzmZxq+Mp2JAbPG4JtAaSArFlTtFxJmAOMoTF2mewOXibu7b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lZ1mJI/vtMefMcDsHnjv0LaTaX9nYEaInzgEzKRAtGhOf9M+ukfufeGGmuFAgk8TY+w4dRzA6pkNi+sN+g64hrPBPrOqrtO+RIwdWHTijw4yhYOwKpLVqgrsq45UWg/EQawFJ2RZW4eZpFTFhvZWldQy0iy3G82xjaKJax8DNac9rKXYgDt0dBhj8Ro0QDWY5UT9x5HOx3EaQprb3IR8OS3OYseBM3EruZNDzAKgCTLpIoF5HnIulyUbKDnuolb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0175;20:OrJCI7dNYq/HVyx0lRpuVBVZc3QjxYOgyZ6ENZfHLIgdEVPWDFpzOGIE4+xurt3ykLTvIJ5Mf5eZYtmGxpt5lkuHzI1W85bBjEJEGWFQe0YPYYvpJ4eTfdZYySoHlgzFMnFhRzmjEa0aPHHITLEtgtbx/eyXVpckuj2pyIlUss8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 18:01:24.6247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1aa46cf4-b16b-41ec-0512-08d5f64678a2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR15MB0175 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-30_08:,, 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 Cc: Shakeel Butt Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell Acked-by: Michal Hocko Acked-by: Johannes Weiner --- 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,