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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B955C433F5 for ; Mon, 7 Mar 2022 10:54:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241051AbiCGKzO (ORCPT ); Mon, 7 Mar 2022 05:55:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237479AbiCGKyn (ORCPT ); Mon, 7 Mar 2022 05:54:43 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5BF5A8ED9 for ; Mon, 7 Mar 2022 02:14:33 -0800 (PST) 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-294-xOIGQxzDMviS3hzyGxVyyA-1; Mon, 07 Mar 2022 05:12:47 -0500 X-MC-Unique: xOIGQxzDMviS3hzyGxVyyA-1 Received: by mail-wm1-f72.google.com with SMTP id 20-20020a05600c231400b00389886f6b23so4433760wmo.6 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=Q3A5bQ5E535RkYmAP76LuIVSI4EEXnnZp8oe+vW7MCZeMJhz39fxFkw/Ca+YfY5quz GqttDE773dSZlKXrCVs8IdX1nvQ5LuGQ38PbcsgzpDhUaTVermXSuCjbAdm5Kfyk8Erd i6vUbO35CzjZ01QpBustbPMZHb8FRuKKfjETFHsCNpywB+TBxphW273XE4MuuCWCngyW hL6SpwpzdvXleK1pssfBKKkpFgns1PWg0h33cqkIpgi2hYV4aiKX2wAH5xjBXMo47LBH R6j9OcIZCwiziIFt8HUnZekT9zOz96GADgFbfFBm4vG3ujSuCs8CqCrosJbaiKiobXRB SYtw== X-Gm-Message-State: AOAM531pEcyH6jcWAe1rUJZ3ggiSz7t3sntUxEIBQTnqnO56v6WKGrUO P/locvXaaihb+FstUaWv44/0QHWj/a5vd5T5DLTHp3GOnHX0ImtJWIJUmBqnXPo285TxRj2CYgL JMLB7uSwHOm1Ti9JF5zFDpA== X-Received: by 2002:a5d:6046:0:b0:1f0:4973:142f with SMTP id j6-20020a5d6046000000b001f04973142fmr7674901wrt.538.1646647966508; 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 Content-Language: en-US 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org 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