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 940F3C56202 for ; Wed, 18 Nov 2020 19:22:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D9D932222C for ; Wed, 18 Nov 2020 19:22:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CSfiTZgw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9D932222C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0295D6B0036; Wed, 18 Nov 2020 14:22:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F1B8F6B005C; Wed, 18 Nov 2020 14:22:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E32A76B005D; Wed, 18 Nov 2020 14:22:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0008.hostedemail.com [216.40.44.8]) by kanga.kvack.org (Postfix) with ESMTP id B53A56B0036 for ; Wed, 18 Nov 2020 14:22:34 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5C82C1EF1 for ; Wed, 18 Nov 2020 19:22:34 +0000 (UTC) X-FDA: 77498510628.20.grain57_27136362733c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 3631D180C07A3 for ; Wed, 18 Nov 2020 19:22:34 +0000 (UTC) X-HE-Tag: grain57_27136362733c X-Filterd-Recvd-Size: 4841 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Nov 2020 19:22:33 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id a186so1345298wme.1 for ; Wed, 18 Nov 2020 11:22:33 -0800 (PST) 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=L5dNLVflsoCWnQaHKvWs9L85VwqNp8UsUbv9wLjV6qI=; b=CSfiTZgwKRZkrhto0srzY8T5NgHeQ5ORWlbLYsBr+wleRBGDbQDMXoZAaO0ImJkt44 jwnxeYw9ySf6N0viXo1ZcV64DhaoZ0waV3olM/pLP9EoWTCMkWpn1fvzhj7igXt+RiKS aRYG8y/aHSDoPLPigh7MEIoTmW4wkXE3u3bjIyAtzAPAEKeO4naRZ2sJSyH7urs+Ujsr pCZNfHkkc4U5LhbQLLyiyqN4BRxyn7xaCOK5xs9LvJ6pGS0EGLTdkaym2GHKptayy67e 9FNlpEBX72O6mZZnO8CLkmo1z52bU6CnYLzM9eHk8pCVaHrzCjx2IPnSPK6v+oK7aM6c xKxg== 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=L5dNLVflsoCWnQaHKvWs9L85VwqNp8UsUbv9wLjV6qI=; b=FbN1QFL/u2sbiIeMqoh0qiVZamYrPft11q7ebb9hWzWBHmbeBZ0o9Ewzmp2urmrZ88 dS4/ojGhv+jH3p8hxijCQHis4oqivBfHW9LnVMl68hGBkKY/eS+pxDhM0EV8owUC6hPG vUGIpwzHL3DdLgUpPZga0ckEBZwqaIsEm6SirllvHl9Ww26JJoCbbbxRebdoQie5NKlI qlZfRC52nqMzpwByyZIn4paPgD57eTlGvm8Q3uYNVZ3RCSUIY8RXV0QeIP/CnNuesX3e CFJ/QRNDNQ/8p1ZjdH0HGs4lPY5cO31qgrRn+V/t0Wj+oDwk8PA5fn+t8iQ8aT+RQsFt ep4A== X-Gm-Message-State: AOAM532ZbZp36wY1hm77XMd59B/YYHrlEW3yRjD5+yo0ilIo6auGn4CM K3iQ2aDv115qsgcGSfZh9uABIW7KX19oBEMsY3XcjA== X-Google-Smtp-Source: ABdhPJzHNJdt2+p/Yo25GoJt90AE0ooYZPZ68TX49xvJioavYYVR8ran9z9fFt/Dpl/fTIF6NbpaoSWngZlQbFpfAtY= X-Received: by 2002:a1c:e3c1:: with SMTP id a184mr660962wmh.88.1605727352121; Wed, 18 Nov 2020 11:22:32 -0800 (PST) MIME-Version: 1.0 References: <20201113173448.1863419-1-surenb@google.com> <20201113155539.64e0af5b60ad3145b018ab0d@linux-foundation.org> <20201113170032.7aa56ea273c900f97e6ccbdc@linux-foundation.org> <20201113171810.bebf66608b145cced85bf54c@linux-foundation.org> <20201113181632.6d98489465430a987c96568d@linux-foundation.org> <20201118154334.GT12284@dhcp22.suse.cz> In-Reply-To: <20201118154334.GT12284@dhcp22.suse.cz> From: Suren Baghdasaryan Date: Wed, 18 Nov 2020 11:22:21 -0800 Message-ID: Subject: Re: [PATCH 1/1] RFC: add pidfd_send_signal flag to reclaim mm while killing a process To: Michal Hocko Cc: Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Christian Brauner , Oleg Nesterov , Tim Murray , linux-api@vger.kernel.org, linux-mm , LKML , kernel-team , Minchan Kim Content-Type: text/plain; charset="UTF-8" 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 Wed, Nov 18, 2020 at 11:10 AM Michal Hocko wrote: > > On Fri 13-11-20 18:16:32, Andrew Morton wrote: > [...] > > It's all sounding a bit painful (but not *too* painful). But to > > reiterate, I do think that adding the ability for a process to shoot > > down a large amount of another process's memory is a lot more generally > > useful than tying it to SIGKILL, agree? > > I am not sure TBH. Is there any reasonable usecase where uncoordinated > memory tear down is OK and a target process which is able to see the > unmapped memory? I think uncoordinated memory tear down is a special case which makes sense only when the target process is being killed (and we can enforce that by allowing MADV_DONTNEED to be used only if the target process has pending SIGKILL). However, the ability to apply other flavors of process_madvise() to large memory areas spanning multiple VMAs can be useful in more cases. For example in Android we will use process_madvise(MADV_PAGEOUT) to "shrink" an inactive background process. Today we have to read /proc/maps and construct the vector of VMAs even when applying this advice to the entire process. With such a special mode we could achieve this more efficiently and with less hussle. > -- > Michal Hocko > SUSE Labs