From patchwork Tue May 8 12:04:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 10386037 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 1B2ED602D8 for ; Tue, 8 May 2018 12:05:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A264286D2 for ; Tue, 8 May 2018 12:05:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F230E28D75; Tue, 8 May 2018 12:05:57 +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 F02A8286D2 for ; Tue, 8 May 2018 12:05:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 33BA06B0273; Tue, 8 May 2018 08:05:55 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2E9C26B0274; Tue, 8 May 2018 08:05:55 -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 1B43D6B0275; Tue, 8 May 2018 08:05:55 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f70.google.com (mail-pl0-f70.google.com [209.85.160.70]) by kanga.kvack.org (Postfix) with ESMTP id CE8BF6B0274 for ; Tue, 8 May 2018 08:05:54 -0400 (EDT) Received: by mail-pl0-f70.google.com with SMTP id o23-v6so1684561pll.12 for ; Tue, 08 May 2018 05:05:54 -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=98sfEoQVd0oMEoBswQEHyZVp+ybt2+rYSOW9jYLo+XQ=; b=HQmtBnxad2sTw6e5apzeY8HRVO2cESdvHim7+oeCJJFQPVaZWzYsAwUIF/1imTM8F/ l/7H7KSOvwsTt1aS2fw1zZi0fgM0IHgJgO3xLwpKMIsV+HA09ECNllr6aan9RdOall+3 6q5wmiKhx/bzkj2ThDJ3FRiU3alfItSFaQyYE6vs9bX97CF+Y48Cchj/tP5lI66ckqS/ TQyPIGRlXHTmUTWk6XXbTxiXOsVPsIAMkUWXEgYEB9hqGwqQ5AC1jimhd0cKALna3aEX e0OH3ZEEu8bSzRl3zoEO6yEpTo/GgtEF+mc5giO7PQeUdqyBh8GBVOSfTRJJkbKd/X3A FiKA== X-Gm-Message-State: ALQs6tCv46RgxK1zhT059qV51GEBITHVzjg8hlgoSU2c7FzGUtcOr0Pq ekaQW8OtRI3TX6lQETPJqQ9XcW3vmHC1mecuOJKdFaJh2DP9AHxRHPkQ01Ovq2q3mhhbYJhzaX4 m7JHkH275X7snXfMtwYUCaA//41zNu82gnWkzqblG5wAsJUS8i2jv3brdsTXZPKMnXA== X-Received: by 10.98.31.200 with SMTP id l69mr40022279pfj.49.1525781154353; Tue, 08 May 2018 05:05:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZooeR+zsYXm5//Cis0Hiycl9/e0UuIKm8l4mYbhZU+YOW5iw2Ypg7BvF3pzOYpRsjh/p428 X-Received: by 10.98.31.200 with SMTP id l69mr40022219pfj.49.1525781153344; Tue, 08 May 2018 05:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525781153; cv=none; d=google.com; s=arc-20160816; b=wHwzx1SjO9fYqGe5/cNidpPikofGdQK0bXNWc6nFeyJpmGm/UVBiBMMt9WkV3vsRLI LsSCRPOmWnuZaTSPnT2uMYDfoj92KdbszgyzkznMDBBZmRxc1U3t4Is2lPNRqHj45YLf gMxNEr5M/ExkDAXjY7xBCHfVsLkqMEHYv08eTmi3IL7XsVlGnn66LDI7/znA+LFDh1W4 WoUQCdxeT7DGSFkGzv/mYnYi2Vpl6vn2M6XbMhrJbV7JPsgW1aEESQeG7Oh0MeBoalne 3R7IX7SUE3OX5oI+k4GoJzSFZbpNC2g81QsLf4qnw/WR+owz8Ggb93jsUPglaWzCDHWa R9eA== 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 :arc-authentication-results; bh=98sfEoQVd0oMEoBswQEHyZVp+ybt2+rYSOW9jYLo+XQ=; b=0U7+by+0dzviA1OFHe7uY+tXUQBvZZeyPJAo9si31JREoZtQgg0YYLjOrsEBGIkWtK URE8aRmqM+qnrRbOEaqajO2OiCOZ4zjdi4rfFmbt/O7A4PkqcTkC/PQemu0weAWmytvf P/jh9BmijLdxMaFpNSeWU1378v1hsttdKKv67FYN8RhtE6WnINwSE10Qq5zeFVLYV7bZ WYSWEeMotuLzf0Io0qL5j7/MnwCrD0ztc+Now1I6cSc2AJP20Zvz2qeT2+GI2LSx6ARg zxURdG7ToUJrmKmXYkdGBcSdE4DXe3wFeHDX2yleFGQpKgRkNoZY46kXkagDpAtmBtfb JV7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=mWrxrOU0; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=BiVn4reK; spf=pass (google.com: domain of prvs=866690a21a=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom=prvs=866690a21a=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 f4-v6si24745390plm.448.2018.05.08.05.05.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 05:05:53 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=866690a21a=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=mWrxrOU0; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=BiVn4reK; spf=pass (google.com: domain of prvs=866690a21a=guro@fb.com designates 67.231.153.30 as permitted sender) smtp.mailfrom=prvs=866690a21a=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 w48C3juw010612; Tue, 8 May 2018 05:05:39 -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=98sfEoQVd0oMEoBswQEHyZVp+ybt2+rYSOW9jYLo+XQ=; b=mWrxrOU02gMlxEyVrJK5Ipjmb8vxni761L2t7do7P7nrBR/NczUZ6lFQD0m/+ANNleI0 lXXTQomgvh4WnoPAin7wY+9n2kIjddu6OfvalvL1H6rauNjP/XzJ6NK7r1eGdf7H5tPp uMQ5j6q0/KpR+iploGhLWqlUQDEaAhWsH1c= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2hub7j81wt-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 08 May 2018 05:05:39 -0700 Received: from NAM01-BN3-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.16) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 8 May 2018 05:05:37 -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; bh=98sfEoQVd0oMEoBswQEHyZVp+ybt2+rYSOW9jYLo+XQ=; b=BiVn4reKB5XFuIQ/TzkYTfYI2BCYqbWeKCmiTN9RyyvkO7TAlaEpu5rcsf4rxegwvuPtVzQbYNjxyP3LsTyKURirPc+0GIU/9uUNUGymMwfYBh1+vmgCz3oqsXaCCV0RPAiJ5s3Wsi9868frT54Xlkt8aDIrqkDGj40GzVZtCyg= Received: from castle.thefacebook.com (2620:10d:c092:200::1:bddb) by SN2PR15MB1088.namprd15.prod.outlook.com (2603:10b6:804:22::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.20; Tue, 8 May 2018 12:05:30 +0000 From: Roman Gushchin To: CC: , Roman Gushchin , Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Konstantin Khlebnikov , , Subject: [PATCH] mm: fix oom_kill event handling Date: Tue, 8 May 2018 13:04:02 +0100 Message-ID: <20180508120402.3159-1-guro@fb.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Originating-IP: [2620:10d:c092:200::1:bddb] X-ClientProxiedBy: HE1PR0901CA0048.eurprd09.prod.outlook.com (2603:10a6:3:45::16) To SN2PR15MB1088.namprd15.prod.outlook.com (2603:10b6:804:22::10) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:SN2PR15MB1088; X-Microsoft-Exchange-Diagnostics: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02x4aj0dKkAvdYlgeGFB2vJrtxqhcnfUe5zrmBXFhBk+tVvaO6Uqorc5MYv9IWviNkZSrJ6DQaFmRrM6hRiN5yURQXPTwa6l8Pajt2qeOiEZhRzPxgHTtNJX/6hBupViwXDo7A8MdX7nRSNtMybo5P+rBQt+U2Zj4kSp+Aj1fo4YJ8mBtBhj2Wt2cjUWEayeHex6uaSsBxin1BWrpyk3SEbZ0uGz/9vLxIbrJIxgE6e6M6s83Alw9Uu9JIm/2UqpmhOlQD4OLl71PsGVx/qE+Zkd0Obq/moOWgtta9RUJfrgIPV8+OvmaLMbWhnv/FypcUGZxnpyqjT+EXdQGdohvTfsrGikKOqM7/JNSRcTURTO; 4:ZMIYtcoCdrLydxTQpDVYlv25l5bObYTYqV1VMm/GVwTxd/6tMDGdvcAExsQbmLooLppoy5LaFDg0Zj04FLq5EwPTnB04nPDwv30iaA3F0NMbO8GfRRVgCAnI3uPKRKBN5s2XZqkMbEGXNwTymVg2Pc1FHyosc5roCmscxfyiK+SRku2H1mQy4+nb7rERfOuqIcxN8dSRQ9dFmZ/67LUQMKaHSSRVeAC3BwiuRZCcC9vzVqngSW24uVhAl6M4bexLPJEyhMokSodiuzgxyZj7Zc+Fil/lHB916xF1wClzXPqhH18y1TCHvaVciLPSAL+xqvpNK9r2Bqvz2hf6UQ7fmOLQW0qWcfIGYWCOKHklA2v4uHV5d+zzhe4IEyf//VnT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(85827821059158)(67672495146484); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(11241501184)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:SN2PR15MB1088; BCL:0; PCL:0; RULEID:; SRVR:SN2PR15MB1088; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39860400002)(39380400002)(366004)(396003)(346002)(376002)(189003)(199004)(69596002)(81166006)(186003)(81156014)(48376002)(1857600001)(4326008)(46003)(52396003)(2361001)(316002)(6486002)(1076002)(50466002)(8676002)(6666003)(8936002)(54906003)(305945005)(47776003)(6916009)(16586007)(2351001)(6116002)(25786009)(68736007)(50226002)(2906002)(478600001)(59450400001)(53936002)(36756003)(105586002)(86362001)(5660300001)(6512007)(39060400002)(4477795004)(486006)(52116002)(476003)(106356001)(51416003)(7736002)(6506007)(386003)(53416004)(2616005)(97736004)(16526019)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:SN2PR15MB1088; 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: =?us-ascii?Q?1; SN2PR15MB1088; 23:iWoLvcRYdTyRJWedMIOGse346TJBToVHog56sKl36?= =?us-ascii?Q?IYYLOn+xcCDwID4d0eake0J+7qbCvdRfXLiN8tI/Vj/mpbThJti/7nz+8ak5?= =?us-ascii?Q?NonPK64ywejG7yMpklNERZbhaTF2lS5557OeftzbtwJHv8MxG8EY09eKe2Rz?= =?us-ascii?Q?Qe+C7Gw3F++FAymlBkv4paiVP0hTEwf4loODL/VSYb8J+L+m7fHHeEb2uALn?= =?us-ascii?Q?H/LJ00W/E9nLsSQQb0b9UbramWd92OJUvkY5fQ2zAJLDq9KrvlB0Ux9BB8q2?= =?us-ascii?Q?SNnM2I0f+Xh0IzQ7s19K7XAEz28HFgwvhblcHgyG7vjjG+rBc9v0wOU+5Vx2?= =?us-ascii?Q?1W8OfzuqL/2zI07UlqlyAlGvGFh0RUDz3aVRyHbu4ynxvyTEEuyJZR5k+EIh?= =?us-ascii?Q?mI5CTzLDhjkdssUvr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DiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR15MB1088; 7:Caf3Lh1acWZ52QMkk9gbtxmF0KSw8PndVgRXwrgW3RhLnTXQ27Ms0O3hc0HrAi2Ed/LQPqme/plqYoERWw+D+cwTRnnSrISuFJ1+5QR4j/OTLm/Q0wcpbvkGfcCBji8DwIWj9ELoi3LPa4eyRX1O6oG9GmZ8PFcY2xd2CklXBK6LjJhytrdcUPRL0mO588FswwASleIK9yVI4W2g/+q9nMeYOOj4vCnuNQK8Fon/Sej2WRjPt/nyYStb7oH4DPNZ; 20:m1aSACAYhTg1ZqzuQ+XfAH2OXWCPXOHQsZb+QrzITiNW+cPPmHa4IeFS1H8RUzZylwjQ5CitgN6xSX4pkJNElphZRnKhMQTRd3OOWjogDKNoKFkEBn4qzr7aLhgcSs61foS6q3qp8t7DiCaUMYHaZiuWmaHB3uU4MKPsbsl4gp0= X-MS-Office365-Filtering-Correlation-Id: 74dac825-86ad-4333-aed8-08d5b4dbffc1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 12:05:30.2638 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74dac825-86ad-4333-aed8-08d5b4dbffc1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR15MB1088 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-08_05:, , 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 Commit e27be240df53 ("mm: memcg: make sure memory.events is uptodate when waking pollers") converted most of memcg event counters to per-memcg atomics, which made them less confusing for a user. The "oom_kill" counter remained untouched, so now it behaves differently than other counters (including "oom"). This adds nothing but confusion. Let's fix this by adding the MEMCG_OOM_KILL event, and follow the MEMCG_OOM approach. This also removes a hack from count_memcg_event_mm(), introduced earlier specially for the OOM_KILL counter. Signed-off-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Andrew Morton Cc: Konstantin Khlebnikov Cc: linux-kernel@vger.kernel.org Cc: cgroups@vger.kernel.org Cc: linux-mm@kvack.org --- include/linux/memcontrol.h | 26 ++++++++++++++++++++++---- mm/memcontrol.c | 6 ++++-- mm/oom_kill.c | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 6cbea2f25a87..caa8b70a85f6 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -54,6 +54,7 @@ enum memcg_memory_event { MEMCG_HIGH, MEMCG_MAX, MEMCG_OOM, + MEMCG_OOM_KILL, MEMCG_SWAP_MAX, MEMCG_SWAP_FAIL, MEMCG_NR_MEMORY_EVENTS, @@ -721,11 +722,8 @@ static inline void count_memcg_event_mm(struct mm_struct *mm, rcu_read_lock(); memcg = rcu_dereference(mm->memcg); - if (likely(memcg)) { + if (likely(memcg)) count_memcg_events(memcg, idx, 1); - if (idx == OOM_KILL) - cgroup_file_notify(&memcg->events_file); - } rcu_read_unlock(); } @@ -736,6 +734,21 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg, cgroup_file_notify(&memcg->events_file); } +static inline void memcg_memory_event_mm(struct mm_struct *mm, + enum memcg_memory_event event) +{ + struct mem_cgroup *memcg; + + if (mem_cgroup_disabled()) + return; + + rcu_read_lock(); + memcg = mem_cgroup_from_task(rcu_dereference(mm->owner)); + if (likely(memcg)) + memcg_memory_event(memcg, event); + rcu_read_unlock(); +} + #ifdef CONFIG_TRANSPARENT_HUGEPAGE void mem_cgroup_split_huge_fixup(struct page *head); #endif @@ -757,6 +770,11 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg, { } +static inline void memcg_memory_event_mm(struct mm_struct *mm, + enum memcg_memory_event event) +{ +} + static inline bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg) { diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 10973671e562..38717630305d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3772,7 +3772,8 @@ static int mem_cgroup_oom_control_read(struct seq_file *sf, void *v) seq_printf(sf, "oom_kill_disable %d\n", memcg->oom_kill_disable); seq_printf(sf, "under_oom %d\n", (bool)memcg->under_oom); - seq_printf(sf, "oom_kill %lu\n", memcg_sum_events(memcg, OOM_KILL)); + seq_printf(sf, "oom_kill %lu\n", + atomic_long_read(&memcg->memory_events[MEMCG_OOM_KILL])); return 0; } @@ -5529,7 +5530,8 @@ static int memory_events_show(struct seq_file *m, void *v) atomic_long_read(&memcg->memory_events[MEMCG_MAX])); seq_printf(m, "oom %lu\n", atomic_long_read(&memcg->memory_events[MEMCG_OOM])); - seq_printf(m, "oom_kill %lu\n", memcg_sum_events(memcg, OOM_KILL)); + seq_printf(m, "oom_kill %lu\n", + atomic_long_read(&memcg->memory_events[MEMCG_OOM_KILL])); return 0; } diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 8f7d8dd99e5d..6b74142a1259 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -868,7 +868,7 @@ static void __oom_kill_process(struct task_struct *victim) /* Raise event before sending signal: task reaper must see this */ count_vm_event(OOM_KILL); - count_memcg_event_mm(mm, OOM_KILL); + memcg_memory_event_mm(mm, MEMCG_OOM_KILL); /* * We should send SIGKILL before granting access to memory reserves