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=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 C3EEBC63798 for ; Wed, 18 Nov 2020 19:32:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 23A44238E6 for ; Wed, 18 Nov 2020 19:32:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="GHWJLGFH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23A44238E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B6A66B0036; Wed, 18 Nov 2020 14:32:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0658B6B005C; Wed, 18 Nov 2020 14:32:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE4806B005D; Wed, 18 Nov 2020 14:32:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id C12E56B0036 for ; Wed, 18 Nov 2020 14:32:36 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 710EE180AD830 for ; Wed, 18 Nov 2020 19:32:36 +0000 (UTC) X-FDA: 77498535912.23.plot11_320da582733c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 4DE8E37606 for ; Wed, 18 Nov 2020 19:32:36 +0000 (UTC) X-HE-Tag: plot11_320da582733c X-Filterd-Recvd-Size: 4193 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Nov 2020 19:32:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1605727954; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qq+4RUIWTIRJUQsDUMjDphUgg4rSNzYU7mlJ5rkVEAA=; b=GHWJLGFHsuhg/s44OiNkL94AFNh0MLAJN9QkVvkm7T9NTz0yi+StlesXpSZ2D+xmtu5u33 auEJYHzr9zrA6MO2TkX6NP3P96NjtgiCeeaPL/9G08WkSicJlzsoY4npGdhg1N+4htBKRj hseLF8fZb2Tf/bBo6FZizbu09Yxij3Y= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 99EB7BDF3; Wed, 18 Nov 2020 19:32:34 +0000 (UTC) Date: Wed, 18 Nov 2020 20:32:33 +0100 From: Michal Hocko To: Suren Baghdasaryan 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 Subject: Re: [PATCH 1/1] RFC: add pidfd_send_signal flag to reclaim mm while killing a process Message-ID: <20201118193233.GV12284@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 18-11-20 11:22:21, Suren Baghdasaryan wrote: > 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). That would be safe but then I am wondering whether it makes sense to implement as a madvise call. It is quite strange to expect somebody call a syscall on a killed process. But this is more a detail. I am not a great fan of a more generic MADV_DONTNEED on a remote process. This is just too dangerous IMHO. > However, the ability to apply other flavors of > process_madvise() to large memory areas spanning multiple VMAs can be > useful in more cases. Yes I do agree with that. The error reporting would be more tricky but I am not really sure that the exact reporting is really necessary for advice like interface. > For example in Android we will use > process_madvise(MADV_PAGEOUT) to "shrink" an inactive background > process. That makes sense to me. -- Michal Hocko SUSE Labs