Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp130855yba; Thu, 11 Apr 2019 23:54:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLXwk+7t/HsBVkCXm5hhIqSpA+mKDOyW3IvMBigliwnPFPpe5VUyg0QWTG4hFkjDMWv5/h X-Received: by 2002:a17:902:e110:: with SMTP id cc16mr55585272plb.147.1555052048569; Thu, 11 Apr 2019 23:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555052048; cv=none; d=google.com; s=arc-20160816; b=MOyIgbM+Ul5dGx/8dHVfU7wn3psa4CvYaMlliAYshlSiE10P+r8LchKsrF0FBgax3y pwaqvCMU9LlPabm3nAg0n7MNMXwIr58EHuq3lgrOXlkzqHcCl5sS2bBqJnFNPpIG70d6 ZRo4TFyDatPu2ehvX+w33Fnj+0IyTW8WMXYNRVHjnJiOeEX2lUe/Xm6jIlMou3VF7UxL TRtam+TRykZz44oKwGOs/WFuwp5uhtnZJKQpyhrrP2nLtb1C6qQdl6DHaYybqDAd5lkN JoacXcJ/aYvADMcWjqB4f/k1M16DXAD+M3AiZb65C+guJIvqm26DEpIGOSaG89bPMNFr mDKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rqBneHYFb+qAUTDXhL+JxRJizleIs9AJtZzRqAzZrjU=; b=Idg0M7A0gG2suru8U2GA4Co8PNfoodUTX9EpTwogMJ5UK95xBrJW4SkF0k9tiiYUZp lYQEriiLQsYAvnpQFv527isZrGbMdwhB7oDIeW24oXybSzidu81D4T4llWrMRxeNZrVA B/bqwP43GacFSV0ardXXrVUb3ztuE09gZ2CdrETdkn7PGfumihNGUr7/NCBiaYmx3gRn CMGLMLbkuBSFiehdHWXRsf7P6I6I2XUNIHCX4/yFjoH2zrN/A9UA5BsP9OFCAvHk5AWU ua5AmhF3PprYaovLCKHV9wGZ5gZLwI8EXODqTP9AMe7gcIvaUDSneEVwafTdIQP8CuPP qDZg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si10317703pgv.299.2019.04.11.23.53.52; Thu, 11 Apr 2019 23:54:08 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726838AbfDLGxR (ORCPT + 99 others); Fri, 12 Apr 2019 02:53:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:58002 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726101AbfDLGxQ (ORCPT ); Fri, 12 Apr 2019 02:53:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 786A0ADDB; Fri, 12 Apr 2019 06:53:15 +0000 (UTC) Date: Fri, 12 Apr 2019 08:53:14 +0200 From: Michal Hocko To: Matthew Wilcox Cc: Suren Baghdasaryan , akpm@linux-foundation.org, rientjes@google.com, yuzhoujian@didichuxing.com, jrdr.linux@gmail.com, guro@fb.com, hannes@cmpxchg.org, penguin-kernel@I-love.SAKURA.ne.jp, ebiederm@xmission.com, shakeelb@google.com, christian@brauner.io, minchan@kernel.org, timmurray@google.com, dancol@google.com, joel@joelfernandes.org, jannh@google.com, linux-mm@kvack.org, lsf-pc@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [RFC 2/2] signal: extend pidfd_send_signal() to allow expedited process killing Message-ID: <20190412065314.GC13373@dhcp22.suse.cz> References: <20190411014353.113252-1-surenb@google.com> <20190411014353.113252-3-surenb@google.com> <20190411153313.GE22763@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190411153313.GE22763@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 11-04-19 08:33:13, 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? Well, you are tearing down an address space which might be still in use because the task not fully dead yeat. So there are two downsides AFAICS. Core dumping which will not see the reaped memory so the resulting coredump might be incomplete. And unexpected #PF/gup on the reaped memory will result in SIGBUS. These are things that we have closed our eyes in the oom context because they likely do not matter. If we want to use the same technique for other usecases then we have to think how much that matter again. -- Michal Hocko SUSE Labs