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,DKIM_INVALID, DKIM_SIGNED,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 BDBD5C388F9 for ; Tue, 3 Nov 2020 21:46:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 499CC22384 for ; Tue, 3 Nov 2020 21:46:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kEeTJrqm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 499CC22384 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A0AB46B005C; Tue, 3 Nov 2020 16:46:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B9556B005D; Tue, 3 Nov 2020 16:46:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 883176B0068; Tue, 3 Nov 2020 16:46:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id 5B6C56B005C for ; Tue, 3 Nov 2020 16:46:48 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DCBAA181AEF07 for ; Tue, 3 Nov 2020 21:46:47 +0000 (UTC) X-FDA: 77444442054.09.form27_5102e5a272bc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id BFE78180AD802 for ; Tue, 3 Nov 2020 21:46:47 +0000 (UTC) X-HE-Tag: form27_5102e5a272bc X-Filterd-Recvd-Size: 5436 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Nov 2020 21:46:47 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id b3so15508120pfo.2 for ; Tue, 03 Nov 2020 13:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1PpGGoZmrXkX7f7f0JV0lFNqK/EDCekB1Ge7X3zSkxQ=; b=kEeTJrqmvvtmnfuCU25YIXiE75LlH9tArKhnwsc2sNhwLkYnILuVtw9gxIpPueUcLz +UhpHM+8MvKpX4Orvj43d4S3r51vEAyQ1gUNVYsGapQWX9TwQXlcrpdLX6gnv2IFjMXi Fe7/EULFy8TjBYL5q4leSQiJjp5jAvEUHwq/O2mAOx72N43uJLG1+Z8qQwUoteP8xpfS AZjXh83p+5lI+DPL8KJFaHotFr8YillaPC3SUdgj4iHXqmN2Tm3+IAm1ofHM9BfKRBSI Rf499CT/1qCra9AovZnxdb8CfC/Qe99XBfXKR05qFdQqv870zcZCSt8JnB9e5ufxaINM wFmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=1PpGGoZmrXkX7f7f0JV0lFNqK/EDCekB1Ge7X3zSkxQ=; b=M5sTpaehQlYiT4BOyluziSL4Sz6+zUjBzbzjJsTzeV3UA2SgX7pthiqHqAaKBrES4o iuaLWRSeWBIOMxPR2Z9GMPQvSjyRkyqER1lJ/fL+mdKdEkQ/u6Op/YfFb5gW2A3NLcWQ 5LmYUxjTOCutlLYWr+VFykp1jsG0S/SFRZhqJh8nrGsXlMxxQAbKIgi2RC8IxQI1KjO0 Q6c50XitJIiFE0vuzUwHf9jdts8xOMNpZXOrckoIPIqfTV4kDTwUdHZtDKLV6dUgWykc vVmj3pVCgfxjbPFQHS2BqGXSrgm0QQ4uc1aCHWURNNG0wlZHkUie+ge1+SnDDGUB2vUI q9kA== X-Gm-Message-State: AOAM5311WzO35zmtCeJMtVh0toGPS40xcCvsl12xEM1rbVs5d6EL7+6D WPZZp3HEgSP/uBLoOG3PUX8= X-Google-Smtp-Source: ABdhPJyy0fb2Z4Agy9VQCUvcVqCyWVPKfTl3LIjTFXE6g/dHUpqtCBFeVLRcCo71EdONI96MLiTafw== X-Received: by 2002:a17:90b:1081:: with SMTP id gj1mr1204800pjb.15.1604440006238; Tue, 03 Nov 2020 13:46:46 -0800 (PST) Received: from google.com ([2620:15c:211:201:7220:84ff:fe09:5e58]) by smtp.gmail.com with ESMTPSA id 92sm103966pjv.32.2020.11.03.13.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2020 13:46:44 -0800 (PST) Date: Tue, 3 Nov 2020 13:46:40 -0800 From: Minchan Kim To: Suren Baghdasaryan Cc: Michal Hocko , 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: <20201103214532.GC1631979@google.com> References: <20201014120937.GC4440@dhcp22.suse.cz> <20201015092030.GB22589@dhcp22.suse.cz> <20201103093550.GE21990@dhcp22.suse.cz> <20201103213228.GB1631979@google.com> 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 Tue, Nov 03, 2020 at 01:40:41PM -0800, Suren Baghdasaryan wrote: > On Tue, Nov 3, 2020 at 1:32 PM 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); > > > > Yep, I just posted a comment about that. I think though your above > sequence is missing a pidfd_send_signal(fd, SIGKILL) before the > fdatasync(fd)... > Not sure if fdatasync(pidfd) or fsync(pidfd) would be more appropriate > for this but will use one and we can discuss details in the RFC with > the code. IMO, fdatasync would be better symantic since fsync invovles metadata (i.e., task_struct, mm_struct and so on). I think what you need is just pages attached to address_space, which sounds like data, not metadata.