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.9 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 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 CB8B7C00A89 for ; Thu, 5 Nov 2020 12:20:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 160AE20729 for ; Thu, 5 Nov 2020 12:20:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="nJtG71fI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 160AE20729 Authentication-Results: mail.kernel.org; dmarc=fail (p=none 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 66ABD6B00FD; Thu, 5 Nov 2020 07:20:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 61B9C6B00FE; Thu, 5 Nov 2020 07:20:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BC886B00FF; Thu, 5 Nov 2020 07:20:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 119026B00FD for ; Thu, 5 Nov 2020 07:20:18 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B5C07362C for ; Thu, 5 Nov 2020 12:20:17 +0000 (UTC) X-FDA: 77450272074.12.value47_3a05499272c9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 94C2D1801B863 for ; Thu, 5 Nov 2020 12:20:17 +0000 (UTC) X-HE-Tag: value47_3a05499272c9 X-Filterd-Recvd-Size: 4201 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Thu, 5 Nov 2020 12:20:17 +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=1604578814; h=from:from:reply-to:subject:subject: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=zAalCmlaw5gt6qaYGg/SkfDxPMz4WugwTR4CNIKb4/M=; b=nJtG71fIrES/wWk19/b0TNtzMp0GYL4mG9jGhux4cgV90Sx93jfJazOuWtaz+IJ3O5ttgB Ujac7+coApKgRfsIvqcFR0sz1v60X+ctUtpvk8uJD5OI1QWi9i9yPTvpiJtuabyoOOEeM0 aZUNQF2Q73borxClfG2NmZNsffg/uak= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 452C2AB95; Thu, 5 Nov 2020 12:20:14 +0000 (UTC) Date: Thu, 5 Nov 2020 13:20:12 +0100 From: Michal Hocko To: Minchan Kim Cc: Suren Baghdasaryan , linux-api@vger.kernel.org, linux-mm , Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Christian Brauner , Oleg Nesterov , Tim Murray , kernel-team , LKML , Mel Gorman Subject: Re: [RFC]: userspace memory reaping Message-ID: <20201105122012.GD21348@dhcp22.suse.cz> References: <20201014120937.GC4440@dhcp22.suse.cz> <20201015092030.GB22589@dhcp22.suse.cz> <20201103093550.GE21990@dhcp22.suse.cz> <20201103213228.GB1631979@google.com> <20201104065844.GM21990@dhcp22.suse.cz> <20201104204051.GA3544305@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201104204051.GA3544305@google.com> 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 04-11-20 12:40:51, Minchan Kim wrote: > On Wed, Nov 04, 2020 at 07:58:44AM +0100, Michal Hocko wrote: > > On Tue 03-11-20 13:32:28, Minchan Kim wrote: > > > On Tue, Nov 03, 2020 at 10:35:50AM +0100, Michal Hocko wrote: > > > > On Mon 02-11-20 12:29:24, Suren Baghdasaryan wrote: > > > > [...] > > > > > To follow up on this. Should I post an RFC implementing SIGKILL_SYNC > > > > > which in addition to sending a kill signal would also reap the > > > > > victim's mm in the context of the caller? Maybe having some code will > > > > > get the discussion moving forward? > > > > > > > > Yeah, having a code, even preliminary, might help here. This definitely > > > > needs a good to go from process management people as that proper is land > > > > full of surprises... > > > > > > Just to remind a idea I suggested to reuse existing concept > > > > > > fd = pidfd_open(victim process) > > > fdatasync(fd); > > > close(fd); > > > > I must have missed this proposal. Anyway, are you suggesting fdatasync > > to act as a destructive operation? > > write(fd) && fdatasync(fd) are already destructive operation if the file > is shared. I am likely missing something because fdatasync will not destroy any underlying data. It will sync > You don't need to reaping as destruptive operation. Rather than, just > commit on the asynchrnous status "write file into page cache and commit > with fsync" and "killing process and commit with fsync". I am sorry but I do not follow. The result of the memory reaping is a data loss. Any private mapping will simply lose it's content. The caller will get EFAULT when trying to access it but there is no way to reconstruct the data. This is everything but not resembling what I see f{data}sync is used for. -- Michal Hocko SUSE Labs