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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D2D2C11F66 for ; Tue, 13 Jul 2021 00:58:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AFD2F611CC for ; Tue, 13 Jul 2021 00:58:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFD2F611CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 911726B008A; Mon, 12 Jul 2021 20:58:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C19B6B008C; Mon, 12 Jul 2021 20:58:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 762696B0095; Mon, 12 Jul 2021 20:58:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id 4A5226B008A for ; Mon, 12 Jul 2021 20:58:10 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 51871181AEF23 for ; Tue, 13 Jul 2021 00:58:09 +0000 (UTC) X-FDA: 78355753098.23.5E5A4D5 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf30.hostedemail.com (Postfix) with ESMTP id 0FCECE001804 for ; Tue, 13 Jul 2021 00:58:07 +0000 (UTC) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GP2Ct5sKzzXsS1; Tue, 13 Jul 2021 08:52:26 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 13 Jul 2021 08:57:59 +0800 Received: from dggpeml500016.china.huawei.com (7.185.36.70) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 13 Jul 2021 08:57:59 +0800 Received: from dggpeml500016.china.huawei.com ([7.185.36.70]) by dggpeml500016.china.huawei.com ([7.185.36.70]) with mapi id 15.01.2176.012; Tue, 13 Jul 2021 08:57:59 +0800 From: "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" To: Matthew Wilcox CC: Steven Sistare , Anthony Yznaga , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "Gonglei (Arei)" Subject: RE: [RFC PATCH 0/5] madvise MADV_DOEXEC Thread-Topic: [RFC PATCH 0/5] madvise MADV_DOEXEC Thread-Index: AQHXc97/nCzRwgdWL0SQOyOsHiWdfas4gR6AgAWFHYCAAAbcAIACA3Tw Date: Tue, 13 Jul 2021 00:57:59 +0000 Message-ID: References: <1595869887-23307-1-git-send-email-anthony.yznaga@oracle.com> <43471cbb-67c6-f189-ef12-0f8302e81b06@oracle.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.148.223] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0FCECE001804 X-Stat-Signature: gjrh8yk4nchepnpapft8dstum43qxwri Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of longpeng2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=longpeng2@huawei.com X-HE-Tag: 1626137887-523163 X-Bogosity: Ham, tests=bogofilter, spamicity=0.001152, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Matthew, > -----Original Message----- > From: Matthew Wilcox [mailto:willy@infradead.org] > Sent: Monday, July 12, 2021 9:30 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: Steven Sistare ; Anthony Yznaga > ; linux-kernel@vger.kernel.org; > linux-mm@kvack.org; Gonglei (Arei) > Subject: Re: [RFC PATCH 0/5] madvise MADV_DOEXEC >=20 > On Mon, Jul 12, 2021 at 09:05:45AM +0800, Longpeng (Mike, Cloud > Infrastructure Service Product Dept.) wrote: > > Let me describe my use case more clearly (just ignore if you're not > > interested in it): > > > > 1. Prog A mmap() 4GB memory (anon or file-mapping), suppose the > > allocated VA range is [0x40000000,0x140000000) > > > > 2. Prog A specifies [0x48000000,0x50000000) and > > [0x80000000,0x100000000) will be shared by its child. > > > > 3. Prog A fork() Prog B and then Prog B exec() a new ELF binary. > > > > 4. Prog B notice the shared ranges (e.g. by input parameters or ...) > > and remap them to a continuous VA range. >=20 > This is dangerous. There must be an active step for Prog B to accept Pro= g A's > ranges into its address space. Otherwise Prog A could almost completely = fill > Prog B's address space and so control where Prog B places its mappings. = It > could also provoke a latent bug in Prog B if it doesn't handle address sp= ace > exhaustion gracefully. >=20 > I had a proposal to handle this. Would it meet your requirements? > https://lore.kernel.org/lkml/20200730152250.GG23808@casper.infradead.org/ I noticed your proposal of project Sileby and I think it can meet Steven's = requirement, but I not sure whether it's suitable for mine because there's = no sample code yet, is it in progress ? According to the abstract of Sileby, I have two questions: 1. Would you plan to support the file-mapping memory sharing ? e.g. Prog A'= s 4G memory is backend with 2M hugetlb. 2. Does each mshare fd only containe one sharing VMA ? For large memory pro= cess (1T~4T in our env), maybe there is hundreds of memory ranges need to b= e shared, this will take too much fd space if so ?