From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6473C4320A for ; Mon, 26 Jul 2021 13:44:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4B85E60F55 for ; Mon, 26 Jul 2021 13:44:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4B85E60F55 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A7F586B0033; Mon, 26 Jul 2021 09:44:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A2EAA8D0002; Mon, 26 Jul 2021 09:44:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91DA78D0001; Mon, 26 Jul 2021 09:44:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0214.hostedemail.com [216.40.44.214]) by kanga.kvack.org (Postfix) with ESMTP id 792506B0033 for ; Mon, 26 Jul 2021 09:44:04 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 27D071814BA2C for ; Mon, 26 Jul 2021 13:44:04 +0000 (UTC) X-FDA: 78404857608.29.8B75433 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by imf17.hostedemail.com (Postfix) with ESMTP id E67D0F0003A5 for ; Mon, 26 Jul 2021 13:44:03 +0000 (UTC) Received: by mail-lj1-f173.google.com with SMTP id e5so11344208ljp.6 for ; Mon, 26 Jul 2021 06:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TLycPxviRjQS2vlWYgAqhStL9LKdE5LJjJtFS7Jae4Y=; b=kM3ffQibqdlLWCaxU3irV+dXOOAiJRgpArqXCrZqUlURkhV3Uj7T8ux2Ir7Z9cReit sl0WxaiR7gwq+eJ/XKMu6TRVKV1my3wGtPAGwJ2G3Qm+9koRzZtV+JdcqyUzr2EhIcfX ufHWsMiRjGklH8iHGZD4IGM6CFSx+vFneLC8532Df/g/4zOZ5s5OuUE0gHkaWpz/aIH0 d5KATqF9cmZJGa/LlkElPYuMQubU9BvAUrDd7RNkVvdTbwypVi4BJheSfkGPEY7EHTTD iqyA7t9AjMkRHoUSEBnmRaMdq0wJ7r9mri8PykgK+wl00Zw8d52GCbEaSjmhABtQmzWK jg8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TLycPxviRjQS2vlWYgAqhStL9LKdE5LJjJtFS7Jae4Y=; b=ssvMPCeINixiMEp6S2CQdvRfWlGqWSTy4jF1NajikHlpk8izL685GHZgGCP3I3vbwq VGCSCwaF9G9bnViKNqyJE9coCDWvLPOIDQ1c9kd7zvnxQ7s3Uq+ehT6165eJXmNs4HKZ 7Iy5KPkTEVRh1pXoHHnEtJOOmP6bRAHG4JFAJ3EUjP0phk1dvK35TlXFS9LiwK9RS4mU irIUzIXqv6qZ41rWTgUbXDoke//35loRoHLdLZ1KttRk1bUu73Cf/MAFtEI16sGD18Op bQgv+GNVY+9seBXDy6lVUpcmcJ50cL6G6oOzF72MV4MAnSiGKAr4cgG2XxgigoU1ptpH Wvag== X-Gm-Message-State: AOAM530X8YEGe1paU0uJ7bp9jFIFMww7q6RK1a8eQ0adYHIZrzlBH2H0 ryOC+M73cnX2ksZBfQdEl5ZlCQosolnTnmwngW1m1w== X-Google-Smtp-Source: ABdhPJwAkFnDG7NuQtWLLexIiDYnWTWvIxBeII4m/0QIeM7dBhx7GXfH+UoikLc0g6EgogQ1N+7fjJ6zmkJsQ7tEbhE= X-Received: by 2002:a2e:85d7:: with SMTP id h23mr12408419ljj.279.1627307041973; Mon, 26 Jul 2021 06:44:01 -0700 (PDT) MIME-Version: 1.0 References: <20210723011436.60960-1-surenb@google.com> In-Reply-To: From: Shakeel Butt Date: Mon, 26 Jul 2021 06:43:50 -0700 Message-ID: Subject: Re: [PATCH v3 1/2] mm: introduce process_mrelease system call To: Michal Hocko Cc: Suren Baghdasaryan , Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Christoph Hellwig , Oleg Nesterov , David Hildenbrand , Jann Horn , Andy Lutomirski , Christian Brauner , Florian Weimer , Jan Engelhardt , Tim Murray , Linux API , Linux MM , LKML , kernel-team Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=kM3ffQib; spf=pass (imf17.hostedemail.com: domain of shakeelb@google.com designates 209.85.208.173 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E67D0F0003A5 X-Stat-Signature: bjszcjcqyo9w4yyfzy9x6nfbfe7pze8d X-HE-Tag: 1627307043-367642 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: On Mon, Jul 26, 2021 at 12:27 AM Michal Hocko wrote: > [...] > > Is process_mrelease on all of them really necessary? I thought that the > primary reason for the call is to guarantee a forward progress in cases > where the userspace OOM victim cannot die on SIGKILL. That should be > more an exception than a normal case, no? > I am thinking of using this API in this way: On user-defined OOM condition, kill a job/cgroup and unconditionally reap all of its processes. Keep monitoring the situation and if it does not improve go for another kill and reap. I can add additional logic in between kill and reap to see if reap is necessary but unconditionally reaping is more simple. > > > An alternative would be to have a cgroup specific interface for > > reaping similar to cgroup.kill. > > Could you elaborate? > I mentioned this in [1] where I was thinking if it makes sense to overload cgroup.kill to also add the SIGKILLed processes in oom_reaper_list. The downside would be that there will be one thread doing the reaping and the syscall approach allows userspace to reap in multiple threads. I think for now, I would go with whatever Suren is proposing and we can always add more stuff if need arises. [1] https://lore.kernel.org/containers/CALvZod4jsb6bFzTOS4ZRAJGAzBru0oWanAhezToprjACfGm+ew@mail.gmail.com/