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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS 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 A563FC55ABD for ; Sat, 14 Nov 2020 01:18:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 417AD22267 for ; Sat, 14 Nov 2020 01:18:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="zxlg/VaU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 417AD22267 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 94C756B005C; Fri, 13 Nov 2020 20:18:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FBA06B005D; Fri, 13 Nov 2020 20:18:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C3076B0068; Fri, 13 Nov 2020 20:18:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 4E8B26B005C for ; Fri, 13 Nov 2020 20:18:13 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id F01EE1EE6 for ; Sat, 14 Nov 2020 01:18:12 +0000 (UTC) X-FDA: 77481262824.18.beast18_1b097e927313 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id CE770100ED3B0 for ; Sat, 14 Nov 2020 01:18:12 +0000 (UTC) X-HE-Tag: beast18_1b097e927313 X-Filterd-Recvd-Size: 3923 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Sat, 14 Nov 2020 01:18:12 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE51F22261; Sat, 14 Nov 2020 01:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605316691; bh=uXpBMD7/3ZId9Cgo0JGEfZTnwcfVEbN6QzkoH7cWI8Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=zxlg/VaU83wqoKZ51iKRh8GpONjw13R13IY5RSHC6EK5QCSz0OOoyTSYf49uxKT6U 3nIzTyS52dgcSNVsTtonHBnarvphseyiPprIMgSDUe0aPRNvOyQ34wlzIULqH1WGq3 PAmhHwN8STrTtJh50/O+VNUWTYp/lou0WK54cI6w= Date: Fri, 13 Nov 2020 17:18:10 -0800 From: Andrew Morton To: Suren Baghdasaryan Cc: Michal Hocko , 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: <20201113171810.bebf66608b145cced85bf54c@linux-foundation.org> In-Reply-To: References: <20201113173448.1863419-1-surenb@google.com> <20201113155539.64e0af5b60ad3145b018ab0d@linux-foundation.org> <20201113170032.7aa56ea273c900f97e6ccbdc@linux-foundation.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Fri, 13 Nov 2020 17:09:37 -0800 Suren Baghdasaryan wrote: > > > > Seems to me that the ability to reap another process's memory is a > > > > generally useful one, and that it should not be tied to delivering a > > > > signal in this fashion. > > > > > > > > And we do have the new process_madvise(MADV_PAGEOUT). It may need a > > > > few changes and tweaks, but can't that be used to solve this problem? > > > > > > Thank you for the feedback, Andrew. process_madvise(MADV_DONTNEED) was > > > one of the options recently discussed in > > > https://lore.kernel.org/linux-api/CAJuCfpGz1kPM3G1gZH+09Z7aoWKg05QSAMMisJ7H5MdmRrRhNQ@mail.gmail.com > > > . The thread describes some of the issues with that approach but if we > > > limit it to processes with pending SIGKILL only then I think that > > > would be doable. > > > > Why would it be necessary to read /proc/pid/maps? I'd have thought > > that a starting effort would be > > > > madvise((void *)0, (void *)-1, MADV_PAGEOUT) > > > > (after translation into process_madvise() speak). Which is equivalent > > to the proposed process_madvise(MADV_DONTNEED_MM)? > > Yep, this is very similar to option #3 in > https://lore.kernel.org/linux-api/CAJuCfpGz1kPM3G1gZH+09Z7aoWKg05QSAMMisJ7H5MdmRrRhNQ@mail.gmail.com > and I actually have a tested prototype for that. Why is the `vector=NULL' needed? Can't `vector' point at a single iovec which spans the whole address range? > If that's the > preferred method then I can post it quite quickly. I assume you've tested that prototype. How did its usefulness compare with this SIGKILL-based approach?