Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp130221imd; Wed, 31 Oct 2018 15:58:11 -0700 (PDT) X-Google-Smtp-Source: AJdET5cLtWHnMri9AXUsqNNjot8iEFqTdpgy7vLR/G4FV0ohiZUaIzoadjoeYe0zTaOeFmbNaGmf X-Received: by 2002:a17:902:1122:: with SMTP id d31-v6mr5253475pla.259.1541026691427; Wed, 31 Oct 2018 15:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541026691; cv=none; d=google.com; s=arc-20160816; b=yZzfc+Tb4Jr7VyllerkIIRNHOTL8RdZXVMr8IvSE4U9nF+j03ssjq0W0Q7LDnxflWe jcu0mHAFWIfn8DDUCme1m9SoBIhXcBWfPxRNgEAjKB4wNwt1ppJyxDeDjP9TlkppAuIH gG4zKAYiZ1bOY1jV9YhNYYC7dCyibHAe3hfwnMZtpCofkbhY3wJ1d7u4ZLXjapQmYoQ9 1BP4zI2d5xFvDQQyM2O8eFQNvXJsHPZOYPB5C5HtY1wag8H6GtKyYy0rKipVoY56cq4e uc7VEehS+4s6bYN2SMpil3XcJseRLWF/1iych88ovaUDv8XsnatKWgOG9SLOFpDJaVqU CbuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=n0Ec4UIkmIFaXdLaKx8d10v+kEQ/S8QwTFP4Ju9+XIM=; b=I+gZMjWAUw/LswwIf6q4sm74tWkRcn+0Zz6Dojfxnu1aVKZ0dd9MZE4KjO/Txaj03q liUOIXg6+UJw/34d19DNyzCf4TJ+GpJBwql8bN/4kcTeGYGs/SMGFHox8ZpBg04pwfIE jw/ZX0ouEQpHrUwR1indh5hmqLKRq1SRQcdIVx+swFmJW4DUfi+HDIhmaP4P5gc4IK8B KBpXCrX5icmTqIhtIRD/rIUDtJRhAx748GNpRCpBztV75zHjRcIn1xiSTx8ByGcuzXhs +HU2FT0wpcLLyCnDcMVmgzAB3faqdVMIyzyGZDMshyLWx8ZvqaNQrurYiIc8YcYTAX4D XgBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=YOA5bkN4; 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 bf10-v6si696919plb.200.2018.10.31.15.57.57; Wed, 31 Oct 2018 15:58:11 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=YOA5bkN4; 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 S1726346AbeKAH5c (ORCPT + 99 others); Thu, 1 Nov 2018 03:57:32 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44776 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbeKAH5c (ORCPT ); Thu, 1 Nov 2018 03:57:32 -0400 Received: by mail-pf1-f193.google.com with SMTP id j13-v6so4828637pff.11 for ; Wed, 31 Oct 2018 15:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=n0Ec4UIkmIFaXdLaKx8d10v+kEQ/S8QwTFP4Ju9+XIM=; b=YOA5bkN4RBQmzFnIYByHkp6ApHC29nw5jt7DSYyz2rmzovtX6LoYVVrBsAyhm250g6 g25SGJ1WbLfFylxWP7IR8TvL48zvGlJx1YdejaY7RJvXS0J+p93K7VDdpyk7LZJ9Zi9f idY2BvWApYnVDGfRqS28tEEIZioehsCcZ80zKqN2pEqvmh+BYk2xaSy6YrodA5fhB/Gs s1yQbfe99H99aEHvkgzeDpP7bhoLLdcAAuZ8sP7oW0CI8eDNaY6BTBPsQi+AShz61zd1 fUTJGJcAUGVHvpEPNMO3LhoeD+VYbuNuQ+Z6+rPs19wRHJBCpb671D309/zvYe1C4Ylq DD+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=n0Ec4UIkmIFaXdLaKx8d10v+kEQ/S8QwTFP4Ju9+XIM=; b=LtyP0/WELHWFKxqna2wDMHewBhFNtWuqNqp0KSIhO7qjZPxXigBepBR/4ySfpkvTrg d6ewnx1Kul4BCKTvLlF5xtMp6je+bZPva6uzgdH8LzNfWJpT0li/kHsTwrh80trJXn9b puzBvVHZJQ3uP3gbkKKkJ5sQyj3y1yLdzBCTbFIuuSq8OrS2apZKdyNN6uA8kkvmRIT0 FWK8C1bgBnVOK1orUJgiEkfw4VLRHrLCCheYp6U4xsZ0Df2/1PGou5iMeGqTkhcHDm3X DiLttcTCZMLYeMvUnDGoBZJKTMOX+0xEbrAwFF4GVsbnqCHfzqWRwfDyWX/wg9LyLlOV ec5g== X-Gm-Message-State: AGRZ1gLs7IJubkAJy8Iy0WGfNNP/wbsg2ekyClyUMIzqA+iP9ia88TFk meATKGafbvFGY6tWi0ajOFDZ4A== X-Received: by 2002:a62:4784:: with SMTP id p4-v6mr5136341pfi.257.1541026643529; Wed, 31 Oct 2018 15:57:23 -0700 (PDT) Received: from ?IPv6:2601:646:c200:7429:3d1b:ef7:2c4c:5b1? ([2601:646:c200:7429:3d1b:ef7:2c4c:5b1]) by smtp.gmail.com with ESMTPSA id m19-v6sm27298910pgv.93.2018.10.31.15.57.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 15:57:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 10/17] prmem: documentation From: Andy Lutomirski X-Mailer: iPhone Mail (16A404) In-Reply-To: <20181031210032.GA3159@hirez.programming.kicks-ass.net> Date: Wed, 31 Oct 2018 15:57:21 -0700 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 Content-Transfer-Encoding: quoted-printable Message-Id: <2E29C35B-3F98-473D-A874-0D9B9B15B399@amacapital.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> <20181031210032.GA3159@hirez.programming.kicks-ass.net> To: Peter Zijlstra Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Oct 31, 2018, at 2:00 PM, Peter Zijlstra wrote: >=20 >> On Wed, Oct 31, 2018 at 01:36:48PM -0700, Andy Lutomirski wrote: >>=20 >>>> On Oct 31, 2018, at 3:02 AM, Peter Zijlstra wrot= e: >>>>=20 >>>> 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). >>>=20 >>> Being able to use pointers would make it far easier to do atomics and >>> other things though. >>=20 >> 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? >=20 > Ah, so no. That naming is very misleading. >=20 > We modify page-tables a _lot_. The point is that only a few sanctioned > sites are allowed writing to it, not everybody. >=20 > 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. Sounds nuts. Doing a rare-write is many hundreds of cycles at best. Using th= at for a reference count sounds wacky. Can we see a *real* use case before we over complicate the API?=