From patchwork Mon Oct 22 07:13:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10651771 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 846461508 for ; Mon, 22 Oct 2018 07:13:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FC49201A4 for ; Mon, 22 Oct 2018 07:13:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63A9120499; Mon, 22 Oct 2018 07:13:46 +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=-2.9 required=2.0 tests=BAYES_00,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 E1E10201A4 for ; Mon, 22 Oct 2018 07:13:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40BF86B0008; Mon, 22 Oct 2018 03:13:44 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3BA736B000D; Mon, 22 Oct 2018 03:13:44 -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 2D1846B000C; Mon, 22 Oct 2018 03:13:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by kanga.kvack.org (Postfix) with ESMTP id E1C366B0007 for ; Mon, 22 Oct 2018 03:13:43 -0400 (EDT) Received: by mail-pl1-f200.google.com with SMTP id w12-v6so17638894plp.9 for ; Mon, 22 Oct 2018 00:13:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=nh6TfIAAE16IGcEuFepCvkCmMAK/HAXyj6StssKZLCY=; b=ZLyfU27m3hWZM4RvBsH3kuMzW4n4tDpNs7Fn4yRa9RwS4UAvAhMSRkiyYqI5lysLcT mXklZGKNDlBFDTHLRqcaafkM6t++x+t7sZTy4LBI2bqmHKBZZdqGPq3uoXnYr9f5ZnmM 599JmiBYnvnuiOhxUgeQt/A60mlEdAT623eq0XCSgt+KDn4fZRxnjwQ0PKFhARhK83uM ymUO1Cy37P083dnR5FH3y5bxiEAKkAJQoNMfsG0EIyG6lxgnoT4hroV7lHjEbs9vsyYL JV0/aDMtkFyulhBpxgR8Ao99M9TaAMx63FO0/j+AXyR8Oh5HyOFV4yncwrWlIExzsQ9Z zT3g== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: AGRZ1gLwCxNhqrivD8nt4J+nWpNH6GQHHaQr8DsLQzlbBn1oG1+ShKyN sJyWyW0BeOSklWEK8kTpJqYA8jFPJdijtGjSeo0GST5iIRZ1V2uAwwxEOFJQXi/Xgvv6DXebgrn RSlqqkijVwteozc92wLMk442PXEshajLxRdMUHBv9qaeBU+Ha78tyw7owKXJtMTejb304RpEC/L JT9QkmRaKs8yyhoqW2ojTtEzNzrF/WCdKYnCVu9YFXkS6BsOst5iIYJL/FymbkAznFnq8x0mPkJ A9ZeDS7rJcCrXvMWAjw+cUhJJYuqUe9z1yYcDy5MxyxoCPUOadnw+3KaSX8UcVpAzWHm/3LhfWd s/NfFJlXslT50DfHm4B0Q5+j4S22WM+661CNsjIjTJGo3SzdeWqQUEP+KTnErM0fOSgMyxzNmg= = X-Received: by 2002:a63:2045:: with SMTP id r5-v6mr6668337pgm.328.1540192423533; Mon, 22 Oct 2018 00:13:43 -0700 (PDT) X-Received: by 2002:a63:2045:: with SMTP id r5-v6mr6668309pgm.328.1540192422822; Mon, 22 Oct 2018 00:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540192422; cv=none; d=google.com; s=arc-20160816; b=sQjxamK98tFD9RyxpQ3Umou7upK+JsZN+iOTHL0mhJVlP8D5eFE1826d0HqnBdgx3r BKrb2vHwbI9ZqIg/2Yb2xugVZtiwVTUBgCrgy/d22TZW++gDul22CXfsLJ+nFZGZPY8N csFG6pdF5QTyR0kJXHxMdStZnExfUprXnkMZMvNaD5RWz2awbGWT493/gHYJ7/l8hY0l Zj41iVl4AJIxG2a/umlqFSrNJpJHzCjbzkHJOZC0UQBy0pMqktewsOa0+55S9UJ2mNqR +CoGDU0jIX/GnYDMU467Y3kfe927vXsclROujf5WFokUkNCdogDYwAlxUVu0/buWX23g D4rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=nh6TfIAAE16IGcEuFepCvkCmMAK/HAXyj6StssKZLCY=; b=qDjMnaGmZMnpPYHAKvJ0RbPv6iywjUz6NALOq08Gw1rp55VEeyUTTUREWBUqjipdyY xoOaBGnem6/tnacYHi8qL1dClILYIAxbv/1PXq8ThELw9Bow+7aRSnD/QoHBCiD/9mVw fDtmausWgIcmYu5ucxubKmdTpthpOIdrqAT0jqDoAQ3psCfMy6Q1omVCaf1o1Gk//Jvx /s8R+DCjti7YAWyO7vaPxpn9Y5bkf4mkSxa9Jl7jH2XCLDi4vs6B6fH3J3q0LkplcFhL KlnZIQAsTZBRy+zeiavFfkOLagAK3gRg7pJkmUa3C80OUX0lQUKDYrlQ5hOzRERlGYSR v0sA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e2-v6sor20005698pfb.55.2018.10.22.00.13.42 for (Google Transport Security); Mon, 22 Oct 2018 00:13:42 -0700 (PDT) Received-SPF: pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Google-Smtp-Source: ACcGV61sNTv2hP9X+aRVQzT807Pkr7WqK6I4GYWbREGx1dxf5Pui9ID4vSxD8kgaVDsPxeQBnUwtfw== X-Received: by 2002:a62:ca4d:: with SMTP id n74-v6mr43743422pfg.10.1540192422214; Mon, 22 Oct 2018 00:13:42 -0700 (PDT) Received: from tiehlicka.suse.cz (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id c79-v6sm38097542pfc.92.2018.10.22.00.13.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 00:13:41 -0700 (PDT) From: Michal Hocko To: Cc: Johannes Weiner , Tetsuo Handa , David Rientjes , Andrew Morton , LKML , Michal Hocko Subject: [RFC PATCH 1/2] mm, oom: marks all killed tasks as oom victims Date: Mon, 22 Oct 2018 09:13:22 +0200 Message-Id: <20181022071323.9550-2-mhocko@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181022071323.9550-1-mhocko@kernel.org> References: <20181022071323.9550-1-mhocko@kernel.org> MIME-Version: 1.0 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 From: Michal Hocko Historically we have called mark_oom_victim only to the main task selected as the oom victim because oom victims have access to memory reserves and granting the access to all killed tasks could deplete memory reserves very quickly and cause even larger problems. Since only a partial access to memory reserves is allowed there is no longer this risk and so all tasks killed along with the oom victim can be considered as well. The primary motivation for that is that process groups which do not shared signals would behave more like standard thread groups wrt oom handling (aka tsk_is_oom_victim will work the same way for them). Signed-off-by: Michal Hocko --- mm/oom_kill.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index f10aa5360616..188ae490cf3e 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -898,6 +898,7 @@ static void __oom_kill_process(struct task_struct *victim) if (unlikely(p->flags & PF_KTHREAD)) continue; do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, PIDTYPE_TGID); + mark_oom_victim(p); } rcu_read_unlock();