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=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 E36BAC432BE for ; Mon, 16 Aug 2021 12:27:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD41263256 for ; Mon, 16 Aug 2021 12:27:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232743AbhHPM2X (ORCPT ); Mon, 16 Aug 2021 08:28:23 -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-Google-Smtp-Source: ABdhPJxEyrhXose6dDXwciuAwsFQKnwAOY30N7d0eihe8mA22c6bXK9Bf+kwMzU+XQu5mEJ8kEgoVg== 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