From patchwork Tue Aug 21 21:35: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: 10572371 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 DF0581390 for ; Tue, 21 Aug 2018 21:36:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E01542AAB0 for ; Tue, 21 Aug 2018 21:36:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2AEF2AE21; Tue, 21 Aug 2018 21:36:36 +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 D1DF52AAB0 for ; Tue, 21 Aug 2018 21:36:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C8366B20AE; Tue, 21 Aug 2018 17:36:34 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 950306B20AF; Tue, 21 Aug 2018 17:36:34 -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 7A35A6B20B2; Tue, 21 Aug 2018 17:36:34 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 146FC6B20AE for ; Tue, 21 Aug 2018 17:36:34 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id g15-v6so71405edm.11 for ; Tue, 21 Aug 2018 14:36:34 -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=zxLfJma5W6+QeF7kJqnEsF/bgjjJ2NJLkMmgfAY0Ecw=; b=VB9lr+b9aZxmZ5EV0LnPUXR2kisZMVFzCJNAPi3ZSgv6gAuEqK9WEWRBBC44Q4BLJY 43LOmpSKsbkTi8bUgL6IYwU+BQ7PCuL0YRAvjm0b3JU3fR3oA1WcsADFYo4b4K71sKZR KeojcP3rot1TbUmwOmw2r5Rm4asaEzWLNtlrDTqCiErk7uN1MFhYoLtjCc/VBYzzGj9g ehBhUbI9o/ghToPKT5qfAmDMYS3/t+3hKKL8Ba0MwASgWVRZGclrrDXwu1Xg4cLuj4O9 SllmAJyw3kJggfuTojkpSaaZ9X1KhgtdDKgoRI8Z8qN5BsY2CUkyX967MgeZ7enkrx6g sxcA== X-Gm-Message-State: APzg51CPpJYpn0RsmAzzIJ/ZXNIC7aQFQyBNbxaeXWucGDDWDhyCCIkQ LwXQnO0zgfVUkIJfK4koqixgI3OnpW028tozNakRmVRCa1WPBLJNxbcaM5VNAn2iXt9rUqnJB5i 5NOylJM6nQMqnUohKBWMYnjMg/DPpVcvaIxbdeGXP3SbcqxVw4NLgcZ5Kk9wMAQMXEw== X-Received: by 2002:a50:e79c:: with SMTP id b28-v6mr2921238edn.246.1534887393478; Tue, 21 Aug 2018 14:36:33 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbW8XUUTXiX7JDCy9nQzDtSzAkW7fcoiaThMydIpYPw2BS9UiSbd1wVVxRrEOa8yzeD2c1U X-Received: by 2002:a50:e79c:: with SMTP id b28-v6mr2921196edn.246.1534887392323; Tue, 21 Aug 2018 14:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534887392; cv=none; d=google.com; s=arc-20160816; b=tAI+hboMnk9P+/LO57T7jV7EEveh+aNgWOTHzZ6+MjkJDiW2dufhsWWPYXQU8YaXgd cJwOiEgfWMR22zNu9g8tYtkQSBCFfqxhEtFTpu5/ru+7pWk2SA3OYrBdl4ytqlPud0Rm 4/jvv1aUhUfxJ+svtc0ihmzpn4ov1bgH2cWV68Zg/Nqyj2jpwP/5V9NrjXsp3nKmgwmS i+zqdxgrSxUaUsSRVMgmV8RXeFpjpht57GPDjHbre2WUm30XusbucM1H/yjPqJPjAngP FMt2kjIejokBHVcbJHeo8x8M5Eg7juUNq0U3hAb9Jfz+h12iyD+A+VvPR1reC8bf2oso t7EA== 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=zxLfJma5W6+QeF7kJqnEsF/bgjjJ2NJLkMmgfAY0Ecw=; b=mgIUQiNN+GeiUsKEpRFoE5IRvL2aaeYabQh0GBc1YLl9IAqejmdSr6wfzAr7Hi1UCc bIMFZxY1ulC92G/vEjnpX6OsOT8DneslbAo/ZAXORcFgQ5nllBx3XDPlGTBz78nKReOC k+Ro8+TfDWAFKjHHbCMYRQtnAq9FRQTXAi/lulsZy0N47vkpiXL4zPGZaIiXN3aeFkom ORUvGpyaxuUmnTow23i+2XPgNSAt06E3Or2mAIVNyBQnTnVPqm40yzC+jqEDjsSCx/u1 R6NxH2n1p71Vt9H5ODrcr7FmBQmrQn9KaQkb3Ej6jvQWHfQICbKaAeo3oTN9GqigsDRK fkTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=Oi7kisRU; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=PQBAuvZE; spf=pass (google.com: domain of prvs=177171ea8f=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom="prvs=177171ea8f=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 t16-v6si198265edb.65.2018.08.21.14.36.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 14:36:32 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=177171ea8f=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=Oi7kisRU; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=PQBAuvZE; spf=pass (google.com: domain of prvs=177171ea8f=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom="prvs=177171ea8f=guro@fb.com"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7LLYGVi010571; Tue, 21 Aug 2018 14:36:26 -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=zxLfJma5W6+QeF7kJqnEsF/bgjjJ2NJLkMmgfAY0Ecw=; b=Oi7kisRU44EBMcHZZOg9Q+dAI7wT9U+eT1qWmZJzYw6PaBShjtyb+3Sk6MjzCqAql0Xo IT4QiY6MDQv1s3yMFN7VAtT2sffIN/LQ4Z8rbW5/6gZ6yxjPB4Zd66TnpR1crpjCz2Wl iqvESvmmbkVGDjQ/Qdbzp8SwUUVoh29whmw= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2m0ssj05p6-10 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 21 Aug 2018 14:36:26 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.14) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 21 Aug 2018 14:36:20 -0700 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=zxLfJma5W6+QeF7kJqnEsF/bgjjJ2NJLkMmgfAY0Ecw=; b=PQBAuvZE11i21vm1cwg9E4vHPd93gMtSnq4ssVqc/rDUC2qNvHtgxd7oBAiGyTwJ3MtuizTkQhJ5+/K85Akon5W3WFA4Er4Y7jyFrlZwn17sm42jGKt+L02u5U4ti49U+xzltsPaK7kPqVWGaGNsdoTn2UJNyvS5qxG6Jl5bTHU= Received: from tower.thefacebook.com (2620:10d:c090:200::7:b0bf) by BY2PR15MB0166.namprd15.prod.outlook.com (2a01:111:e400:58e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.23; Tue, 21 Aug 2018 21:36:16 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Johannes Weiner , Konstantin Khlebnikov , Tejun Heo Subject: [PATCH v2 2/3] mm: drain memcg stocks on css offlining Date: Tue, 21 Aug 2018 14:35:58 -0700 Message-ID: <20180821213559.14694-2-guro@fb.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180821213559.14694-1-guro@fb.com> References: <20180821213559.14694-1-guro@fb.com> MIME-Version: 1.0 X-Originating-IP: [2620:10d:c090:200::7:b0bf] X-ClientProxiedBy: MWHPR1301CA0004.namprd13.prod.outlook.com (2603:10b6:301:29::17) To BY2PR15MB0166.namprd15.prod.outlook.com (2a01:111:e400:58e0::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40419c43-56d2-49ee-f824-08d607ae207c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0166; X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0166;3:TBL0qJTkjZiWFKU7w565iphd9wDD/jpRMM8XT/T5YoDaOLV2j0Jwm2uvpaXazPwhh0EAiM7TYJ8K5h+82/B49QzyZAf4dukl6hzNpiTk5Ic5n47GNG1b/fBY1nlmqlESSlOx5+A0jg9js0eoCklIJTLQEYF6Ty0gluDqHTzaJ8TKO5SzK+1qXdZvkvBjcVjW3WKIzOo5jTQIs7kxThQMrm5Kx4Ku6YztmCVkbd1gr1oU0jNBt5e1bi9oeUfZwFDK;25:2Oj7blzgBNaTQz3a472uDfIr4SuDLuGU7waAnlewMh0NniB+DEU1CVj6rR039ndi7KvHG81YL2yTOXaA+X9gBUYFQH3IuYzgWVjPrq+aE2MsKOQwz4/PVRpGJAm2zOoIpyCINiwgy59bJZNKkWFZ6s9Mqs42WAcWFxZWR2NZkOWV3wE4DvaKw9YwHnqFbNQyWlkaL+sFnBBH2O0GaZTqs/2VtqyvCxuDed6Y+p5ZS4cSfTYq/XtALWaV3DaLokXoGp1jVsphQUx9HykYXreG042z/SDdgtmLZk1nQNkCjXxX625DSV2lN0Ww9vMoPrI8r9J4Imair+XAyVtitIr9FA==;31:1ssX5LFspXHxLr1ukFUTti2dGkExnsm6F8E/6JT+7zDZ3FFBTgQj6r4Fsso8FjWjxQz/bUhg0ZQB1PMhxZnSPUetLSZ8Y0JQVzPWVm5pUXBbU7wZp/aC7DS7suA7xB/FCL7JlS4dHWa9eWE3ppKP9I106O3bdDmdqNZSH/4oGutSyzHYY9xAb14I6YRqsSSEDi0p1qZmvr40Vr+n4xHSrH0btKmaSh0GE/xudgPpYhY= X-MS-TrafficTypeDiagnostic: BY2PR15MB0166: X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0166;20:KYBrQAu+OxkB/UuxpqUeKoI+deFee/3XzZpCO+NGYupvn8mNnZBoMku3ECyUJtx7bUQ8+pi1pVziDdbg40PDP2JMkKVjzr11eLVK/OBXA5gWMtjJjjPUQUodjtLVdAChHvWwbh4gDDxcsldzSaQul/47JSnKjFur8ec9/E3c0wPOyxjX/wuCE/urvOgeoCnAKIJhQD93cvh/wiOYklO5yttxFOfEKF4iC2xDUFH1SxKZwKDHOeyDlxvoFO7TWHD4Rhg2yOJQoXT+n3aTKznMD3SUkMUhDkyVscBFzDg2HUDf4cph1LP1t0tW9BWz55imq3Q0EOZFFeYfUFHJitGiAxL2dInEPfBt0kAN3y5ALu5deTdrcx+CN0ufkUKuvhF7NxiSm1dK2QZOlAV5C5dV19JtZvb5NwflLNnF8XIZq14aNM2ANzPhFcYwbuhQB5HEOXlKg/fOm01IRID4axgow3cFM30p9o93+IJ94qqFnTGuF3Hyp+ubEMrov/lYmIIG;4:q3X4FjkMQHdHiSqeUb91Gi66R1VZaNAAhFobAZMMksmeqzJzv4qVIiIp9gJ2NnOqpxj5v4bCTRrNjHPOYwXxISSnoNFsKxOsD7zVbVtrN5BLYbsMIFH1hvD7rknUrfmieXOQASV7bpgp0vZSg3Atk8V9KtzgMedft8vCMYoh9wYn1oCVP25x3QAlNQmqeN8zckR6yiHxGpTflIGSyMKbw92J044nOYvkKA846buQOB94Eup6nSGZr9k9O564sflXEOSmeWI0I1hfKl4e+d3Z48nAnqXaMj1ZxlFYVjWlPuRPcXxz9Z81lSdjz3zjuklkSpnttGLLRIsBERAVsjOI1sv5nQvZmzl/UKvGdecvBGoy0gCjwZinbNPN06TPsBpWGKmWMW7i47CT597o2jhBYxFp1ZOAk8lWGS8BOw beJ4g= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(67672495146484)(211936372134217)(153496737603132); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(93006095)(93001095)(3002001)(10201501046)(3231311)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:BY2PR15MB0166;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0166; X-Forefront-PRVS: 0771670921 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(346002)(136003)(376002)(39860400002)(396003)(366004)(199004)(189003)(53936002)(68736007)(39060400002)(50226002)(8936002)(25786009)(1076002)(2906002)(6116002)(4326008)(476003)(486006)(86362001)(16526019)(97736004)(6506007)(186003)(386003)(46003)(2361001)(478600001)(105586002)(48376002)(50466002)(54906003)(446003)(106356001)(6486002)(2351001)(2616005)(11346002)(6916009)(76176011)(52396003)(305945005)(6512007)(8676002)(53416004)(69596002)(36756003)(16586007)(81156014)(47776003)(81166006)(316002)(52116002)(5660300001)(6666003)(7736002)(51416003)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0166;H:tower.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: 1;BY2PR15MB0166;23:rFusLMPsguwOOA2ZTbxEEV+B6UIijFRTnsNwcZnMR/5dL9RFF/cax+ECy3ZmWEQmxmZqznJIlUdEVZ/0eCi8WqjNiLWR8aRZ6AvjP1pMjwXg+qNiBK5e/PeULaNSnKqHTIGGdbaJqGlqDgimfF84qTKUqMjdaui2yhqdxNBF0IZBa2S2KGmLh9x0FwfPgk/FctI0GuSoHfgP05bJofN5p/kSHW6K9ezawnf9/fj6nW7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GSo/HhzClJFGghtOxV2BUmT3jA1LPlzB/RqWC4NNmymIHPXRqEY6urad0PMIHvV2lN7i/WMoemYPSceYiTT6gOZ93jXDK8UtIobAo10Ph+cBRYm2gY70zUYHqlVMEvfJfKhVjvV/BPSfrCgl1JZrQC+2McpZrTGVSitjijOnbNG1Dv44cLiC0kVoGSxuXx/HtgKokGfMIm5+1WUmHKiF0QqY4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0166;20:AWf5XKKK8ByplrzGOml1j5BzxpEV44GJgySP+SLB+dslmMNrFl2/MesYuMcXT6d+DMoW1Go/Gqe3E3GOywHPNyLFoiqoKkI8NZMELMhPRcgWWqK3GQ+ssTCUX2wo2kMe1qDBGCxs+PHOCwXYnLH5g4FL+TRBWqiUAbVgFsvOyhE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 21:36:16.5581 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40419c43-56d2-49ee-f824-08d607ae207c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0166 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-21_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 Memcg charge is batched using per-cpu stocks, so an offline memcg can be pinned by a cached charge up to a moment, when a process belonging to some other cgroup will charge some memory on the same cpu. In other words, cached charges can prevent a memory cgroup from being reclaimed for some time, without any clear need. Let's optimize it by explicit draining of all stocks on css offlining. As draining is performed asynchronously, and is skipped if any parallel draining is happening, it's cheap. Signed-off-by: Roman Gushchin Reviewed-by: Shakeel Butt Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Konstantin Khlebnikov Cc: Tejun Heo --- mm/memcontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6a921890739f..c2a254f74f30 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4518,6 +4518,8 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css) memcg_offline_kmem(memcg); wb_memcg_offline(memcg); + drain_all_stock(memcg); + mem_cgroup_id_put(memcg); }