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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 A92EEC433E0 for ; Tue, 7 Jul 2020 08:01:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 64F59206E2 for ; Tue, 7 Jul 2020 08:01:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="R7mgmhQL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64F59206E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F0BAA6B0093; Tue, 7 Jul 2020 04:01:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E94BC6B0095; Tue, 7 Jul 2020 04:01:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D370E8D0006; Tue, 7 Jul 2020 04:01:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id B7E176B0093 for ; Tue, 7 Jul 2020 04:01:44 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5AD371EE6 for ; Tue, 7 Jul 2020 08:01:44 +0000 (UTC) X-FDA: 77010535728.26.sign65_1a0564d26eb2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 325911804B668 for ; Tue, 7 Jul 2020 08:01:44 +0000 (UTC) X-HE-Tag: sign65_1a0564d26eb2 X-Filterd-Recvd-Size: 6222 Received: from smtp-fw-9101.amazon.com (smtp-fw-9101.amazon.com [207.171.184.25]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 08:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1594108904; x=1625644904; h=to:cc:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding:subject; bh=rPP1ZORlP0t65HOCjuJb42HRvL4bq+KnqJKPxZXRfXU=; b=R7mgmhQLoAxo/rkqxG5qVK/oB7qUksdJFUdTTJn0IBq1+3z6fI3i4e+m QpluZifO39Ld8eVHDKm4UNRai6G73Cvzrb7FxhIhwqMUuLZTyAYYP0iAf Lvpa5RewZ6M83oD6IifxJmrGeZNS6DCMpdxUNz7rtq83WPT5KYs0e+fEM 0=; IronPort-SDR: eKk0O0VzMcviyHGB2FXnmFwpjxrpl9KvWgplpWDorbhdPNQnXPOM1XKwNvc/DG1OAsB8wbmNRZ ZffKSourmB2Q== X-IronPort-AV: E=Sophos;i="5.75,323,1589241600"; d="scan'208";a="49656887" Subject: Re: [RFC]: mm,power: introduce MADV_WIPEONSUSPEND Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-17c49630.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 07 Jul 2020 08:01:40 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-17c49630.us-east-1.amazon.com (Postfix) with ESMTPS id 1D370A245B; Tue, 7 Jul 2020 08:01:32 +0000 (UTC) Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 7 Jul 2020 08:01:32 +0000 Received: from 38f9d3867b82.ant.amazon.com (10.43.162.248) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 7 Jul 2020 08:01:25 +0000 To: Michal Hocko , Jann Horn CC: Pavel Machek , "Catangiu, Adrian Costin" , "linux-mm@kvack.org" , "linux-pm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "linux-api@vger.kernel.org" , "akpm@linux-foundation.org" , "rjw@rjwysocki.net" , "len.brown@intel.com" , "fweimer@redhat.com" , "keescook@chromium.org" , "luto@amacapital.net" , "wad@chromium.org" , "mingo@kernel.org" , "bonzini@gnu.org" , "MacCarthaigh, Colm" , "Singh, Balbir" , "Sandu, Andrei" , "Brooker, Marc" , "Weiss, Radu" , "Manwaring, Derek" References: <20200703224411.GC25072@amd> <20200704114820.GA16083@amd> <57ab4fb3-3f82-d34f-ad74-2214b45a4dd9@amazon.com> <20200707074425.GC3820@dhcp22.suse.cz> From: Alexander Graf Message-ID: Date: Tue, 7 Jul 2020 10:01:23 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200707074425.GC3820@dhcp22.suse.cz> Content-Language: en-US X-Originating-IP: [10.43.162.248] X-ClientProxiedBy: EX13D20UWC004.ant.amazon.com (10.43.162.41) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Content-Type: text/plain; charset="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 325911804B668 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 07.07.20 09:44, Michal Hocko wrote: > CAUTION: This email originated from outside of the organization. Do not c= lick links or open attachments unless you can confirm the sender and know t= he content is safe. > = > = > = > On Mon 06-07-20 14:52:07, Jann Horn wrote: >> On Mon, Jul 6, 2020 at 2:27 PM Alexander Graf wrote: >>> Unless we create a vsyscall that returns both the PID as well as the >>> epoch and thus handles fork *and* suspend. I need to think about this a >>> bit more :). >> >> You can't reliably detect forking by checking the PID if it is >> possible for multiple forks to be chained before the reuse check runs: >> >> - pid 1000 remembers its PID >> - pid 1000 forks, creating child pid 1001 >> - pid 1000 exits and is waited on by init >> - the pid allocator wraps around >> - pid 1001 forks, creating child pid 1000 >> - child with pid 1000 tries to check for forking, determines that its >> PID is 1000, and concludes that it is still the original process > = > I must be really missing something here because I really fail to see why > there has to be something new even invented. Sure, checking for pid is > certainly a suboptimal solution because pids are terrible tokens to work > with. We do have a concept of file descriptors which a much better and > supports signaling. There is a clear source of the signal IIUC > (migration) and there are consumers to act upon that (e.g. crypto > backends). So what does really prevent to use a standard signal delivery > over fd for this usecase? I wasn't part of the discussions on why things like WIPEONFORK were = invented instead of just using signalling mechanisms, but the main = reason I can think of are libraries. As a library, you are under no control of the main loop usually, which = means you just don't have a way to poll for an fd. As a library author, = I would usually try to avoid very hard to create such a dependency, = because it makes it really hard to glue pieces together. The same applies to signals btw, which would also be a possible way to = propagate such events. Alex Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879