Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp101167imd; Wed, 31 Oct 2018 15:23:29 -0700 (PDT) X-Google-Smtp-Source: AJdET5c4XksaUvifAueyoXoXowIqBd45UESWYJJdMZV/C/a2e41oIPbVu3dHBKduBF7t+TqVt6vQ X-Received: by 2002:a63:6984:: with SMTP id e126mr4871373pgc.143.1541024609505; Wed, 31 Oct 2018 15:23:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541024609; cv=none; d=google.com; s=arc-20160816; b=d1GK3wSyizEEVWVxPDJizNQ9cklEQMhmW/lL/mzFlKMxDrETGsVlxby7SJ/12h4ujf S5dyJ/cEaSyisyVAs05TRtiKj9j9kTLJksGo4TB74BhFIBNloEwpBSlD+BuCf94n4wyt BU4fkTWCLPh1FsrQEP7H3SNE0rDKxj1+AQkHcMgV8mqeTWko7VD/oiEsc/RNFTMNteC3 b25fWGd/fbPe1CZfDDeIwi3ECQEWg1/QZQs0T6rkUqAluzX9cZO/wA/Fz0oXI7iKW8fK qkh1pankSx8xK9aqYxw/Csl35sKZzmY+Bf6dsFXAPaBTW85IZj7AWhL4csBcTcuCYGg7 Hl4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n9e9jx5bhT7iQOS4/AYUEiXPtLoQRDuZXOe6A2RZAow=; b=H4pePO46nIwnBO1nzLeuIxNv+FAQtrPAWwnWfB9tycN+WB7ZM7Pf+lAjxp6gG/lU87 M+YAjndEPR1h8hxZupRg8QdcweazR/N2pcvVdPRmW6a6KvNe2KDy7H5zcH8To0QvVQ8S zt7R223k0bvlFyTEmXIPy5ztRBqGicI40WAF6axvJBXjkaCl4UdkWbDaIrLXleNCxhCJ ijL66z+BkZ1lZoVgY0Xie4qMK++RQb7OreqXkZg8j8PesPQA46LbumPULUHxxZAuf59Y j4ghumrPtfc8lP66dtMzEEHohOkGda81s79LKsiWetUW3QQjSdjZ5cos3GcQuAInhOiy U4tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=r+gKVQiB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21-v6si27204000pll.221.2018.10.31.15.23.14; Wed, 31 Oct 2018 15:23:29 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=r+gKVQiB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729327AbeKAGAp (ORCPT + 99 others); Thu, 1 Nov 2018 02:00:45 -0400 Received: from merlin.infradead.org ([205.233.59.134]:44108 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbeKAGAp (ORCPT ); Thu, 1 Nov 2018 02:00:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=n9e9jx5bhT7iQOS4/AYUEiXPtLoQRDuZXOe6A2RZAow=; b=r+gKVQiBGZuRlTYYn0pqnPPZx w/uYbpzWqFEmKqO1lW1UDk4pwqHcTlkYOwrTom7IgA8qgZBKle+fe34Wlq6PlSguoF9RDPmq7zeRS 8Ab4CTH7M/LBH2kZCZb2FT0iD7vmeqIhwnK9v3r9k8pEwcE7nGf56wYCEMVkVN/GgHagIJZMV+ocE FaARVd5/5jIlTD5iqJZ3wU6G2Dn2JAMdS3Sbtdilc8hJwQd5FhqHsSW01ci5V1bi8WgGn+XvGtEMg 9uKedkCdXFCuT/Qlu6D7ErBAUWZj/tb8/ZslR3FSo6LnS9l4bLJZINJTVte/Su89aqSRcCZTHSZSx rY9hJ/9TA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHxbO-0006zU-6J; Wed, 31 Oct 2018 21:00:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3FE712029F887; Wed, 31 Oct 2018 22:00:32 +0100 (CET) Date: Wed, 31 Oct 2018 22:00:32 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: Matthew Wilcox , Igor Stoppa , Tycho Andersen , Kees Cook , Mimi Zohar , Dave Chinner , James Morris , Michal Hocko , Kernel Hardening , linux-integrity , LSM List , Igor Stoppa , Dave Hansen , Jonathan Corbet , Laura Abbott , Randy Dunlap , Mike Rapoport , "open list:DOCUMENTATION" , LKML , Thomas Gleixner Subject: Re: [PATCH 10/17] prmem: documentation Message-ID: <20181031210032.GA3159@hirez.programming.kicks-ass.net> References: <0A7AFB50-9ADE-4E12-B541-EC7839223B65@amacapital.net> <20181030175814.GB10491@bombadil.infradead.org> <20181030182841.GE7343@cisco> <20181030192021.GC10491@bombadil.infradead.org> <9edbdf8b-b5fb-5a82-43b4-b639f5ec8484@gmail.com> <20181030213557.GE10491@bombadil.infradead.org> <20181031100237.GN744@hirez.programming.kicks-ass.net> <659CFC78-22BF-492B-B2E4-B8E89AA08446@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <659CFC78-22BF-492B-B2E4-B8E89AA08446@amacapital.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 31, 2018 at 01:36:48PM -0700, Andy Lutomirski wrote: > > > On Oct 31, 2018, at 3:02 AM, Peter Zijlstra wrote: > > > >> On Tue, Oct 30, 2018 at 09:41:13PM -0700, Andy Lutomirski wrote: > >> To clarify some of this thread, I think that the fact that rare_write > >> uses an mm_struct and alias mappings under the hood should be > >> completely invisible to users of the API. No one should ever be > >> handed a writable pointer to rare_write memory (except perhaps during > >> bootup or when initializing a large complex data structure that will > >> be rare_write but isn't yet, e.g. the policy db). > > > > Being able to use pointers would make it far easier to do atomics and > > other things though. > > This stuff is called *rare* write for a reason. Do we really want to > allow atomics beyond just store-release? Taking a big lock and then > writing in the right order should cover everything, no? Ah, so no. That naming is very misleading. We modify page-tables a _lot_. The point is that only a few sanctioned sites are allowed writing to it, not everybody. I _think_ the use-case for atomics is updating the reference counts of objects that are in this write-rare domain. But I'm not entirely clear on that myself either. I just really want to avoid duplicating that stuff.