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 06088C6FA82 for ; Fri, 23 Sep 2022 15:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbiIWPVa (ORCPT ); Fri, 23 Sep 2022 11:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232562AbiIWPVC (ORCPT ); Fri, 23 Sep 2022 11:21:02 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B30BB5A73 for ; Fri, 23 Sep 2022 08:20:59 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id k10so817653lfm.4 for ; Fri, 23 Sep 2022 08:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=buJ2Vw0w3M4WrtI5/DU3oXsQobrkkmx9rFyElDeN7mE=; b=e4OQSAjFu3gpxUO4Unn7HPTzW4khEaeLVPKzk0HjIO1WzfoYTIkCo/F1RYrvwR66SF JwCMt5XxADhIKzoYXxMVuOAC/AuI4zxQZgSxUcFBjf8hrr2yXlfmAMcitgt6vZxhWH7Z +VIcwj2/Ns3wteLBkCd1UIvA6lB5eXh/e73AYfVmUkfoy7XbWsS6Q2HYL5D+SrhsOsPZ qOl0jP48UI31PUrNDZzwE9j3uXZ/4o/lWYfvXhojlsVXKd3GrscU+YcreZEHR9zMjYjf xc0uDmUYT7UwO9Q1pGoCLduSZHAasvlCEIMiRTg83bldOSofpAYj2YT99ZO5jc8hyvkT Y9Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=buJ2Vw0w3M4WrtI5/DU3oXsQobrkkmx9rFyElDeN7mE=; b=CdXlBwxQvfBAasSO4O6pkOJqGdEDZJDZYhBQHlEeiREAhd2/+eVGBHQOEoe0GTo+m5 dc/0raj849NYiPVeRPhXb+SJATUVQr41CdddWqp24W+17JjchNpLjpWO2N535BHb6vf0 JFmxLLbxVh4P6wqjKwKEEXS6OxsJJTgQR+c1VHIJzjle5IoVj5EP32+MnFzRQXdRdoeg tLsk6AmrhN4p5bRO0USPMEe7ENSkf/FaIT1YO1+8Z+cJoDNT4oYRHDtPRXrnZ09uggRx 3HI20GOIHE//632nqsjtLu8kfobqTjQpiQ74I86NTSVShVAJ7xt/QzrYl/w/NPm5cIQj 3RQQ== X-Gm-Message-State: ACrzQf2PLlmcTuVOJG95FxC4Pzms+MVks30mtOZ8Bj1P1HPcitkUH2Nl pzmZiFkQda5FtzJ6zp6JfZwl8dkCw5z9LIjjw1mdqw== X-Google-Smtp-Source: AMsMyM7tQgOI6niyU5IXyfNHgsog0iDYl0WXgb5yVh7a8oMMnxo4TbbSeRkhbm4RLcMIb8opCLgiEX29WHKjDwAENJs= X-Received: by 2002:a05:6512:b85:b0:499:202a:bde9 with SMTP id b5-20020a0565120b8500b00499202abde9mr3630798lfv.550.1663946457534; Fri, 23 Sep 2022 08:20:57 -0700 (PDT) MIME-Version: 1.0 References: <20220915142913.2213336-1-chao.p.peng@linux.intel.com> <20220915142913.2213336-2-chao.p.peng@linux.intel.com> <20220923005319.wkzpl36uailh4zbw@box.shutemov.name> In-Reply-To: <20220923005319.wkzpl36uailh4zbw@box.shutemov.name> From: Fuad Tabba Date: Fri, 23 Sep 2022 16:20:21 +0100 Message-ID: Subject: Re: [PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd To: "Kirill A . Shutemov" Cc: Sean Christopherson , "Wang, Wei W" , Chao Peng , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-fsdevel@vger.kernel.org" , "linux-api@vger.kernel.org" , "linux-doc@vger.kernel.org" , "qemu-devel@nongnu.org" , Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "x86@kernel.org" , "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Lutomirski, Andy" , "Nakajima, Jun" , "Hansen, Dave" , "ak@linux.intel.com" , "david@redhat.com" , "aarcange@redhat.com" , "ddutile@redhat.com" , "dhildenb@redhat.com" , Quentin Perret , Michael Roth , "Hocko, Michal" , Muchun Song Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Sep 23, 2022 at 1:53 AM Kirill A . Shutemov wrote: > > On Thu, Sep 22, 2022 at 07:49:18PM +0000, Sean Christopherson wrote: > > On Thu, Sep 22, 2022, Wang, Wei W wrote: > > > On Thursday, September 15, 2022 10:29 PM, Chao Peng wrote: > > > > +int inaccessible_get_pfn(struct file *file, pgoff_t offset, pfn_t *pfn, > > > > + int *order) > > > > > > Better to remove "order" from this interface? > > > > Hard 'no'. > > > > > Some callers only need to get pfn, and no need to bother with > > > defining and inputting something unused. For callers who need the "order", > > > can easily get it via thp_order(pfn_to_page(pfn)) on their own. > > > > That requires (a) assuming the pfn is backed by struct page, and (b) assuming the > > struct page is a transparent huge page. That might be true for the current > > implementation, but it most certainly will not always be true. > > > > KVM originally did things like this, where there was dedicated code for THP vs. > > HugeTLB, and it was a mess. The goal here is very much to avoid repeating those > > mistakes. Have the backing store _tell_ KVM how big the mapping is, don't force > > KVM to rediscover the info on its own. > > I guess we can allow order pointer to be NULL to cover caller that don't > need to know the order. Is it useful? I think that would be useful. In pKVM we don't need to know the order, and I had to use a dummy variable when porting V7. Cheers, /fuad > -- > Kiryl Shutsemau / Kirill A. Shutemov