Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6012523yba; Thu, 11 Apr 2019 10:10:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcfpdbs8EtU/ScnICOcDYku7kBZwRIcJiOvhP63CrmUStOO5Ec8LYhjEIaD6kgwqEmKOyL X-Received: by 2002:a65:62d2:: with SMTP id m18mr48360961pgv.122.1555002616434; Thu, 11 Apr 2019 10:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555002616; cv=none; d=google.com; s=arc-20160816; b=YLYGAVWpZ2WP5GYjF0ZTy+1uDeblSmqVakBs82cDn+wp/vtPZpLdnXTiuY+UiZFGrj uOrN0w9nbHIKUryugmZw+jJ134MjMoN2c5kuF3F8zUfYchy7Jt0EnWsUrCRVkOy8eJF/ +WVzpVC5+aXctvw6slyKW1M4H4Mh296IyVJmWRwPVpeURwdrKtvFE89oyzm+wTtd7MQV vHGF9iKiegFgFMAcslUjuZ1NpkQwNd3V7mwwWa/9ZUNAi51CsqbcLaWr9bnslxZWmoI6 nmHfHiqBUbIaOcg+r9i2Du5Z/JIdKASwOoX1+aswxFKF00iRlGNH7T9QTCGMJeN+Q5Oj 2aGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8IUsO6EPkitkkKfslQlrk9jdhyI8ls4f5Jkizx1ufco=; b=hxomUV3MDyU5uwH5UY4kbshny4tn5LlWveacyZ6xlpNUCS9XIp5nb6vCr4LOwfb9EI WFvSfjJ4Ox5tR1oamRdTN5DtBWgOYGNHQ4VpZlSjq1QWMVYnWyaa9hnnwVjc4jo2xyWY TyANwkjVZuiKQ5wePyLRAXI/NxTT2A7oA5nxg94N3HY+qyqGy2B7pcqDN42o0r24mn0Y FKYb+u527XHjX89yWRYArTZKkmYOLrniI7qypZn81tjZq43HuWERXxcYE1jlFAob+b+v kyPlk2VQGYnkwJBmRegLH/tZj7+JmABBhsBQLFfPVtUzSeG+i0kswQyKQUOFrgq1nJYh Sulw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="RuVYDtl/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id j65si36975365plb.104.2019.04.11.10.09.59; Thu, 11 Apr 2019 10:10:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="RuVYDtl/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726794AbfDKRJU (ORCPT + 99 others); Thu, 11 Apr 2019 13:09:20 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36242 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfDKRJU (ORCPT ); Thu, 11 Apr 2019 13:09:20 -0400 Received: by mail-wm1-f65.google.com with SMTP id h18so7618957wml.1 for ; Thu, 11 Apr 2019 10:09:19 -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=8IUsO6EPkitkkKfslQlrk9jdhyI8ls4f5Jkizx1ufco=; b=RuVYDtl/y7612dj4+IKeQW/slL0xo/AO6Znlwf7Hk3P2RrSWmjQpRS6ixXs2G8hWnM 5vNuGTVOdUPuWKgMoRIQuxNiBv180LSi9UhCLLCvBuYRUxBZU7hgts7AytfwciBQfvID jNGtv1XyjoNg3XEeUO4Lm+sNUnngJXrgwttFghcHeGnyP7g3J54xsvTnfdAXR7TSq13V /eHOw3id/WZuF8E0KF/QLG4QrEmm8VM0Pt/cWI3F5or+WfokXQI5ztNCx5QllAG4A8C1 /XUA0jFNJ7OFtjlKRcbiK+3MEx7G65bNVtOWntS+GPkswQlfwl03iFmFUz0AI42MD7NW ErQA== 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=8IUsO6EPkitkkKfslQlrk9jdhyI8ls4f5Jkizx1ufco=; b=rYSJ5qt5i/oLQAN+vlroaZwHHQ7cgav8lJYDOLEhXShOk18kx7ImrThry1HhOhLRnp /bYFFrXVOKPxS4ITNhF2q16sWT0mTaMOAwO1FA+qMv199m5Hbj1vbDmWVSMdwjkcGYC8 /EQkuaAg5XG/v58ZXcSS2DYj5cFsBbdEk6x0xOXHzizeR0u+Ts49uaz7fzaaMIa8pDjv P2ByjpmnlPe0nSjuzOPqcIt7Ve9VHiP7/iP4IRWxYlCBR9M1wqNH3omIJdhue00qJKUT tPtk/N3J2ZzMMMzvtDFDtAziFMbhx98iIULy2ik7QZEGJwqg1yQQvZ5yfStoxDkzBEum XDow== X-Gm-Message-State: APjAAAUPcwocwPeu2c/bmegMCTxwyTPJdjCZ5ylTsP6ch5sSIHnuroOV nMtTGpOnUbfzc7/uh1Cvj8Z5+oF4qteEluw7uQyw9Q== X-Received: by 2002:a1c:c00b:: with SMTP id q11mr7791999wmf.38.1555002557981; Thu, 11 Apr 2019 10:09:17 -0700 (PDT) MIME-Version: 1.0 References: <20190411014353.113252-1-surenb@google.com> <20190411014353.113252-3-surenb@google.com> <20190411153313.GE22763@bombadil.infradead.org> In-Reply-To: <20190411153313.GE22763@bombadil.infradead.org> From: Suren Baghdasaryan Date: Thu, 11 Apr 2019 10:09:06 -0700 Message-ID: Subject: Re: [RFC 2/2] signal: extend pidfd_send_signal() to allow expedited process killing To: Matthew Wilcox Cc: Andrew Morton , mhocko@suse.com, David Rientjes , yuzhoujian@didichuxing.com, Souptick Joarder , Roman Gushchin , Johannes Weiner , Tetsuo Handa , ebiederm@xmission.com, Shakeel Butt , Christian Brauner , Minchan Kim , Tim Murray , Daniel Colascione , Joel Fernandes , Jann Horn , linux-mm , lsf-pc@lists.linux-foundation.org, LKML , kernel-team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 11, 2019 at 8:33 AM Matthew Wilcox wrote: > > On Wed, Apr 10, 2019 at 06:43:53PM -0700, Suren Baghdasaryan wrote: > > Add new SS_EXPEDITE flag to be used when sending SIGKILL via > > pidfd_send_signal() syscall to allow expedited memory reclaim of the > > victim process. The usage of this flag is currently limited to SIGKILL > > signal and only to privileged users. > > What is the downside of doing expedited memory reclaim? ie why not do it > every time a process is going to die? I think with an implementation that does not use/abuse oom-reaper thread this could be done for any kill. As I mentioned oom-reaper is a limited resource which has access to memory reserves and should not be abused in the way I do in this reference implementation. While there might be downsides that I don't know of, I'm not sure it's required to hurry every kill's memory reclaim. I think there are cases when resource deallocation is critical, for example when we kill to relieve resource shortage and there are kills when reclaim speed is not essential. It would be great if we can identify urgent cases without userspace hints, so I'm open to suggestions that do not involve additional flags.