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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CD11C433FE for ; Tue, 18 Jan 2022 22:06:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BEA896B0072; Tue, 18 Jan 2022 17:06:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B990E6B0073; Tue, 18 Jan 2022 17:06:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A60876B0074; Tue, 18 Jan 2022 17:06:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0178.hostedemail.com [216.40.44.178]) by kanga.kvack.org (Postfix) with ESMTP id 972196B0072 for ; Tue, 18 Jan 2022 17:06:25 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4B4DF181CA347 for ; Tue, 18 Jan 2022 22:06:25 +0000 (UTC) X-FDA: 79044792330.30.A069462 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf28.hostedemail.com (Postfix) with ESMTP id 0D7B9C0003 for ; Tue, 18 Jan 2022 22:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642543584; x=1674079584; h=to:references:from:subject:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=Ewi5p/l47EcBj4eeeaDbN5CQqDZhKqbM07MsfSAesJM=; b=ZOH110+SOrZ7Fl+sZCCTCRQqH9DUyEcLITqN5afuTlrILOVUbdgADqH8 1GbMz0+3gubUj3kUzRRFDRYNRmbKHmrRNyIj5HBCFYWdaXLFqcSAGCk8G RiL/gCQYOQHXzZBpuG8K0vvYGVU/hMzthP98fas75EiZcAHhBVONPYGQI RPc06Snrb1uzpbiGbE+WX32m+QypC3J3VRTQhJszBpBGQBTjJWr9DiHOz Vko0hFsqaZp+erPgbfZZZ1+drRrSHMqqAQFRLtvmNZxJnPo3CYiPNFyNq XdVXT9UOAwkrXuouY7Xv5iPqBf1ZMrPkiep8sfUZAlHVfNd9sdle0EzEg w==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="242487297" X-IronPort-AV: E=Sophos;i="5.88,298,1635231600"; d="scan'208";a="242487297" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 14:06:22 -0800 X-IronPort-AV: E=Sophos;i="5.88,298,1635231600"; d="scan'208";a="764732546" Received: from ssrikan2-mobl2.amr.corp.intel.com (HELO [10.209.52.128]) ([10.209.52.128]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 14:06:21 -0800 To: Khalid Aziz , akpm@linux-foundation.org, willy@infradead.org, longpeng2@huawei.com, arnd@arndb.de, dave.hansen@linux.intel.com, david@redhat.com, rppt@kernel.org, surenb@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: From: Dave Hansen Subject: Re: [RFC PATCH 0/6] Add support for shared PTEs across processes Message-ID: Date: Tue, 18 Jan 2022 14:06:20 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Stat-Signature: cchmjqfy3satj9e1jwdioe65eipaqubz Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ZOH110+S; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf28.hostedemail.com: domain of dave.hansen@intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=dave.hansen@intel.com X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 0D7B9C0003 X-HE-Tag: 1642543583-140949 Content-Transfer-Encoding: quoted-printable 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 1/18/22 1:19 PM, Khalid Aziz wrote: > This is a proposal to implement a mechanism in kernel to allow > userspace processes to opt into sharing PTEs. The proposal is to add > a new system call - mshare(), which can be used by a process to > create a region (we will call it mshare'd region) which can be used > by other processes to map same pages using shared PTEs. Other > process(es), assuming they have the right permissions, can then make > the mashare() system call to map the shared pages into their address > space using the shared PTEs. One thing that went over my head here was that this allowing sharing of relatively arbitrary *EXISTING* regions. The mshared'd region might be anonymous or an plain mmap()'d file. It can even be a filesystem or device DAX mmap(). In other words, donors can (ideally) share anything. Consumers have must use msharefs to access the donated areas. Right? ( btw... thanks to willy for the correction on IRC.)