From patchwork Mon Sep 10 21:56:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10594811 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 6D5A814BD for ; Mon, 10 Sep 2018 21:56:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55B8C291B5 for ; Mon, 10 Sep 2018 21:56:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47D0B29215; Mon, 10 Sep 2018 21:56:54 +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 4ACDF291B5 for ; Mon, 10 Sep 2018 21:56:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C54A8E0003; Mon, 10 Sep 2018 17:56:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 376918E0001; Mon, 10 Sep 2018 17:56:52 -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 217698E0003; Mon, 10 Sep 2018 17:56:52 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f71.google.com (mail-oi0-f71.google.com [209.85.218.71]) by kanga.kvack.org (Postfix) with ESMTP id EC6008E0001 for ; Mon, 10 Sep 2018 17:56:51 -0400 (EDT) Received: by mail-oi0-f71.google.com with SMTP id r131-v6so29063785oie.14 for ; Mon, 10 Sep 2018 14:56:51 -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:mime-version:spamdiagnosticoutput :spamdiagnosticmetadata; bh=MGZdVmRmN+xAVRkWq4mvTV6wV+JEDsh8+laIrWHOoHE=; b=ElRYyd3cpJ8/Wu6BGVx8UrRaLF2k9+z2Awc8BlOwEKAkWXzouiZFZ04LU2yN50ixSe vh0tJQp2uR9M/RZs+CIBXuwdzVEc/WrzsDRO3yqE+ykyDbfVIN7C4/HCxlQ9Ttjn0zBS SfR6USUl1emtHJmLb8cH/vYmlJ7DNgL1OQZPncX4Zi9YAJrmEwKOi3YD37HyksXoHEk0 ZKlfW25ieylLKOyVYqGXQwyLfPRboOyOZMzeJEuqg9+tVl+JIz4IsErs509KY/nyCLFX gKd1wDADmACsipWoT71kmpGl9Z5nRdndjPaj3L7IJPW5m7QS27KQIOKJKSunJdho/avp kALQ== X-Gm-Message-State: APzg51BzE7dN5FRkgBDFrwnjyo6KMzEbleU11MLXc4zcGD8WFkH5sHto ML/nPBvnx+s1si9eqzBPoJH8Ku6fl2D+N1KSUVHd/5nNPJCjXOeMeDZ4MmgK9SRpSSza9vb9isC 6M9FiaWMuYCC6o+hzP4e9Ycs0N1AJ5Mx6oQmJ3VVweM4yPqZpfwGK9dqAWvCVhaa5/A== X-Received: by 2002:aca:190d:: with SMTP id l13-v6mr24609129oii.216.1536616611683; Mon, 10 Sep 2018 14:56:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZwnqh9l01sJnkryQ3h6HuXhz/J52ZyxEzYZFgezhgAisDfr60+241EFn5OYHnc5QqcXBQO X-Received: by 2002:aca:190d:: with SMTP id l13-v6mr24609087oii.216.1536616610975; Mon, 10 Sep 2018 14:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536616610; cv=none; d=google.com; s=arc-20160816; b=h9e5T7QnBIOOh5/kW8+yEYtJPM0/eaftYeK16ONqL9xOpm4G82hviRSeTATPYXJ4Mi 9xxOR37/rhx3gDheXGI/t/Tm+nYUfCfx3elwXBjkASq6RiXOczElM8k9W4J72BTXw2KB jnF5SmERcA74dsyCgCQbVpX5BvNBD+qWrrIYm3VRhpyueEhlszrbGqVYJy4jgcutLFQ0 05OLcPdh6xdULnJWvRnXEfWE+9j2JqvGO0U+yVHIPGOl8QOGDdO/ua1TxTMK/txgNs37 LHwx3d1xg1cVu2WxB2f32wsgkhM3Y7n3ZmTNeHCUO0SfOnkC4LmexT4TztVvDMo4B6xA 6EIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput:mime-version:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature; bh=MGZdVmRmN+xAVRkWq4mvTV6wV+JEDsh8+laIrWHOoHE=; b=og9jOUKvT8tQzANoldJos6Dj17qq/vTzR7nzdKCgWPK8aqE03matiwh75vS15I5AXl /JE4Bn7tz3Pk1kmoKjy2rXahCnQumNZtpql4viRvboLGDBTAwJ2MXdhSgxnQzxzYcIoC A/J8uEgM8+hl2uggplDlGArfE8QL9fZwk2EHFN4HAqB0R0ARqjNnlTOx/I98xrKEeEdT FPXGJR9Dsn7iV/3pTlG4Gj+LbzHBsPoy1+WCqRFPDEzDhmCzsS19J6na4XrXGxwdxwKn sr8Jha5xC1rkb1oAn1TILyDGafLlKyX+pnxBUeGoDnkxJcEuetr4KO5anrcrG3UbkTMz By2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=KBbuiMxj; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=XzRL1AwT; spf=pass (google.com: domain of prvs=2791bb15e1=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom="prvs=2791bb15e1=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 v6-v6si11588568oix.348.2018.09.10.14.56.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Sep 2018 14:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=2791bb15e1=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=KBbuiMxj; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=XzRL1AwT; spf=pass (google.com: domain of prvs=2791bb15e1=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom="prvs=2791bb15e1=guro@fb.com"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8ALs0fH030472; Mon, 10 Sep 2018 14:56:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=MGZdVmRmN+xAVRkWq4mvTV6wV+JEDsh8+laIrWHOoHE=; b=KBbuiMxjardVlLWaM5ScyhFIpIlsoL5w2F6HhlsqdDCqdI2bOZhlrBA8ZTaC8CDj1sNx 15tekQOtD+OQkH1rjrunphb1XuNzOw/uxfhuBgL+2dVT4nXX1nJLPoUNK/CQ6AzjOYOw eCXeVTkq4rRyNa20GQqBLjj1Ee3QMQegIY8= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2mdy81rayv-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 10 Sep 2018 14:56:47 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.19) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 10 Sep 2018 14:56:46 -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=MGZdVmRmN+xAVRkWq4mvTV6wV+JEDsh8+laIrWHOoHE=; b=XzRL1AwTOdnvYjSyt7/10a4WJhckc8HDbcSwGKKSnWCXGv+LJv2hY6RRsgPXFkq86vg2V0mC2pPLrV29+HqXf5B9AzEeDbaMtNEAlJnPWSivqgsiYXrrXjuNFGHvO4TkQe9Fmoggf97k3P93kRKeAJpUMzIPa2O11S1PShM4wg4= Received: from tower.thefacebook.com (2620:10d:c090:200::6:d788) by SN1PR15MB0176.namprd15.prod.outlook.com (2a01:111:e400:58cf::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 21:56:43 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Johannes Weiner , Michal Hocko , Vladimir Davydov Subject: [PATCH RFC] mm: don't raise MEMCG_OOM event due to failed high-order allocation Date: Mon, 10 Sep 2018 14:56:22 -0700 Message-ID: <20180910215622.4428-1-guro@fb.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [2620:10d:c090:200::6:d788] X-ClientProxiedBy: MWHPR12CA0050.namprd12.prod.outlook.com (2603:10b6:300:103::12) To SN1PR15MB0176.namprd15.prod.outlook.com (2a01:111:e400:58cf::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c498638c-4dbd-4eca-9a02-08d617684c61 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN1PR15MB0176; X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0176;3:Alohij6mtKj1/V0dMU/KJjNDBJkdONpX2//UAtQzMJY5wF0CKxrfw08dQ6YyM2yLKZTvPTLHrdb2x8AnBl7OuvlvInl6kdGLdp7AMG90rK/a/XYfa+A7FZ6tLIxWBP3EZbv5jMgIUiIHd77A6AW7BAIlv87BUB+kUzpfLrr9HXq/E0ymlMREgscT9qgTGyFM28NtskiEYR/NHAt6cgjnIk7xEqNBlVYw+8Jg6ge+/Wb/7YpyEtQtmVa71Lx6/sGo;25:3QMdLZrEVV8rBKeoRsN6fwkym6TLkdzykXCgI39ts5YhVtbzhdJU1HsoS3o+1NrqMNwvb1wJ/oIQ415Heqp9qUy5pPUMqkV7vqMMemWO3e7pO3toLKpaxdO2vC6HazP3hodqEErk+VsAaZMPL3eochKG7ZdLmbhoT0f5Fd1HKqh91JLDR7eU1ILemlEytyjVRiKm5luQ6Kbf23plLtGq7bJ7o19IpDvIgDbRo8Uc9ZdDfk8/AwO3BapGFh7Y6tNmiSNlNszHsa+yBPq6YWTY80Oy/iHQDZkhEsyzO4G7QtMe1BgJLJAtH2qkP9Ilsxq3quHFN/hagvC+N/nZkxgSDw==;31:OFBprtoAEXm+jhC+QM3C+nbnvlqLQTStdduUliCIfTJ1jP/4ZWj33TpBCVoI8xy0up9w2SuhUwL4NcvBvSJKVafUDWhlD/TeDyQ/oUzU/XG2uXv6H3op5nKc/ftoPx35GlsG110alQUJzLISuNbDeOM0sLVzk8w8Fa6k65dUADgVnbBRiWfkEU51S7b6ZAiROouPeEvzIRY9FO0mJcPqutLgQ5w1IkwNECKoZiAnYsE= X-MS-TrafficTypeDiagnostic: SN1PR15MB0176: X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0176;20:SxHkTZIE7rVMcy8J+6aq/jjNcwEidPa6S284MJ+DtCHURD5IAXTyzGtnQUOrpWc68fNKjdVoGuHt1C/+7LogqFE+9cgeXR06pqB0fkxhb/xisWpunV1eVpnE9An25Tm4GAn2tuD/KwFvFLx3786jFP4zTHIbeYKpjx2KEVTb7Yicow4MfdVcfJu4SGPzmwJjBO1P9uSI8bK3mxEhWyPQQlxkKCZWQb6iQfrN6FWCd7EoVLlEAkqFWRY/ebSgUvXgiZ2Fd6qIJ0fVnlnPeExR9no4ZptTlBV6BhS1mJaE2pFcNJsT+J4XD/rNfqxNcqk8OtwQNbLRKumbRtqEGceT2CIygC9Ahy/hoxvCoJSvEWFMoQ+vd0eO/iFHTeh5WqpRzPEv1p44w5mdSJ8zE7OZ3sOq7094xYzOTJCPDd31vVSFe4i/Br14PmLUa/6COgu6dbdkOj+2uzl1pARR1roG0WqY+fNCsUEiY44m/xH7ZfDdTqir409orA29iOchbyaj;4:5vlnhZ/u3tXONTrbJPxMuAE62AMIAT6axgDe4ffAP61XL1MbMBo1ML3KOnW3kaDCIM11X8thMwBKrIqrIW4h7Tmrq2XyiEqA36sO9UVIRsWlSudyg+7dWiOoJrovsiQ9SeUryyr42/TPwJwqPNt8ZY1cxyvF1G/Mi5gtE79gCXvx/CzEMnsknuHlUpJAg+vinB+uNiQjzswrCBIm4KU3XbU1CjUMJel0lfx/0Zd1wldHowdXWH7vDERT87B2t78p4C08LdVejrYJMHw0B3MTPXL9i5NtlFMXQ0vT7OqpEwEZlviK4jsRss3L9EyboJwqteFGTN/OLXOhoQ2a9FK2K8zpIOwPKZS5rG2UVmUc5IY= 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)(823301075)(3002001)(10201501046)(3231311)(11241501184)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:SN1PR15MB0176;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0176; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(136003)(366004)(376002)(39860400002)(346002)(199004)(189003)(52314003)(316002)(2361001)(2351001)(36756003)(106356001)(105586002)(53416004)(54906003)(2906002)(69596002)(16586007)(50226002)(47776003)(7736002)(14444005)(305945005)(68736007)(8676002)(81156014)(86362001)(52116002)(51416003)(52396003)(81166006)(8936002)(6506007)(16526019)(39060400002)(48376002)(4326008)(97736004)(46003)(6512007)(53936002)(186003)(386003)(1076002)(25786009)(486006)(2616005)(476003)(6666003)(50466002)(6116002)(6916009)(478600001)(5660300001)(6486002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR15MB0176;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;SN1PR15MB0176;23:g0PTZaSbYfc0l7o4t6OAIEwjIJBJ32YJ1XbJsJ4zNzVESYFywqQbBy/3AbhlgPCq5tj8kAol8a0WuQMYNC9IwDtl7dZjH423IOTYtpUC/gLfSV5rBBiLFfgBL3ij+gfiuXdADjH9j9yMrP/TT+d3L4Rt9AgY6uBCE9aNQFN7d1batt1k/dK4/Dr1P35RA0PDekz6BqcMMR/8rt3MLyM73avfsiw7NJeWW9be/otQ6LsleAlMREg/whIBfI+hdzrvlwYP4KhivObRFy3DZyd3qWKfJ3kpzxvIykbJl9V5AIqy78o5oj9ltEMuVLAXsYKKul0KSuGCqY2MiNT5XaDkSveSc68rZfXGVtOf6Z9TurtV+TOG+21J3nNryahmZCsAJLWCXapdGB/GK3hhtA23sK10A3FdyRRt7ZIEGQz7yU4qDb8YgnR3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thTwjTqGCs/Eow5fPZqrnxykOIW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0176;20:4FGzfvdtEi0fuRbJfU9HtD5WxFAn0MWst1dZ9fgiRMgU0Yix6wbB9Bhg2LzcbgvO4D9Fc/GwIfMs9Tt2ow38LCqhed3at/P7wvcKqkxLuxMkAGnk5qftOIJqEPTv6LeStkEXHgA1SqMjG6oeSKlek0Xg0Vn8AliDnmRJUhrZkV0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 21:56:43.8287 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c498638c-4dbd-4eca-9a02-08d617684c61 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR15MB0176 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-10_10:,, 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 The memcg OOM killer is never invoked due to a failed high-order allocation, however the MEMCG_OOM event can be easily raised. Under some memory pressure it can happen easily because of a concurrent allocation. Let's look at try_charge(). Even if we were able to reclaim enough memory, this check can fail due to a race with another allocation: if (mem_cgroup_margin(mem_over_limit) >= nr_pages) goto retry; For regular pages the following condition will save us from triggering the OOM: if (nr_reclaimed && nr_pages <= (1 << PAGE_ALLOC_COSTLY_ORDER)) goto retry; But for high-order allocation this condition will intentionally fail. The reason behind is that we'll likely fall to regular pages anyway, so it's ok and even preferred to return ENOMEM. In this case the idea of raising the MEMCG_OOM event looks dubious. Fix this by moving MEMCG_OOM raising to mem_cgroup_oom() after allocation order check, so that the event won't be raised for high order allocations. Signed-off-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Acked-by: David Rientjes --- mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index fcec9b39e2a3..103ca3c31c04 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1669,6 +1669,8 @@ static enum oom_status mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int if (order > PAGE_ALLOC_COSTLY_ORDER) return OOM_SKIPPED; + memcg_memory_event(memcg, MEMCG_OOM); + /* * We are in the middle of the charge context here, so we * don't want to block when potentially sitting on a callstack @@ -2250,8 +2252,6 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, if (fatal_signal_pending(current)) goto force; - memcg_memory_event(mem_over_limit, MEMCG_OOM); - /* * keep retrying as long as the memcg oom killer is able to make * a forward progress or bypass the charge if the oom killer