From patchwork Tue May 22 13:25:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10418665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 234CD60224 for ; Tue, 22 May 2018 13:28:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11D4728CAC for ; Tue, 22 May 2018 13:28:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0461928CCA; Tue, 22 May 2018 13:28:51 +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 6303828CAC for ; Tue, 22 May 2018 13:28:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ACF36B0007; Tue, 22 May 2018 09:28:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1BDB06B000A; Tue, 22 May 2018 09:28:47 -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 F29446B000D; Tue, 22 May 2018 09:28:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id A621D6B0007 for ; Tue, 22 May 2018 09:28:46 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id s3-v6so11231261pfh.0 for ; Tue, 22 May 2018 06:28:46 -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=vCnEjfcMPk3WsRX5LwEFZ4DSVWrhEpWNIOi1JN4H034=; b=bXSe0UBnQDuYxV9rGummitpsVWz9BIEhw3wCgp+XSxqV3DMkzAIls+yN75WKDcYtcJ h4oTOauxucFjxMFe3eH6Aqi0vnixdIkRVJ5rXXE2nggdAILzWcAHIgUMGoPQCfNktMJc rR6Nb8y4uP3Mx7P2OucQowi/V4wkfKBzsFrVgsUimo1q7GiED+L/xKzlE4yhoDlObw/x 3nKe5JgKZuuPweLiplcm3cbc1Pb9DUAkzJsIkgLGYumGVE73zelzvhI0gq4SlrlfAtlU fhUfvpT36WdbioTVEIHXdLfHTCpkU4UcHy9tT5xkt7AtzTN8WGHBhDPn9cSSszIzQU06 lCxw== X-Gm-Message-State: ALKqPwcCJ4L0XYT+a/cQiH0vDH3Fq2dmYF8qp3P3zh54NZLubwcn0UnH IZmUZEHW7fups6KS5vGsBcBH2RjxI7WygVVBptaaFSpjtzNtehmplIsdiRO5PmWqzxm4Z4+cKso j8Dl0GqYvoChYN+BGLIiJQ5aT4m0OSCiQK3WBPDgTfmIy20ialO6JODo/DCyW1odhYg== X-Received: by 2002:a17:902:7241:: with SMTP id c1-v6mr24943798pll.217.1526995726329; Tue, 22 May 2018 06:28:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq7TQb+8mqvxlzYl9W4++r9OpH/Os2XvbFALMZSRdxYZiLuHsqMoxw0uq2ZCcmavdyKl+xc X-Received: by 2002:a17:902:7241:: with SMTP id c1-v6mr24943765pll.217.1526995725726; Tue, 22 May 2018 06:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526995725; cv=none; d=google.com; s=arc-20160816; b=s6VJUb2f6wRFV+HjMTaC+hICqk2rZoXv+eP0FGe6hiH7A4vEsGZsAmakN7JfuUz1PH WgGyTYoyu7rFmvhQEtifbNeqkmX3IsjYlBcxleyGN00iizQVB4eTosw6BEfC0E5y9skb su3noheygczfqUhI5u+o1yMe9D9EagC1Qih8z0q8fESUZY7sIoV8KWsve+A22nMkexAq mEqx2mzyT8Q0tZX141QdV6fGjaRI+NvXK3k4PzMctJP33OCSwY9fFb5cJsaGm5oVyAUQ tQkMve2smGjDWRrFQrdj68k6s5Q0bLGq7hSdOYYcO9rcBe4uV8EoycTytzZgKp20R4YU e/mA== 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=vCnEjfcMPk3WsRX5LwEFZ4DSVWrhEpWNIOi1JN4H034=; b=VZTsfV9G7GFc6cIFAP+IRDM0JUSI00LW/fZ5ArZMQrzY3v1rC8uYBAcWG+5ksMb1Fh tsK7xBp9vMcksWbTyk5T+qgkF0P7padJXCBTOg483nAW+i1cX+JYqCuhD7XDOP5l8nP4 GvsgU/ja2llqdgVNl+FR21yTrApS5VDnfrVMnPjb9J3jG70611W442zw4Vy7MZvzuuOV mT2vTRDIh0jSLH3myUG4IWd2ivvmTlha9XMMJYQogMWfnIHjiAIgDP6M0cnP70JKPit7 9yy8SidLUKEW23Qr5WSocjrHPvxZHlJbykKODBqgC3lhdQn2aZsOy+OILv2Lr+XC0/Il Y8ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=aHFsGH2g; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=IMNa6wTm; spf=pass (google.com: domain of prvs=86801010b2=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom=prvs=86801010b2=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 u13-v6si15971021plq.161.2018.05.22.06.28.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 06:28:45 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=86801010b2=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=aHFsGH2g; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=IMNa6wTm; spf=pass (google.com: domain of prvs=86801010b2=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom=prvs=86801010b2=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 w4MDQolK032009; Tue, 22 May 2018 06:28: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=vCnEjfcMPk3WsRX5LwEFZ4DSVWrhEpWNIOi1JN4H034=; b=aHFsGH2gI6C5ScPVfd2P2u/rA400oyO4SIZ7GCdxZQ8vkcOHJSPTlafKDXurHRBjbh2a u8h4JY9cMFeBYhzp6OZP1CvzW49HbdnKpdQv/iNhFAzMIoNp9VVEW263YjosolvZRDZM SfCb/XMXJSb8ypgHK76Yn4jjZ5FkY9Fdxw4= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0b-00082601.pphosted.com with ESMTP id 2j4ffyrkwt-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 22 May 2018 06:28:32 -0700 Received: from NAM02-BL2-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; Tue, 22 May 2018 09:28:30 -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=vCnEjfcMPk3WsRX5LwEFZ4DSVWrhEpWNIOi1JN4H034=; b=IMNa6wTmqeGBvXrXzpwryTWLzugZlZ0yRUXiCNSVs2S9ScBaQmcTLXMDPeKqHPD6LlJU7biOdLqZToG8ka5wAoGcS3nnoGpckNNDScfSVhJOgfOu5tqiMxnV2UhNRifHOncqfOJbq6DOzAsgKBB+qj11QtOXXmUWLUtvu49lfNw= Received: from castle.thefacebook.com (2620:10d:c092:200::1:18c7) by CO1PR15MB1077.namprd15.prod.outlook.com (2a01:111:e400:7b66::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Tue, 22 May 2018 13:28:22 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Johannes Weiner , Michal Hocko , Vladimir Davydov , Greg Thelen , Tejun Heo , Andrew Morton Subject: [PATCH 2/2] mm: don't skip memory guarantee calculations Date: Tue, 22 May 2018 14:25:28 +0100 Message-ID: <20180522132528.23769-2-guro@fb.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180522132528.23769-1-guro@fb.com> References: <20180522132528.23769-1-guro@fb.com> MIME-Version: 1.0 X-Originating-IP: [2620:10d:c092:200::1:18c7] X-ClientProxiedBy: AM6PR07CA0019.eurprd07.prod.outlook.com (2603:10a6:209:2a::32) To CO1PR15MB1077.namprd15.prod.outlook.com (2a01:111:e400:7b66::7) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CO1PR15MB1077; X-Microsoft-Exchange-Diagnostics: 1; CO1PR15MB1077; 3:/fNJPD1rWQ9IMrl9fOwf8gfgqaEL9vbJwfgifS9kjb/UMgYIaBGYMs/JxhKhDADfBaAP80FRSVga5QKhckQViz2uFOeT7SkvJomlGcJElWj4IJqBSx+ydwmf4wxNhacr9U/YlDv/BrZfU55dMipnpXnFF85srv7aNvJs1kqfdU0ol41+6o3EFq0Aby58xQGUzlb9jBBub8dfEsS85kQr2WJRhMe5vAP1eARKDAkp3vcEc5Cpp0mdrfL4Vq4JM22I; 25:nWHjUhZRTMUxKKtHLB8iU9x1owdLQ6iVGB1GuyP7a8eoOaJ/0920ob39tYsG10gJIlFWx4rEKUIIS3DVl3DDoYcTX4o5SiXipA1wBC/LPjf0QVOJIy78RGzlgO9MYc8/hDVHOF1g/ObeVpd/EVdJJexRyggYH4LVdeMFwSVfSzOVEg+HoRTtgSFmfxEr82ax/7Qbf52+8NyTCiITKmyp1EhtPmy5peraqZu+37hDEQ1qn+D4QJ8ZlBhYxhtHdrPbnfIY3t0j3BDrljA+QIP9cHLW5QjUt1xE3e82O2Rfhsdty+e/gzwoUTDUFDv9tdmdtIvup8qA+akPmDni85ft0g==; 31:Iy/k0nXTJEtGyDjP7nPQhUedLK1e+a+7QI+WO3dJuDLeqDdqR0+fKsv2an/yk+AGwPVGVzjpFwkQ51Z4lJHfxJ6LzNIq5xOV01aX8HXwMnQat9KiMh4lhATmqfAI2soiTd26SM2WOzem16692IgKIp2KHQZCUsoCL6Pwl5+KvDMARlrpQHB94KyxLgGy8fO5UALb/4l4eyEm9sl08AhhMJ21Rea8eIARcY3YxXv/VsA= X-MS-TrafficTypeDiagnostic: CO1PR15MB1077: X-Microsoft-Exchange-Diagnostics: 1; CO1PR15MB1077; 20:4O2RyfofP+0v2H1D8LOrLXOItxo36RA5VpHIvVP26aRzDJPtYSpHaKux1Zsd6JeAZ1LwrOn5SL9+Roku+JWoEc5wCCRiX8QPBkLs87SwsXWDjHPq0b1GNc2K5UkqVtaO85cX1L/VlRRBIAftMvWcRCHU23hsJswjIO5Yt9lHRapKoDpTV4gu5cbM6zWyRlnVjfn7dKziwnytKddFws44LoanY51MZ7kGSlymoCBVc25W5ONM6AYGuBCpZ4cqcOf+mua21d6ZzMPs+nZhxQDd/DTXP5saZkJPpUnQglGK/vciq6qgUBOAAa5kVUPm6OMhukGGDMcDQnRfebXZ0KjgpKfRZqzrXiYlzmKEDJohJxGD/Z4ft0N56peOzuAltayaYFfyiw4FEkPJaanuKv2Sv8w27UUSA8NC81KiaAWpbPkOWnO3NgXx1Q6oV1cr/SG6x4nejNXS6bpcZLzF8VddzsZnHzvh04fFu9AiwBfRzoA5KqBtQTdmvbp1Der9Y2BY; 4:MexCG1IaTJKg+tzc70a+CqZN8+eCnKdRB5d/a/TT6CC3Ifxo24N1SuYknPBHE8MZ4CYeuEqb+h3HciZ1M4vS4D81faf5XkBCJi0FmdADbVYbFKnYg4zvzVY65THxZ8j+Nv5D1CYgztVgfM8fNlTShk2VZh+WdYDjDARDWfTCcWh/we+qBb2xJ/G2p7HiQs2cHuHsHP7tUUsAbH11WilZxzdZ6LF04h0ov4iNeyz1wrYzVBxADtVTyWYjbAEvRc/GSMvKoxYyjJEqJpRM5LgwkOb35NPjlUtCi5nBPhO03yFDHbJMdxvLN/0KB72P0S7mAl3nfFl4hJ8Qee7SoZqwI9YLBoa0vz35RjAvlSaxelW8P0bc8t4J7+JL7hbkhpgEs6ySGD3vFkAti/xxqQWx1o+IsNmCsR3HBc48dZ sS/0k= 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)(3002001)(3231254)(11241501184)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:CO1PR15MB1077; BCL:0; PCL:0; RULEID:; SRVR:CO1PR15MB1077; X-Forefront-PRVS: 0680FADD48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(396003)(39380400002)(376002)(346002)(199004)(189003)(39060400002)(46003)(5660300001)(8936002)(8676002)(105586002)(81166006)(81156014)(1076002)(6116002)(446003)(476003)(486006)(11346002)(2616005)(68736007)(50466002)(36756003)(52396003)(48376002)(53416004)(4326008)(7736002)(305945005)(106356001)(50226002)(2906002)(25786009)(2351001)(478600001)(69596002)(2361001)(16586007)(54906003)(59450400001)(47776003)(6506007)(6916009)(575784001)(53936002)(86362001)(6486002)(316002)(76176011)(186003)(51416003)(52116002)(386003)(97736004)(16526019)(6512007)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO1PR15MB1077; 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-ascii?Q?1; CO1PR15MB1077; 23:zXkzcCanG96eUJxsd0dJqt0vP0HDguTl76lDsEdId?= =?us-ascii?Q?4UU5DEDaYXtngpP4xYCXnGRyq6A7YvmEabA+jK/Pg9ReLDl5t/aQho3VorOt?= =?us-ascii?Q?tkd3XUcEwbeIu2tAwccYd79TLOZiAbMdxjqOQG9XakII1mOPKJznKVC0174l?= =?us-ascii?Q?tCQvq0jk7h0WcY36DYnMlwyEZMjUVWeM/SD+rzPQ0b4iYqDFw2jGGlOa+yn3?= =?us-ascii?Q?VP+a2zteh7Nwoen9HTJ4D6bSeoHCV+A77p3KWiWD1rDHokgRvXqDK4mQd0ZT?= =?us-ascii?Q?XfEe5CHJ5rQjE98zbjPVGua3nv+YX5yZXwbeg1M8i4E2dJfb52HEpeVd/i+2?= =?us-ascii?Q?SfF6300EygMVRup5D5gV8+Tj7kuZY1RInJ9+BQPAPFMmUT1DLwhRKhcoYSgi?= =?us-ascii?Q?i4GD7rrBUPR/Zc5LFEXtL3npDfNlBAIP0bqdHoEAAiL3b8Jli8TUP3wNX+zC?= =?us-ascii?Q?0bff9n5Sn7bwqwVfUOP7v5H53pf5y9/mpWa8QurInleLjBiC9Y2aFaPsHi10?= =?us-ascii?Q?ihjr7SlVLX/2VmdEi29EqE7klSgiB2ejyFVK51uH16oWCNknJ8i2eBLOb7Mu?= =?us-ascii?Q?mri1c9/IQiil+tQ3o8LG1FEPjOH2vMdpwdrmsHUcwQzX6oUD8hRwvWzoXt5P?= =?us-ascii?Q?kQ52goQwMM1Io/qmh3O78c/ojJVcz0paHXdzO3yzHPzBHOiSFV3XIupqQ7Aa?= =?us-ascii?Q?m4pT1Mx9cDjQPhAT9bBX9hBzXagaLBp2CFWHWv2070gfJkrExdpy/vMtFwi7?= =?us-ascii?Q?goESFrPZymgC7H/qNx5whFR0ST34/OCSOFFYQwdhMd0v1ziOfbn1o+zDcXkG?= =?us-ascii?Q?3UBEFW/MuXz6wqgif2ng/i/iDUVP7n89xwMCKpdJ/j5LzHyQSVfhXstMhjDT?= =?us-ascii?Q?Uq/XiyvjO7ohv1JeSxLvlqHseJUs8p7Zaw5E3LXEDoA2bag7kcu7V80oBR1M?= =?us-ascii?Q?2YLna9sojFnRfZwrQQpQbZEjSKMdWUyJUcaZ7fb/Xhhtgus3TgpXNrwcPaPp?= =?us-ascii?Q?S5OgP4vFL7CyaaYxsfzLUDIwj2udeSQ5I0O5HSP5MMnPCz8Bl26NzkGqIE61?= =?us-ascii?Q?UnrRg/H+HNAamPyLvkOEm0fJOnMpcpWO8oMO/zm7rmxH3f0eJiEVqiQ7mJ1J?= =?us-ascii?Q?PjKcJNusDlPW5vXbxZD8KPCmF7GRv5t8yz95PvAFd09Jr+YLrqmsRIkum4fO?= =?us-ascii?Q?8irGaJDS7gJFo/osekZ7kIPRtZKg/eILmb+PTNS4y2bM7F8QMttFOUMrWOER?= =?us-ascii?Q?McoAotmOB6ZFvUD/pif00+Q4q/uZzHnlsea1iHDXwwUrye3uB1FFlnYLWr/m?= =?us-ascii?Q?T3DS/+xV9T834XsIORlDudKhKNEqo8ofIUPK5LqXUII?= X-Microsoft-Antispam-Message-Info: IjHv05WZTe0beoS8lLPGz3jG3Djd9HMn125lOTmRXzgzXEeKBxNe6de/fIa8eSxd28k921irKPn+tw28a4zvrOcoMWXxnXKUnNs/+VYOiXS1ePhdmMx3hSxGCNHsclWWOFl/EoeCOaB3PXa2MJuhM+bxn3swynRW/SDs6zmNLMgA//Kx5b39jZ5sTnHDOvxY X-Microsoft-Exchange-Diagnostics: 1; CO1PR15MB1077; 6:/YhydX1s3DEvI9F/VffmYRLEN9254p/8ut6o43cbskZSqQ4xGXJ6QPAj+cxhAUcAXzz/hzOdknknW2BkNOz19brwer/VnXns8KfU/yfJCkT9zVfqKv6NQAVbpwDavlcg88nY72GhGoVYv+ZidT7KuItF0Aa8HgHP3Q9VsTmOnY/+eIEwPW/l+4avI4aAKPnMdnbezvIT72NeeS7NvdQE13BZwHcatOgXiY0fIIvyf+qvRxGddIWqSEYdeur2n2P1b1i6O1X2lbDwrkROgjzOfecC+up7h2w8ubiNM/fRsWO4ZZKlDsHsZCyMWF5KgTvnumpuu9WmIYiCTceLMHyU9W7ZokjU8Tov0qZQpzqv/BJ4WDUhb4hCNWSQ2EHQ4enPl7awtFiBFu+VOyuktq05YMuk6sgz5HiklRr0lpJU3Vv3ARP5vAPzGAzYeC4v64tgKZASCy8aPPl7LD1zxpvs+w==; 5:jd45Br0gF4neDPBRmwmu1+Us2cQTUd0L8DJYoxivjVvjLq1y6RGXKwuSaw4xdVge0iJqlayjspNCZirjXmK75XL+MU70l1BB4hou+PdDdE4iSfzjPZnjU8JBSALfcgyT/eBhQr94XxGOg//WMmJukwM78zHLAU53X0E4hcQ05ns=; 24:eq52bNwux1X0OhjFvuyoXwsrOlree4EZbR6omPP0uvJz3FnoT7qiiwjmTQ7V1BVLjSlEicdpIcmR7vatSSNvbGQ6pGri0Il2SFVsIgLjFLY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO1PR15MB1077; 7:UnLqalX9n7tbUN+2YNnHklG+AMNep9i5D58qPc4UcK3viov96wJbvnM2WPzRauvEm1r25yQmS7kDwvDnWHnNTMcVfu3VYuHJf/Mn/xMpvjR5bEx5lj7KoUZxcw+aluyStdbhBdxGJPQk6zjR2tM0ufJmqK9xecn8ZZvRE1d4k7nVzgZVErmN6bxhT94YpZD/C5ThK6GP2paTQvVIiBBSk8w/b37eiBOw7xrXfCHIMJC75sy5DKNDESBtf5WUFbTS; 20:K8nJUfVdVTX1tMoypdKpQPp/Vf5dMoDgWXXD44kPUiYuTdBf+jB3g9J5pAF7X3pWMOMQsDkTRyh3MAZEgXadoJJ+iB3CwJYN0H34kb6rA2iWhqgqbmrEBixpHJdOBOAVubqc8qCegZFbAtS0nxDGzaNs/L/V9WS9WGfzPXZU6Jk= X-MS-Office365-Filtering-Correlation-Id: bb544b37-c2b2-45d3-318e-08d5bfe7e55a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2018 13:28:22.8567 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb544b37-c2b2-45d3-318e-08d5bfe7e55a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR15MB1077 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-22_03:, , 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 There are two cases when effective memory guarantee calculation is mistakenly skipped: 1) If memcg is a child of the root cgroup, and the root cgroup is not root_mem_cgroup (in other words, if the reclaim is targeted). Top-level memory cgroups are handled specially in mem_cgroup_protected(), because the root memory cgroup doesn't have memory guarantee and can't limit its children guarantees. So, all effective guarantee calculation is skipped. But in case of targeted reclaim things are different: cgroups, which parent exceeded its memory limit aren't special. 2) If memcg has no charged memory (memory usage is 0). In this case mem_cgroup_protected() always returns MEMCG_PROT_NONE, which is correct and prevents to generate fake memory low events for empty cgroups. But skipping memory emin/elow calculation is wrong: if there is no global memory pressure there might be no good chance again, so we can end up with effective guarantees set to 0 without any reason. Signed-off-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Greg Thelen Cc: Tejun Heo Cc: Andrew Morton --- mm/memcontrol.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b9cd0bb63759..20c4f0a97d4c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5809,20 +5809,15 @@ enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root, if (mem_cgroup_disabled()) return MEMCG_PROT_NONE; - if (!root) - root = root_mem_cgroup; - if (memcg == root) + if (memcg == root_mem_cgroup) return MEMCG_PROT_NONE; usage = page_counter_read(&memcg->memory); - if (!usage) - return MEMCG_PROT_NONE; - emin = memcg->memory.min; elow = memcg->memory.low; parent = parent_mem_cgroup(memcg); - if (parent == root) + if (parent == root_mem_cgroup) goto exit; parent_emin = READ_ONCE(parent->memory.emin); @@ -5857,6 +5852,12 @@ enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root, memcg->memory.emin = emin; memcg->memory.elow = elow; + if (root && memcg == root) + return MEMCG_PROT_NONE; + + if (!usage) + return MEMCG_PROT_NONE; + if (usage <= emin) return MEMCG_PROT_MIN; else if (usage <= elow)