Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2938435rwi; Fri, 21 Oct 2022 09:30:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66Ws8hXuiiGy8uvdsJN2LSeauVp0k1rkRELLLzYRaU2z1EydkOPObRniUCAjt1Jh6sGhc7 X-Received: by 2002:a17:907:b11:b0:78d:e71a:6e6 with SMTP id h17-20020a1709070b1100b0078de71a06e6mr16424859ejl.14.1666369851280; Fri, 21 Oct 2022 09:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666369851; cv=none; d=google.com; s=arc-20160816; b=PryQ6xHUpBl2wkoyLp3q5uEN1MCKT4E8zPlbeE0Hbi3sdN9JRLeY3p5rMuulNPkTc0 ZFjfoZdF7Gbsa+V+Q5NyNSZoC9jrfPu/FXBHyDJZfaSTWdxnLGxYRRCa2gRIOXJKyQzu DH3qfdqqT+EWCSGK7Bk3wKr4yH6TxMhgAwCgeEveC2M8DQ8iwEWm1lXgdzBZrTOU3nnV 4eBE/yoZbax/sm5Denlf2jG9eSfISkAsS/ZuP35f2Gikchrw/bho/MUpExF2Dm/9ggLz yB9yXOyippY06ft/DnFTbUQgeLG0n4XLkS90a/o5cBVuilo6DER/1tTYx5+LC66/kO1s qgRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PIRb6+ovxp5J4uJ1hVDeWHpfyBDCzaaTh1iPpdxBBXo=; b=Jdiqq1SaMBDWT5JnMXtwhngqKSxNgmTs67my+Yy6umjKkUkN6izwcNovbIy7ZZUYJU lg8wePy0nEvODSVdb+6Y1mXLAsIwJtmLb1WQ6IhM1FGgoaj2TCUBdn16RH4blbY8kO3k qswo+qmhNs0TkGn7ZJ8CycoTITXJo7SfJRgi8KXTQfAP6YA8bmA1EWSmYDuYspOlhDmz raPxnts0hzl+LR6bkQID9a3by8FD0MV5+oQjFemZdBY19WjZN3xnS3H35gPxKOh8h1md U7cm69ayHTS4DDlBYQmrklKcoGXo8UJtPs8jF86uD8QrzLc7veP+A4JS/S4wNJ+S6Elj 8REA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LBbRjb9H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a056402090b00b00457053aadeasi24994502edz.398.2022.10.21.09.30.24; Fri, 21 Oct 2022 09:30:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LBbRjb9H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbiJUQSX (ORCPT + 99 others); Fri, 21 Oct 2022 12:18:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbiJUQSU (ORCPT ); Fri, 21 Oct 2022 12:18:20 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0334E249887 for ; Fri, 21 Oct 2022 09:18:19 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id f9so2758746plb.13 for ; Fri, 21 Oct 2022 09:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PIRb6+ovxp5J4uJ1hVDeWHpfyBDCzaaTh1iPpdxBBXo=; b=LBbRjb9HoKMsM0BrB5Yx8EKkNw2z2slGB6RREjreEOgAz6cf4w0roEfiOfI1ISkxC3 umCpqoYJ+BxiTeH6mDoFf2MIPMRAa8KHajTmAG5q0NIMZtDgJyPYDAp4OEAVmIJyfonP YVdGEHCQT54p0r2x+JlsthZbC8pGVdj+LT/dxHs3Utvt9tNW6l/hE2qLrAwkHAoOVZeH cqWWQ1T7dnKxpoX4VIogeOoRSjB+ibtFx6bQv9mAbDdRyNK9AcGDi4qG7P8xM/rtcTeQ giQByT9/HXaV3sGzuy8Kux9ZJVNncssFk2zzM8JEHArzX1QytiIWnjlmf1c2NjGzQeqm YCQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PIRb6+ovxp5J4uJ1hVDeWHpfyBDCzaaTh1iPpdxBBXo=; b=Gw7r/3PvD7Sr1soPKHOxS2D3kb1wZnSaOSoyUyhhIemrd7sYrETd6Cj2Mh/7X3V3cj nHKeRdynHLTwfo5IzHS8OpoKOOzc/GopCrULSO/i/IX23SEKo86GFGbBZOWDG33A7nsI 7kCEL7igX6Z7rblIiXiGeH5wawUE5jzgAVItaYFza+Zsn25ZMpqbS9HJJhpsFia1w5JY BVzZNzOtFRY56Ex7SR/5GX+rXDaTjRjsPQmgHj2beJgEvI4U5fl1kMHq75iFEYtNtHjC O29OKKAaCHlD8FCqxTw78/jvIDBS3SwhZBgE04ChMxXeSWN6dLBslX34nxHJ5xLXQxYE 1uzw== X-Gm-Message-State: ACrzQf3SX1LR50t9AAT8hsQKWGUusIvcUYp+aOEUNv1Yah/vVumg5JKf QUPQkCAuLP7bDKoRSK/GTa2PrA== X-Received: by 2002:a17:903:50e:b0:182:631b:df6f with SMTP id jn14-20020a170903050e00b00182631bdf6fmr20228449plb.66.1666369098415; Fri, 21 Oct 2022 09:18:18 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id t3-20020a170902b20300b0017f61576dbesm14948739plr.304.2022.10.21.09.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 09:18:17 -0700 (PDT) Date: Fri, 21 Oct 2022 16:18:14 +0000 From: Sean Christopherson To: Chao Peng Cc: Vishal Annapurve , 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 , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , wei.w.wang@intel.com Subject: Re: [PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd Message-ID: References: <20220915142913.2213336-1-chao.p.peng@linux.intel.com> <20220915142913.2213336-2-chao.p.peng@linux.intel.com> <20221021134711.GA3607894@chaop.bj.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221021134711.GA3607894@chaop.bj.intel.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 21, 2022, Chao Peng wrote: > > > > In the context of userspace inaccessible memfd, what would be a > > suggested way to enforce NUMA memory policy for physical memory > > allocation? mbind[1] won't work here in absence of virtual address > > range. > > How about set_mempolicy(): > https://www.man7.org/linux/man-pages/man2/set_mempolicy.2.html Andy Lutomirski brought this up in an off-list discussion way back when the whole private-fd thing was first being proposed. : The current Linux NUMA APIs (mbind, move_pages) work on virtual addresses. If : we want to support them for TDX private memory, we either need TDX private : memory to have an HVA or we need file-based equivalents. Arguably we should add : fmove_pages and fbind syscalls anyway, since the current API is quite awkward : even for tools like numactl.