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 23556C4338F for ; Mon, 16 Aug 2021 12:27:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CA0656325B for ; Mon, 16 Aug 2021 12:27:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CA0656325B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6B8AA6B0073; Mon, 16 Aug 2021 08:27:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 668D06B0074; Mon, 16 Aug 2021 08:27:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 557EB6B0075; Mon, 16 Aug 2021 08:27:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id 3B97A6B0073 for ; Mon, 16 Aug 2021 08:27:48 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C839818224B47 for ; Mon, 16 Aug 2021 12:27:47 +0000 (UTC) X-FDA: 78480870174.04.415FF41 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 6B4647004740 for ; Mon, 16 Aug 2021 12:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629116866; 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=S1FU2kBnX0Z2GeHVHNmlL8WaNBjLjmzpyFPr40LdT8tbec98k9/u/A20ZsxMC3CT7a13mb lKYP8H4KUyt/m9HgJIq59rFdc7DVB/n+Xiz/icszZNjd/1TrF/8YeMqNhAgYMLIda6kNSK xKRjH8MgSHIpDhyEd/CnkzsvJZhszD8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-131-01TmUAzpO3uXKckNGOsm0w-1; Mon, 16 Aug 2021 08:27:43 -0400 X-MC-Unique: 01TmUAzpO3uXKckNGOsm0w-1 Received: by mail-wm1-f70.google.com with SMTP id n20-20020a05600c4f9400b002e6dc6a99b9so1012977wmq.1 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=OTEWo95oIAmVjIewnEYTPd9SWWVx0UkQAGYtFuoU/qW7in7dptJplv7Zs10koAiYqP fkMEhTpWPg7CsV7/zQTOir/7qIBFGaapNL8HEHuKQutQL5Wx87RdhtAYa/s2rjhVIUDO bPv6JJPn3bsQPXCPQrvM6AiRTdaJ6HjjkzZzoBywuY/zoGPAQ+4nl48wzv8pnT9KKiaj 2pWw7iFlpO5bXdFnadQhWT1pDREqx4buZumc92kzZSddzshQvQGpHzDLgiHGBcOvYZPJ VISF+IGN4VtI0swsFfnj4W06v/kPYXRxIxT0ZWrOyGN5A4Y6vRo/DD3zo4ONqPUFF7oq 9VPA== X-Gm-Message-State: AOAM5303ObQKFkL99RwkdtWkFFmUcXj6WPoosWGYFMN+Kvjvq2mQFscL SzwzDxal3mfoIFCrwgtUvedgpRm3/gMlHHAwalauEDpKHziQYeqvB7CZdX1PTYN+JYhrQGihUmZ 8B5+83bedZ5Q= X-Received: by 2002:a05:600c:414f:: with SMTP id h15mr8386886wmm.66.1629116862458; 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: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6B4647004740 X-Stat-Signature: 69z3zo4kcy5ew5b33w8zimbp9ruff84z Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=S1FU2kBn; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf02.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-HE-Tag: 1629116867-79763 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 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