Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2950409pxv; Mon, 12 Jul 2021 06:01:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsqDvSx5pBr8pLFb7AV6hdUFJyMpa8/s/tySCtFYBfES5AAhqZVN6LZssUQYgm2CI4IWKm X-Received: by 2002:a92:7f04:: with SMTP id a4mr36940956ild.156.1626094877892; Mon, 12 Jul 2021 06:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626094877; cv=none; d=google.com; s=arc-20160816; b=MBXGcimZbxAoP3RsFkvPZsZV+g7KZtLJedm9XLqHJSVYtVmDlg1SCx6T018OkoeJc0 HOGrlLRleEoxF/gAqtuOnrzotWzJhXsMRnHC5AjvH+b1wljprsba3ncuu+vYK54BqXw9 itHa5pwsdCsM+dyz/e1b9WDQ5c4HuDhD1zpSZ9Bw9WLt23tJ74C7pUG54Dp2RZtHe+zs clbWd0a7BVVzoOwT1NYdXZBLfwTEyGjj5SrrhPq8ZyA2GC9H85obxleTWakDTj+4J5vJ mAwDvYpjvwzMR3X8BnGJYN4GVChTqApCW0TJqVeF9RTFgkACSSbPa8OnxNIg1U4WHaPn QYCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=U4adLYuQRYHXuH3pBCOYVkDnet90Ot5FlSpuYJpRdzg=; b=buPNqXNdceWNl4HmGJmekHGi3Yup66k6di3JW3VaH1E/t86NIO9JwhkxPOwT5edgk+ Cb7lzSdsonYoowY/gk4w+8BumN2OcNjXAQk23A5WEn6RhSQQSrM6R1glI37mjLdPs671 vMmECv+G5NiRfSA2AQoXR0t5KW9GPRLlRYivxEBlN0o95LjH/W6sO1+d1psDT2QkAJme oiqVwzC5GwmTOIIh6ACjFe19voq+KL3lXYHhDU7N1iSMwDMQbz0kygx3LdnGJDOOU4Ym CdiE65Vl3Rv6FfWuvvWYmJeqLQo3BiBnHb7OKxUHFHYC+JYymLPWIauekmYEyiFdIwk+ H89A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si17003562jao.1.2021.07.12.06.00.49; Mon, 12 Jul 2021 06:01:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233333AbhGLNDI (ORCPT + 99 others); Mon, 12 Jul 2021 09:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233121AbhGLNDB (ORCPT ); Mon, 12 Jul 2021 09:03:01 -0400 X-Greylist: delayed 492 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 12 Jul 2021 06:00:10 PDT Received: from a3.inai.de (a3.inai.de [IPv6:2a01:4f8:10b:45d8::f5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04730C0613DD; Mon, 12 Jul 2021 06:00:10 -0700 (PDT) Received: by a3.inai.de (Postfix, from userid 25121) id EF829588A40E6; Mon, 12 Jul 2021 14:51:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by a3.inai.de (Postfix) with ESMTP id E9F8D60C36094; Mon, 12 Jul 2021 14:51:54 +0200 (CEST) Date: Mon, 12 Jul 2021 14:51:54 +0200 (CEST) From: Jan Engelhardt To: Suren Baghdasaryan cc: Florian Weimer , Andrew Morton , Michal Hocko , Michal Hocko , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Christoph Hellwig , Oleg Nesterov , David Hildenbrand , Jann Horn , Shakeel Butt , Tim Murray , Linux API , linux-mm , LKML , kernel-team Subject: Re: [PATCH 1/1] mm: introduce process_reap system call In-Reply-To: Message-ID: References: <20210623192822.3072029-1-surenb@google.com> <87sg0qa22l.fsf@oldenburg.str.redhat.com> <87wnq1z7kl.fsf@oldenburg.str.redhat.com> User-Agent: Alpine 2.24 (LSU 510 2020-10-10) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 2021-07-08 08:05, Suren Baghdasaryan wrote: >> >> That explains very clearly the requirement, but it raises the question >> why this isn't an si_code flag for rt_sigqueueinfo, reusing the existing >> system call. > >I think you are suggesting to use sigqueue() to deliver the signal and >perform the reaping when a special value accompanies it. This would be >somewhat similar to my early suggestion to use a flag in >pidfd_send_signal() (see: >https://lore.kernel.org/patchwork/patch/1060407) to implement memory >reaping which has another advantage of operation on PIDFDs instead of >PIDs which can be recycled. >kill()/pidfd_send_signal()/sigqueue() are supposed to deliver the >signal and return without blocking. Changing that behavior was >considered unacceptable in these discussions. The way I understood the request is that a userspace program (or perhaps two, if so desired) should issue _two_ calls, one to deliver the signal, one to perform the reap portion: uinfo.si_code = SI_QUEUE; sigqueue(pid, SIGKILL, &uinfo); uinfo.si_code = SI_REAP; sigqueue(pid, SIGKILL, &uinfo);