From patchwork Wed Aug 15 00:36:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10566205 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 2943C157B for ; Wed, 15 Aug 2018 00:36:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A00328C1F for ; Wed, 15 Aug 2018 00:36:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DD8C2A1DC; Wed, 15 Aug 2018 00:36:53 +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 09E1328C1F for ; Wed, 15 Aug 2018 00:36:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB36A6B0005; Tue, 14 Aug 2018 20:36:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A630D6B0003; Tue, 14 Aug 2018 20:36:50 -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 905676B0008; Tue, 14 Aug 2018 20:36:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by kanga.kvack.org (Postfix) with ESMTP id 634B36B0003 for ; Tue, 14 Aug 2018 20:36:50 -0400 (EDT) Received: by mail-oi0-f72.google.com with SMTP id b8-v6so21845667oib.4 for ; Tue, 14 Aug 2018 17:36:50 -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=eesPrDvOqeXhMz2Kka4CiC+3KQRHS0oUCbgFaiOyA2I=; b=ThqXDWY6Hhat5OjH+X+ZdezLM+NiiZPlBM8FUBN5EfYhm0HtGReYrJsJAT8PVmSUnx R8fwKWupTXPQObrnn7sVbuGw0RpiepB2cUIEHzam6c53KFS7z+kC8+u+UjrmlV+oqNqU zEp9ZiuNDPwAhPNi2DNBHR8JXk1dhsiJuz3xajZHaFcLgoWnkGdSJIoUbmc3owD0nJOt buc1ErSaN6ofQEy8EXwPTukSShCuXslMD2zoF/3j4KeRHBSIEbWWCxeUtdlE165ZQHll OMm4cNs/WPkOwkiEc1tfsQOjG1iQ1z2dViUteeyZP61tHhPcv7MiGwY5TO54RDIV1gTL Xbeg== X-Gm-Message-State: AOUpUlGfq00J6Rgrut1KmZSnUD/bDggnnIUOJIE27p9CCcnDPrGupuIu Ff1jacS6bLHYvMqmHp2NO88kPqT4Jmv1FzdbAd0n5rJIhKT6KQNm+fFMlb9kOrHdKfnzXM7crPi slvvbXSUzdFOTJsI4jDOPV8HKEaAVq9ZdIQTmGG5+Py+hc9PCeR1uZumYa/xy257Rug== X-Received: by 2002:aca:acb:: with SMTP id k72-v6mr26305371oiy.78.1534293410102; Tue, 14 Aug 2018 17:36:50 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzZ9jGH7iFSH2l5SRr2IUdSB6uBZFQIEBBh2h2jLxAXG2hkyGqYk8IaZND2ppuplGoa+T59 X-Received: by 2002:aca:acb:: with SMTP id k72-v6mr26305343oiy.78.1534293409455; Tue, 14 Aug 2018 17:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534293409; cv=none; d=google.com; s=arc-20160816; b=UV9eVdYRG2sNTyyy9ZgWJGElApaFoMDF90gmAWZM994B65fYE9cTevalJFwswrYekt L4bRN57a3TNbgo8caS2QjWtk2Q9wbDGKRlpV4Mu4CJTBogd0bOu7YYjPpFVZRfloMsad AdqA6NkM2Udac4YSdCXo9lCIt8Y7HqkuR9xr/jTGOlQXC2YruKs3e+rB5yfT5kqiikMf yVJRIT6Tucd5y6lu+95/Cd3lmuYueUP7Oplm1qRf7guYRE4t84T64jRt3ywu+g5bjqwe am0ZSadG1y2pgNApwHRcTRtCQzku8482ixQDCkegkAyymkF3wMaWfy2R5bWI0SzysB6e f77A== 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=eesPrDvOqeXhMz2Kka4CiC+3KQRHS0oUCbgFaiOyA2I=; b=bkToh54VgqIShKD08XzEJtovK62H0GbNY43KgpjE7IIYlwi3XhEdDIQ1VlWU1IGEVl yYjAxJMiQlt7WthzxfgnyyXXoWv/mM1lsDpUj+httqwc6mhxFY9ZkAr34eXnHaWtgCaL Zd4JW6xm0uLUp7K9K9mLDb0L4SbH0jV/9RVhRRAvFKtvW9yj7JLBBoNJPkU8GBVR760o RMO28NUDrD97Ann6tuKsRMBPAA0pTtrPW8Ry3k9vrsnoM5N0lv7fa5KHVQLz7gI0bcGt XPM5ANIWGBoimXf/NZP5iiUT/YurkvgQnhEnVrItpTJ2VAWdjMYiTtRkCu1BL7dgs54q m8ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=lg9y5jYy; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=XwTPYzfV; spf=pass (google.com: domain of prvs=1765e4075f=guro@fb.com designates 67.231.145.42 as permitted sender) smtp.mailfrom="prvs=1765e4075f=guro@fb.com"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com. [67.231.145.42]) by mx.google.com with ESMTPS id l77-v6si14731910oig.48.2018.08.14.17.36.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 17:36:49 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=1765e4075f=guro@fb.com designates 67.231.145.42 as permitted sender) client-ip=67.231.145.42; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=lg9y5jYy; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=XwTPYzfV; spf=pass (google.com: domain of prvs=1765e4075f=guro@fb.com designates 67.231.145.42 as permitted sender) smtp.mailfrom="prvs=1765e4075f=guro@fb.com"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7F0UOna028091; Tue, 14 Aug 2018 17:36:45 -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=eesPrDvOqeXhMz2Kka4CiC+3KQRHS0oUCbgFaiOyA2I=; b=lg9y5jYyHQURsMpjlHM/eNSGuBXqflp3SMMpZ/hF6NXnwwQjzDvpAICHml4w1O09mNn+ 9DR1ntzKkNteyStGrGbu+tA4P2Am1k+7EMpu0o6kFvchWx6yXaEN4p6/fZfyg/4rAGKh 0HGSpHrXniZhygfKa3HRjmaZkgxPE9vs6PQ= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kv6hqgg7w-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 14 Aug 2018 17:36:45 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.20) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 14 Aug 2018 17:36:43 -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=eesPrDvOqeXhMz2Kka4CiC+3KQRHS0oUCbgFaiOyA2I=; b=XwTPYzfVJkqTd9zEHQE8MPRh6PwxAVe9/nQSMv6OF+y7kNvujKmFmCrRjVREy4h7ztByEgPWcl9DFReazpQ3CLEaxvwihOXF+/7ItGeEP8Zr3ygNOLy2CRQzkw7tzaCwimI2nX4pXDnKEu0qR0fEf+eRlsLkYS8e2+sbdI0iag4= Received: from castle.thefacebook.com (2620:10d:c090:200::7:b884) by CY1PR15MB0169.namprd15.prod.outlook.com (2a01:111:e400:58bb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.19; Wed, 15 Aug 2018 00:36:41 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Johannes Weiner , Michal Hocko , Konstantin Khlebnikov , Tejun Heo Subject: [RFC PATCH 2/2] mm: drain memcg stocks on css offlining Date: Tue, 14 Aug 2018 17:36:20 -0700 Message-ID: <20180815003620.15678-2-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180815003620.15678-1-guro@fb.com> References: <20180815003620.15678-1-guro@fb.com> MIME-Version: 1.0 X-Originating-IP: [2620:10d:c090:200::7:b884] X-ClientProxiedBy: MWHPR19CA0006.namprd19.prod.outlook.com (2603:10b6:300:d4::16) To CY1PR15MB0169.namprd15.prod.outlook.com (2a01:111:e400:58bb::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6f46611-207b-4f65-0590-08d602472b88 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:CY1PR15MB0169; X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0169;3:UI46yOKmfkpe/1meHUV6jztQpakFTB7S868xTeM/dM2ON1Ozzdn48vQCtNV1qO0KEoBHCf8GLbn52n7QoZ4md8Hhf+p0EVRhAQMf4Jjf3DFRHoQAIloxikda12pubGoqmcVQwIoFVVOlh4znWs8OYIW90E2b9tKi67MJQgx5roeOlSCCzzMLl0gZYKaj4EaK7qRP009vXBJ3yQnFXTKZ27KQGe4YcgcpBBSCSEVx+VBJMJLU1NuWc1CGsZkphpI5;25:etb9QUBEsFrmnsF5eFjbLKdrDslScAbPgtc+e8V6HcWiNk5VTbbhR1zwEJ+Dj/HRvZ7VpnWj0m5rGksturpqX2M2mTI+GKYBU9v9NnhQkF+GH9CZLRWLGv9xwkVFIYoixpsLwXnhIDTcflAFupKQe5qdkneyWTirwnK4DJL49JFIS2c0lq3ylJzfm5yBulAQty7XkGSqk3Jg2H1iUV937vZ3FLOS8WJZPd+dNWKsKMo60L/WnMoLvETSrk9ftdwz6pb+js0K7tcsTROq4FtU1Pk3PNxEtusQxLCk6aHMbcesWp76NWO3Z87ykudlPlkapIqhjKHMGwXAJGQdzznEPZxe8aXAByJPmc4aj/cDdPc=;31:TQX7d8i3dhwbQuhefTUdDD81eDFFHl349DMYA4abeOSIqAoFVlX/yW2b3PeRTK70Ox62aMtf8gUNtkx130ptAJXD0MKJacYEzgTwWcPAWk5SdLTBnS9+Z3PlI0wzA7qFB0mJbILmVdT1Wny+MyFIkw2CJD8Mwdx2/gavgfoZX8d0vjqUEr7sd7JeWsux1yJE4e/4wqluWbvjdpEg1BkB5A2B41YfLgILg1PV/Su04oc= X-MS-TrafficTypeDiagnostic: CY1PR15MB0169: X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0169;20:uqXjB3dORnpltw96RizXDjDSrlxpj/G4EiWZ3XejixKgAYke52yCkVDpnUhz3gwLZ4RpMZKdXW6iXV1MNfIGrkSeZtaEGMS48GRbXJZKmqVe0RdlrBiLnHAUasYt3c2GJM6CuhbjN3Xb/8KWLp+NrsbdZg9zVjfQ885xHLJG+7wF3jN1emJ+Jfey6xEIfxUn5yPQ/B9f9tpDq/ExZAqiLQgk5sD5AbVQNa22tvwJHuiL4VeCxjPFzUGGlLSdIeTe3KnfIO0eUNlGeGtOlBSnt3emWFK9snUkNXiCsBJm0255F9IYZ4poS+awZLFCpynMIPOO/gF+Kfwimbm62YcAkwwZ7+BnKgPhYMtsQ6DJCu8bRUYRN37i4ktmVkQKVqvJcQKqPbIYpcUhbzl+Hjk1Phy2N9iGYp7hs0x5DfVQzmdFAWtHNBK7R5gqwh0hG2xNl826qGs69NlkEBGaetdwmm0/MW0Yij2wmf22zTcywQW3aoCYqtQnXFyCUj+4h1eS;4:P32FkiNsLl8wDY6/4n68RPX0XV3jku8zQPWgCjSWTiJRK00HjF7FPTO6QgHUKuh5IYRetYm7MO3KlwAsNvDqJkyct0FhoTt7ZnfIdiz7KA8Sna1Q7Er6nz8D1777+ZKgYQWxgL1AIPLrSdM9ohDZdEpmQ05lFqPLxvEZnH+xIBgOqqEhpZSGAwqbTPyyFDDRGxPY+s0OMAL+oU27sm1KSyrjXr0iH76M7H1gRaRigAItBz0W0zjIbdoVNT68rpCoW3QvylQwE2kwvLp1FZpfKSrG1HeKZ1sUhnM90HDhcSTtjZh2lcIGTvePO6ChhTqHXQ6LPXVm2LYWhcdTpbJhcHAP9lAjeIcOl3YgVNfSGEE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(67672495146484); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(11241501184)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:CY1PR15MB0169;BCL:0;PCL:0;RULEID:;SRVR:CY1PR15MB0169; X-Forefront-PRVS: 07658B8EA3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(346002)(376002)(366004)(39860400002)(136003)(199004)(189003)(316002)(2906002)(52396003)(54906003)(105586002)(4326008)(39060400002)(69596002)(51416003)(25786009)(16586007)(53416004)(76176011)(52116002)(36756003)(305945005)(50466002)(7736002)(106356001)(48376002)(2361001)(97736004)(68736007)(8676002)(81166006)(81156014)(6512007)(6486002)(53936002)(46003)(8936002)(2616005)(486006)(476003)(386003)(446003)(11346002)(6506007)(186003)(1076002)(86362001)(6116002)(2351001)(6916009)(6666003)(47776003)(5660300001)(217873002)(478600001)(16526019)(50226002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR15MB0169;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: 1;CY1PR15MB0169;23:UY4HuPUJKdKcLYQjpc56eGtqA9hoQFrwYHtlFvWa/UF0Ycraq6GR+pIRpHRwVMXzZIVJPRgYQlGS+dgdzVX4GYZkae2qH8WUPX19m6V8Zzl4skoGV+3IXjYRkmpvsLxP1AjNbOb1XNgQb5xXzk3kTy9D2UK9YI2V/hLf6m/mZn2SMPUMC+IM2z1RcXeTmDI4n0k6SBUmlL6UM6JiWx88PcS+fnm8rBkleknfBwYSO8tBDXaGFB9DdIwCtxNw72I28cPSAAjdugzkYGGa/wx3FCXE/rSTjUEjyifrjkLqbyo+tvgIOo+BVlx365PHV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mrtPsg3+CkZw3552tDmmAbLJV1c6DO8OwNaWWdtr2yg6GDgm//uagO1lKuoJQYfGtB7/CnuAVSPVcEQ4MSn6IoQJipXunA2PVQudq1wDeR9oIIR9ys46V9wPptRsnq7gBY0aV8LxCByzVEtXKU+ldyp6DoAcONTOprDV9nMKcQiDQx1kNb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0169;20:dRmZNGU4EStOcIfQTVsgNK4E6+Uj7zLvYCUnpBydMr6yh9y2hLv75QC/g2wO9BA6vFKPmLfBqeTPBa5AYk9olcRPjeNq/24VOurejgndA9qVm7tC+QJl9dL+CfXVOg5g56zq3OXAmjxlsEYcSQkaDb+yIQ7nR7HC95aoIpo4jgo= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2018 00:36:41.0302 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6f46611-207b-4f65-0590-08d602472b88 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR15MB0169 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-14_12:,, 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 Cc: Johannes Weiner Cc: Michal Hocko Cc: Konstantin Khlebnikov Cc: Tejun Heo Reviewed-by: Shakeel Butt Acked-by: Michal Hocko --- mm/memcontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4e3c1315b1de..cfb64b5b9957 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4575,6 +4575,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); }