From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 31 Oct 2018 22:00:32 +0100 From: Peter Zijlstra 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> 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 List-ID: 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.