Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp282827pxb; Mon, 16 Aug 2021 05:29:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyIp4I3DpMzgo4517JFJBx7uFTcZAqAYyOjUpmD2Ujv9AQTgyV+CzXXwfx3Vq7ojWjKNiT X-Received: by 2002:a17:906:c013:: with SMTP id e19mr15975196ejz.389.1629116975233; Mon, 16 Aug 2021 05:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629116975; cv=none; d=google.com; s=arc-20160816; b=IL8Rqcr36DTSfzXd5Zs3R4bPNyj7nG8gCK5Lq01NeVxQjeyfAsmfJK03hbJWbLwuZL qSHSunJ2yXJnhtNudBRO6Zg5IhmQpuLebxohxWeV9tPbNI/T1XV7oVN0V5RrdnZIbW/m hMXKT23SIrwcAOuJtBo+XfNWcIKJ5qRWG1V5ugscuHop+nJL9ecKLggQzK67Ex9/00j6 SB2hjblkWkE+gUKjW6n8AZiq8ExRQymdGO1qcEqXb6x6i9UdV27ByOVtoQxJHl+4wbeb M86y6A0yWWdeYhmSeKzfg0vsH+nFqOYfsDKfFPWPp03mAt4KRj2MsmGMbkGAssZb6Rt8 WudQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=9b7uoYiuEs1qzXCovxq5e29PNVBebamU9MVAclDrPkI=; b=kCDp0z93fvZ4awx4mDzikOo0uVwPXUSx+JKt+KL+WfOhBplQTmqxvX+/BiT4HvabYo q7rFj64+HcWHYWBYz3WHgXrmEUMfur/z+Ij1wwXHliXQG4AHsE0RRdYtJ8Oe3zJY/FBn ZqCmfq0R5fBrl3yMcjA3AvzHi5NsmoUjflkZPKE37m1wZIOE2y1dvA2Ao52CpG9ZHkk5 4CCMuQa8LJdVNlRuoWiteBoar3iM3WaJZBF4DP//TDrCuDEyzgBOKhMCkwhtGWtPzGSa YRLYUYTESJ9blanhqJe1fO6Ln3e9Uguh46zHpmQU6FzawVALOh3A9f4UZhhdHGEZJOPJ Gmjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eKABnEwx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si9404973edd.516.2021.08.16.05.29.12; Mon, 16 Aug 2021 05:29:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eKABnEwx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233130AbhHPM2R (ORCPT + 99 others); Mon, 16 Aug 2021 08:28:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43529 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbhHPM2Q (ORCPT ); Mon, 16 Aug 2021 08:28:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629116864; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9b7uoYiuEs1qzXCovxq5e29PNVBebamU9MVAclDrPkI=; b=eKABnEwxds/mUmSlkJ70ZMeMWOe7v6bXk+fLXw0BpVAa75fS1cr/LJw92cemgXNgWl5rBZ OygYPLxSecc5c/aZYxtIHf2thwYwJAVGMqolzVUtWoF1k02zUUlDrrbSRZV3mth6ScUBbs e0aCjSZHYKHqkjDlyPsXIRnsjv1JrJ8= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-mc1cReT0Ny2JX3oIj1h5fQ-1; Mon, 16 Aug 2021 08:27:43 -0400 X-MC-Unique: mc1cReT0Ny2JX3oIj1h5fQ-1 Received: by mail-wm1-f69.google.com with SMTP id c2-20020a7bc8420000b0290238db573ab7so7759969wml.5 for ; Mon, 16 Aug 2021 05:27:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=9b7uoYiuEs1qzXCovxq5e29PNVBebamU9MVAclDrPkI=; b=IPkQO7s2to11EFl2ZvipIIiKINvdGNoKDm7/s27pogULSkM8Owv5YiW0kUjuo69wql iLgPZG82LkW81cBa1kDWcQRIgJcYRv5p5K9lrCred4FTSZDsdf3nylSAWSqBUxYZ8BJN Rd4B2IUF6axWpIPlaCUNSiEYwMoxf6q3g/twsk3JFr5YaVFC/WhcUF9FXjMG3B+IqTuV CMDncR7U+7hoSSzlxN4AmS4Iw8Z26Z/GtOs9Hz1KmjMflR68xxVlhVD60cz/ZFj1zddc sy2/sNCe8On2ZXIZv7h7xW27XHYXGUEDOJh0niook0i6wzaYdj5nTxhjimBoeFqLNzsG //nA== X-Gm-Message-State: AOAM532K1bGrc3lIcg7iqT/Yzo1n9PH4L+Iu/rTKorsL7j//Wf3KaPpm FH0iLVXdZYRiT7WjfySGJ/x64PJSJCA+KuNNQQXIkx6/YKa4Q+2u/jemdKYM0XlsvMgBUSQu4Vi 2EpqFcriCGSlJbLV08VgXKTq/ X-Received: by 2002:a05:600c:414f:: with SMTP id h15mr8386884wmm.66.1629116862457; Mon, 16 Aug 2021 05:27:42 -0700 (PDT) X-Received: by 2002:a05:600c:414f:: with SMTP id h15mr8386866wmm.66.1629116862267; Mon, 16 Aug 2021 05:27:42 -0700 (PDT) Received: from [192.168.3.132] (p5b0c67f1.dip0.t-ipconnect.de. [91.12.103.241]) by smtp.gmail.com with ESMTPSA id n3sm2187531wms.2.2021.08.16.05.27.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Aug 2021 05:27:41 -0700 (PDT) Subject: [private] Re: [RFC PATCH 0/5] madvise MADV_DOEXEC To: Matthew Wilcox Cc: Khalid Aziz , "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" , Steven Sistare , Anthony Yznaga , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "Gonglei (Arei)" References: <1595869887-23307-1-git-send-email-anthony.yznaga@oracle.com> <43471cbb-67c6-f189-ef12-0f8302e81b06@oracle.com> <55720e1b39cff0a0f882d8610e7906dc80ea0a01.camel@oracle.com> From: David Hildenbrand Organization: Red Hat Message-ID: <86ebdfe4-22ee-9a9a-9d06-8305290d9bc9@redhat.com> Date: Mon, 16 Aug 2021 14:27:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16.08.21 14:07, Matthew Wilcox wrote: > On Mon, Aug 16, 2021 at 10:02:22AM +0200, David Hildenbrand wrote: >>> Mappings within this address range behave as if they were shared >>> between threads, so a write to a MAP_PRIVATE mapping will create a >>> page which is shared between all the sharers. The first process that >>> declares an address range mshare'd can continue to map objects in the >>> shared area. All other processes that want mshare'd access to this >>> memory area can do so by calling mshare(). After this call, the >>> address range given by mshare becomes a shared range in its address >>> space. Anonymous mappings will be shared and not COWed. >> >> Did I understand correctly that you want to share actual page tables between >> processes and consequently different MMs? That sounds like a very bad idea. > > That is the entire point. Consider a machine with 10,000 instances > of an application running (process model, not thread model). If each > application wants to map 1TB of RAM using 2MB pages, that's 4MB of page > tables per process or 40GB of RAM for the whole machine. Note that I am working on asynchronous reclaim of page tables, whereby I would even reclaim !anonymous page tables under memory pressure. Assuming your processes don't touch all memory all the time of course ... of course, it's a research project and will still require quite some work because devil is in the detail (locking). -- Thanks, David / dhildenb