Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1894597pxy; Mon, 2 Aug 2021 13:07:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFAryrbGgiYP7326zySywKS5vw8iXB55fjwMk215bTNfFTADsXIfAr+mSFRJrERFrlqvrk X-Received: by 2002:a17:906:d20a:: with SMTP id w10mr17699156ejz.426.1627934865613; Mon, 02 Aug 2021 13:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627934865; cv=none; d=google.com; s=arc-20160816; b=n/1BDtbf7vHERg0VcpL2VG+N9OlahVQiCO/gjDN1hxbAJhQongBb38ZPnKHdTQDe15 ZmOgP7POY8rSn43cLY8KrLbTkZl8KUgwANW7pQNJ0vOoWmu78hwkOtjzIurhq1c9VYNX ZPcMFJvx/l9lJTfnmPsM95PtCKtt1aJf8hosu5npWPgqL4wFz0LWiy2kWFqVi2Lh9ri2 mIts21P4YekqU/MIDDZGk1ilNB3UEiVsP+WbvXKjy81fZ/6bmoWjN5ZiKJsgjkIY76LG I6ovMcQ4MJgsHYKoP5nBr6BVdLNjbLBP/LXghhFs2nAU+NWbhrDG8CMi4giatOcdrz+B JseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HB3dfAanD6v/DibZ+Kd9MP5PZZX+18PKh7cDBPxAeHs=; b=TQYt03e5EPC0VseMA6fuimjmuCedb1SCUJCftyVkFLderWRmePLJphA3ajVvL7EMyZ xCwUaIftMiSI55xBFHk/A737hjgQa7/X/WKhu2TlUZwYsKkRf/SKlYmGEW5dLRuJAbEj mdrohiCXxH1LbHdznc6cGdQcdgd6T7yt4XN2cXtLKE9cThnXRsPm8v0rWa8UAve69TpR /YoIcxxRrvVrVVFVtT+3Y3lDx1d8DIBK6PFAeKult5arv2AowJez85kLU4sp0V+OE0cZ xOYS1th/0lfClh8fAOkdH0gx92dlVwukf7hh16TjNiD0ohCHKAdsstRLCf7zrp35bnrR DdZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ptyOG8hV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si13766047ejb.152.2021.08.02.13.07.20; Mon, 02 Aug 2021 13:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ptyOG8hV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbhHBUF1 (ORCPT + 99 others); Mon, 2 Aug 2021 16:05:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbhHBUF0 (ORCPT ); Mon, 2 Aug 2021 16:05:26 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 392A5C061760 for ; Mon, 2 Aug 2021 13:05:16 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id p38so20914356lfa.0 for ; Mon, 02 Aug 2021 13:05:16 -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=HB3dfAanD6v/DibZ+Kd9MP5PZZX+18PKh7cDBPxAeHs=; b=ptyOG8hVKeJFevLxjCDUGzEhuSpZVEdMhDg+ywQnIWCracEKgYNJi9MyuD507zg3Eq doKw0YYpy3+9o+JFlSBQTwidtTbAq/pCC0+1OUtEuGXvon5JYsygoPX6N6QUxPNwLecd dGRPriNZp5jImD5F5U8MlOwLn3i0kGKTMQu8TVzPmTftKU/9lo7bbqVTkkpuKAx/PUSW jiBeP+zM1R/b4geXHK+h+upY1oHpTKGY01BvxD0hnkWN9TGqJgSlpJHuDvg7R3BlOky5 4GgMumBWGK6P4QfI9acGmi0hXOcdxN3Gy+//oD79tKf96Yi5qkwrLtvtQy4dYRne726K qBjA== 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=HB3dfAanD6v/DibZ+Kd9MP5PZZX+18PKh7cDBPxAeHs=; b=VZA2ELGLaz98TEcP4vEXvZc2jsanJzfGbDRx3921khSnP/0WFMXyXLpgvKS7ocZVG1 4r0yPsVEYRSTKmnyrwJh1LBFElG2Dcz84uCF6TXyq9J1qTRS6joQVGYL0y9Xe9ucGIhs tdwzcb7cdzjJA8Z7z7Rvg7quVVN0haluuSEWfqmvjaI8fETa3jM6qeSA7da27F1l1+Ve bj8mceRE6CZP+3iiEFaq+n9/hA4qjQ1PMVTROPSL6XVtfTJx0cRfaCL1CRVlRJSzJgf+ FerBQ2OMbAI5GuY9RVjgR4B9pMSJH6JYIRyQggwjWkPu5VRBY2Q7vvxeF4tdux0BUKtQ 9EJg== X-Gm-Message-State: AOAM53149FEbOfv3mzL+WOI31/8vj5Cw7aUyp/EQe67/3hMLaUTfiG9e 01lFYPn0RSnZDh+vpJNdz+CPKfkC3+pZnZObHz/CVQ== X-Received: by 2002:a05:6512:c23:: with SMTP id z35mr14088907lfu.299.1627934714208; Mon, 02 Aug 2021 13:05:14 -0700 (PDT) MIME-Version: 1.0 References: <20210723011436.60960-1-surenb@google.com> In-Reply-To: From: Shakeel Butt Date: Mon, 2 Aug 2021 13:05:03 -0700 Message-ID: Subject: Re: [PATCH v3 1/2] mm: introduce process_mrelease system call To: Suren Baghdasaryan Cc: Michal Hocko , 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 2, 2021 at 12:54 PM Suren Baghdasaryan wrote: > > On Mon, Jul 26, 2021 at 6:44 AM Shakeel Butt wrote: > > > > 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/ > > Hi Folks, > So far I don't think there was any request for further changes. > Anything else you would want me to address or are we in a good shape > wrt this feature? > If so, would people who had a chance to review this patchset be > willing to endorse it with their Reviewed-by or Acked-by? I think with Michal's suggestion to use a killable mmap lock, at least I am good with the patch.