Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp39551yba; Thu, 25 Apr 2019 17:35:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqztEIigX7TGE6Xo8GOrybtJtZ9WbF3ymVQfABMHZLSKROgc8O/EyDBjMUMAEORLyXnKnAG5 X-Received: by 2002:a17:902:28e4:: with SMTP id f91mr42050518plb.321.1556238935125; Thu, 25 Apr 2019 17:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556238935; cv=none; d=google.com; s=arc-20160816; b=p6F5BB5TSXiqRGTbpQmGwW03ic9TNf87OfDFUdafN7nBZHxDicRo9v5zx6XRq7NQcp HCYgjsA1iyDuNg7EfxAHKRgY67mpRT7+fq+BQfCBc2R0+DZnY5PeXTbXPMtH5GRKEnzO izambyHXMzeb0DKg0CUgkupqbM9xE6dCE0apbDGobGa2So3Qt7UCRWOfIA+mmttneUhX dxYWgfItQK9pW9ENnjYx8YLquiLIbtixYkEm58dFZkFeq3/Pj9pQ9mUR7pF5XIjYTIsv aAzHLQBmCI48+ZhRe0ng4eawoyyjHuA9hbCFLz1j/yL61dA47pMpzsfvWJOgyR53WLYF faeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=vt2MHREG2YW1b5Y4ynxE1gZ24ZdGV1+JspuK5nI83KY=; b=NpCrXzNrXJbUwLY7PkSkEpQwlSqEnlxemEWG9ANLsCgR9IzZ8lQ7GAW3qm8vWmaG7S aZKuNhQ8FwJv9XTQB1pSd0phVRR07jGs0o9JYhKA8qJhlKsBMNZ5iMhVDzSJTGy1Gmr/ 2U5PgZ+Dnp6YipE4cvUtQaxjYZ8Jd8FLnyq6BAHwmQbNL4bzwQbJe5AxPKce7wjlZEL+ DF7Oq3R/wLNkRYmjW3ioTbGIGQ44UmWgOakMEd9FysblwBqH7imOKeLTtyc2YfNUXKjj 98z+rwc1zDjlasBAYkZ5cwsRgPwsQUb4RGTneMP29ou+Iba0UnVivD8OP01EnCvGzwU9 C6Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Jsdx1Trn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si23346811pgg.234.2019.04.25.17.35.19; Thu, 25 Apr 2019 17:35:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Jsdx1Trn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387811AbfDYUjO (ORCPT + 99 others); Thu, 25 Apr 2019 16:39:14 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:55077 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387630AbfDYUjN (ORCPT ); Thu, 25 Apr 2019 16:39:13 -0400 Received: by mail-it1-f193.google.com with SMTP id a190so2320993ite.4 for ; Thu, 25 Apr 2019 13:39:13 -0700 (PDT) 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=vt2MHREG2YW1b5Y4ynxE1gZ24ZdGV1+JspuK5nI83KY=; b=Jsdx1TrnktYnmyKJsMoo7doVO3TxeEBSjygL1I8pQFFrqJHvtTA0+4/DoMGGiJy+GT A7sWMEm4PwyOBlSMEEUdsHPzBga0UipypP3GbzjLxYtga9A+g8JkIS3a70LfV/C6L9aG TMwa/YU3l0WdUGELor4qWqYgRECWqjTyMNGDdGpHBfJghrWxL7XHM19HYRBU18oOMMS3 aB8vF4Q6pX7IGeAU65ylVKhmQt/0SVoCqjGpJWBjYUHBfRyD0Nj8Kjgp7x6JE56s+x2R XIbINGd4KfGBgzrwtqf0LxgoBKsZ89A/rI4n4oWDjimxd4VjNJBV9uke/xdhZlXWOjeZ sMHw== 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=vt2MHREG2YW1b5Y4ynxE1gZ24ZdGV1+JspuK5nI83KY=; b=JaDvwAUiIC7gBRTns9P3/iqYd6c/q1HF4cp1DnfpfnDElInDtvOe+9GdxyXUZo+l95 6e7Dr7kIBH1Lgui0QiJ7//qzLAEgNf1lce4TV/qr9+3KKmWLzA+LAqP70ziV70yuzZWN GLEc919f08QSKre3rbdZaKFbJ72BFb/Ub2bkU0kVrqdQNX9AIcLOQ9P82PMpQy3/x4mj nmiHQXCYnqSwBSXh+U+F2RAi4R7MvFLLAR9pcjztmpgAijyknEMBP5okrHWATuU0pslt i7U9A5rGbN5yPiEMu2AreVa1PWqvanW9eGMj+Xx5ZcGFqhjsrglr8gWUxXM8+fSg2n36 9hng== X-Gm-Message-State: APjAAAUoiy2cHYyLB6D22ZKmnYscKRX08hToDbCUOcFozNppuLKDNV0l go49Ahnt7l4bEuexLsnBn1Ed8cSY/23udtxqGJ7S8w== X-Received: by 2002:a02:ad07:: with SMTP id s7mr18510295jan.103.1556224752679; Thu, 25 Apr 2019 13:39:12 -0700 (PDT) MIME-Version: 1.0 References: <20190424211038.204001-1-matthewgarrett@google.com> <20190425121410.GC1144@dhcp22.suse.cz> <20190425123755.GX12751@dhcp22.suse.cz> In-Reply-To: <20190425123755.GX12751@dhcp22.suse.cz> From: Matthew Garrett Date: Thu, 25 Apr 2019 13:39:01 -0700 Message-ID: Subject: Re: [PATCH V2] mm: Allow userland to request that the kernel clear memory on release To: Michal Hocko Cc: linux-mm@kvack.org, Linux Kernel Mailing List , Linux API Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 5:37 AM Michal Hocko wrote: > Besides that you inherently assume that the user would do mlock because > you do not try to wipe the swap content. Is this intentional? Yes, given MADV_DONTDUMP doesn't imply mlock I thought it'd be more consistent to keep those independent. > Another question would be regarding the targeted user API. There are > some attempts to make all the freed memory to be zeroed/poisoned. Are > users who would like to use this feature also be interested in using > system wide setting as well? I think that depends on the performance overhead of a global setting, but it's also influenced by the semantics around when the freeing occurs, which is something I haven't nailed down yet. If the expectation is that the page is freed whenever the process exits, even if the page is in use somewhere else, then we'd still want this to be separate to poisoning on final page free.