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 C7345C04A6A for ; Tue, 1 Aug 2023 19:28:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A1CF2800F2; Tue, 1 Aug 2023 15:28:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 32AF82800C8; Tue, 1 Aug 2023 15:28:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1CB4D2800F2; Tue, 1 Aug 2023 15:28:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0A8D42800C8 for ; Tue, 1 Aug 2023 15:28:12 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id AF826C060E for ; Tue, 1 Aug 2023 19:28:11 +0000 (UTC) X-FDA: 81076521582.08.7BB68E1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 3A8AB80006 for ; Tue, 1 Aug 2023 19:28:08 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FWrX0z28; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690918089; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gaut94wtJvcD0zi3q7k4JYT7+QEi/Ua5L41+y8I+W9A=; b=0eVYqZ28/t909Ff0Der04XBeQh3QxEfbVsT1ca8yulQEHpqf/yJaullmNI1N6IclZxgEik Qr41DR+psTjvoKcLWFTHbwjiRF+LarxYQ5k7uAy+TyYM7hDSU6YoCroFjuZq0SfiQEveaZ GvoOLmbYeORmh7QrKRYDFt/smWgzjSI= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=FWrX0z28; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690918089; a=rsa-sha256; cv=none; b=0w9PDLgJRlWblKf1wlQMWR+WOOOBWxIG0ygxoN82+Si1F7YQy8EsEI32yJiRTwUR1VL2yt N0QRnNVjHsDcC/NWnAbvnftnFWp/5hTcCr2okUp+vNQtO2tR6SLvmy1cmqdlcIeAS3OVLA sZxOP8yJXVJc1KxfRRhIXha4KQ+jLZU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=gaut94wtJvcD0zi3q7k4JYT7+QEi/Ua5L41+y8I+W9A=; b=FWrX0z28U3EqiQJrIFfM/btNnD h0r6Q0OJ3rp5KMXJorNilcAfp8f3kEIhltT8RjmJWCxZ+EUksczMNZPOLsVqYa8HvYCGAKxjvRc6Z ZHXdgNjBBXysu78uR2VE4uvd/UnmJTUo3BNeWLgbqgStaLTfK4lAPj83qDQEU85kHEyUSozuXFVlJ y1i8KQOzRWSaUDKfxEWBhsPHwkBEDJQPlrogyIqDoeihbK6N8zE1PqhZkxC3zwUdvdzanaPkJK5nq VdvR8Yc4tHO6vQgiV2CjJtdAth0lqVMHIYcwyP+9RxH1FNA2UhNOA8i99+Whl9iPkLdc/nlZ850V3 puAflRfA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qQv2I-00AacX-ID; Tue, 01 Aug 2023 19:28:02 +0000 Date: Tue, 1 Aug 2023 20:28:02 +0100 From: Matthew Wilcox To: Rongwei Wang Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, "xuyu@linux.alibaba.com" Subject: Re: [PATCH RFC v2 0/4] Add support for sharing page tables across processes (Previously mshare) Message-ID: References: <74fe50d9-9be9-cc97-e550-3ca30aebfd13@linux.alibaba.com> <9faea1cf-d3da-47ff-eb41-adc5bd73e5ca@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 3A8AB80006 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: gp495zhb6rj9jhys49uqgyo648szbrh5 X-HE-Tag: 1690918088-624620 X-HE-Meta: U2FsdGVkX19psAWzFWf937lnMq7KWO5AIULrtZCkIM7+8nTGFiZQBsoSZYLySvsl4pex/4SJDEtVdlPqVRGjXihjeIl6DGmRWHuBE/tnUwZjIk1Zs/82Q/qOx4XS6fzkFTFQE7oc3sbNi4kQcRsLI6cnR5CGFc1Xcsk9HqTg90oDkkOcWcIxo7McL2cQ/agv1/8iZ25BpGe4bxRQYjsK6ejXwZiJ/bE3i76ubdY5vtsFVy34gfZhmt+4HgdkbNPTvVDlfi+ku+IT3xWryFxl4MbyD2bXgIVhAOdBpMpnsUeLigIz5p/luc+Pc622Dg4Fnr9pf3pE1KxUTg4H9HYl7IQ10gRQ1NsqnCPYqY13yjJw8wAgdfAmz60eOguDEYi26kv97b78aq72OGniUxNvqrlO3lDbo4UgWt8nW1YpeEvDaMTcZTtJOJn8hoi1lIpnuFo5zB2tv8aWUshqK36I54LGr4h+k53XOHesTybTn38SX774qP1NVsk7lBGZJ0Bl1GvIctdB345xO29G7ZsjjRcLNZahIohR2ZBhPGmPCchW7Cn6OMlaFMoQMCq3iGAk0Kd585cj1Wl+HcTK0PI3fnKonMOKKdIg3bWBkJZO7Af79p7g9gdfjO9nM4TzOvmJ1aebN6AnM0bGaNrIe1/iRlJ+upLUI4cLBrQ0WHnC3DeBtMQv8k4nZvwhZGWYBgTFS1Q+2lGvO16h55InPcFVXtyVpamWi68HRJmT/OPmJiF9oVqtG6R9tag+Tb+ewb97lcTgxJ8cHriu1FjQdkoYzTVvYRzKSBM/7ZUFyHp5luMo5YFpAqTN2HWGudhYbEOGCYNNPtbeC3aJiDlDgqy0NjIcOOeXd03CqeIYgpNDXPTXD6rn/cGoVSEgGWxmURVsT15pPz9B0mrI+jxtY9nT08YInKhG8O4prxRipVDd90CFlIWqViGOFkCCGrxqiHD7i6S4KQ4WYbw5z9wx1/e HAcaqEfP /+3EaqyEK9m+gogc3TDj0C3d/6NwGDRT2q5rWfofFI9FloXhdLS8vXthTgwddgGcnJGjW2N212TFE7o0OEdgSvye/t7Sfe+QwxCZ/eGRXWyP2PbS42/Gvtzt6JfxptR13Bb+bx2UiewTUdvYyh7/V8hCtLt+HtDqAb6vFrd2OFS4cdFg= 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 Tue, Aug 01, 2023 at 02:53:02PM +0800, Rongwei Wang wrote: > > On 2023/8/1 00:38, Matthew Wilcox wrote: > > On Mon, Jul 31, 2023 at 06:30:22PM +0200, David Hildenbrand wrote: > > > Assume we do do the page table sharing at mmap time, if the flags are right. > > > Let's focus on the most common: > > > > > > mmap(memfd, PROT_READ | PROT_WRITE, MAP_SHARED) > > > > > > And doing the same in each and every process. > > That may be the most common in your usage, but for a database, you're > > looking at two usage scenarios. Postgres calls mmap() on the database > > file itself so that all processes share the kernel page cache. > > Some Commercial Databases call mmap() on a hugetlbfs file so that all > > processes share the same userspace buffer cache. Other Commecial > > Databases call shmget() / shmat() with SHM_HUGETLB for the exact > > same reason. > > > > This is why I proposed mshare(). Anyone can use it for anything. > > Hi Matthew > > I'm a little confused about this mshare(). Which one is the mshare() you > refer to here, previous mshare() based on filesystem or this RFC v2 posted > by Khalid? > > IMHO, they have much difference between previously mshare() and > MAP_SHARED_PT now. I haven't read this version of the patchset. I'm describing the original idea, not what it may have turned into. As far as I'm concerned, we're still trying to decide what functionality we actually want, not arguing about whether this exact patchset has the correct number of tab indents to be merged.