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 0D431C433F5 for ; Mon, 7 Mar 2022 10:12:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 475D58D0002; Mon, 7 Mar 2022 05:12:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 424C98D0001; Mon, 7 Mar 2022 05:12:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29ED38D0002; Mon, 7 Mar 2022 05:12:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0008.hostedemail.com [216.40.44.8]) by kanga.kvack.org (Postfix) with ESMTP id 18A3B8D0001 for ; Mon, 7 Mar 2022 05:12:50 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B747E1830BB75 for ; Mon, 7 Mar 2022 10:12:49 +0000 (UTC) X-FDA: 79217176458.17.6098A96 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 313EC1C0006 for ; Mon, 7 Mar 2022 10:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646647968; 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=EAtJPNtZqQT+pzIC8Y0yY8ijMFQMxHJn+7uAlJm9E2A=; b=UZ+SDSnDZF+VsXQQefNOfVqNhUYEVXSyB5COW9cgKPDjqCDYYi63cbRm5MbY8glNzzlGYa x4DgPQWgUDEb/WE8ygjXLrXp0XGKTG+QHqXsj4YK3Y7s5SIJSsqIRDU2oEoAaqI/kFN7Ow YhYnq6VcqsKznBAzdBvLP4T1gcK9vzM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-d6aG74V6PJSgUOUu_UIlVA-1; Mon, 07 Mar 2022 05:12:47 -0500 X-MC-Unique: d6aG74V6PJSgUOUu_UIlVA-1 Received: by mail-wm1-f72.google.com with SMTP id z9-20020a7bc7c9000000b00389bd375677so24164wmk.4 for ; Mon, 07 Mar 2022 02:12:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=EAtJPNtZqQT+pzIC8Y0yY8ijMFQMxHJn+7uAlJm9E2A=; b=gE5mlPBicQEekaZ1G+RuDMouGdPOZFq+tQ+L0B9PEr3GkzB5BGLjtJgqrdBtn1L9nD TkkcJVM7AlmwsHTKZjTk3Z2sRRqZBmFsaJmraKt4/3AE4YAdk9PKAVpBVzvKuRxtM4SZ Rx85HetBtIP+5mpXql6y0sfe8jv34ud6os9WAihv61j2sEoSTqe0oso78dLS65TD9kk0 Lee0N19oEwqlW/nXWZGh5OOqq/mObI/2gnAONclK587GY/9OVIypQhPXOkNECit0G6Eq /6EuUyztlwjzrZt29gNbETSdC9xRLKmrNERVD8sDgnq6gsB9dwLZg6I8mHADcPN6O2VJ CpzA== X-Gm-Message-State: AOAM531+zaTsnnyxcHpc3yg836P5QrF010zH6cjtXZw8ahtWlBA2w15r A9jpSL0u/BwzCOVNzFMkPbygVkCiPFJK0yIwhB0i0obZV055w80xWYb1gwV5mmXEdHYMDuIQCks QGGLl3vmIRF8= X-Received: by 2002:a5d:6046:0:b0:1f0:4973:142f with SMTP id j6-20020a5d6046000000b001f04973142fmr7674915wrt.538.1646647966510; Mon, 07 Mar 2022 02:12:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEV99RC6J+Vin5f1sKjrk/pcIneCd29UN8hGV1eMibccSf0NvkVF1D5zaL4pxEGhCcclmMGQ== X-Received: by 2002:a5d:6046:0:b0:1f0:4973:142f with SMTP id j6-20020a5d6046000000b001f04973142fmr7674887wrt.538.1646647966292; Mon, 07 Mar 2022 02:12:46 -0800 (PST) Received: from ?IPV6:2003:cb:c705:1e00:8d67:f75a:a8ae:dc02? (p200300cbc7051e008d67f75aa8aedc02.dip0.t-ipconnect.de. [2003:cb:c705:1e00:8d67:f75a:a8ae:dc02]) by smtp.gmail.com with ESMTPSA id bg18-20020a05600c3c9200b0037c2ef07493sm14954074wmb.3.2022.03.07.02.12.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Mar 2022 02:12:45 -0800 (PST) Message-ID: Date: Mon, 7 Mar 2022 11:12:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH RFC 0/3] MAP_POPULATE for device memory To: Jarkko Sakkinen , linux-mm@kvack.org Cc: Dave Hansen , Nathaniel McCallum , Reinette Chatre , Andrew Morton , linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Fainelli , Thomas Bogendoerfer , Matthew Auld , =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= , Daniel Vetter , Jason Ekstrand , Chris Wilson , Maarten Lankhorst , Greg Kroah-Hartman , Tvrtko Ursulin , Vasily Averin , Shakeel Butt , Michal Hocko , zhangyiru , Alexey Gladkov , Alexander Mikhalitsyn , linux-mips@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, codalist@coda.cs.cmu.edu, linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20220306053211.135762-1-jarkko@kernel.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220306053211.135762-1-jarkko@kernel.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 313EC1C0006 X-Stat-Signature: jc6nqjitojppus3rbm8hqiss9soaay5j Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UZ+SDSnD; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf21.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-HE-Tag: 1646647969-818010 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000063, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 06.03.22 06:32, Jarkko Sakkinen wrote: > For device memory (aka VM_IO | VM_PFNMAP) MAP_POPULATE does nothing. Allow > to use that for initializing the device memory by providing a new callback > f_ops->populate() for the purpose. > > SGX patches are provided to show the callback in context. > > An obvious alternative is a ioctl but it is less elegant and requires > two syscalls (mmap + ioctl) per memory range, instead of just one > (mmap). What about extending MADV_POPULATE_READ | MADV_POPULATE_WRITE to support VM_IO | VM_PFNMAP (as well?) ? -- Thanks, David / dhildenb