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 50296EB64D7 for ; Fri, 23 Jun 2023 17:28:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C31008D0006; Fri, 23 Jun 2023 13:28:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE11E8D0003; Fri, 23 Jun 2023 13:28:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A81E68D0006; Fri, 23 Jun 2023 13:28:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 97BCD8D0003 for ; Fri, 23 Jun 2023 13:28:32 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5D96BC02D7 for ; Fri, 23 Jun 2023 17:28:32 +0000 (UTC) X-FDA: 80934696864.19.B30C3A8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 1DE4D4000E for ; Fri, 23 Jun 2023 17:28:28 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CvvxRZ26; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687541309; a=rsa-sha256; cv=none; b=s5m18bH806Y1Qk7qwoSSKfRkTMkgmvMsVNKQNM5tH6CsfJOmuWZr+cQFj5QbbunAdq9yj6 PEvBdlLq3Ft+RF9EOk/r/WkUNIAvl9YkjuS6vJQk8JYjJGfXTlawGTReXcMPVCpIsDoFz1 1LKiko+QtbepZg/8Q4hiMfcRyCT2//U= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CvvxRZ26; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687541309; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6fU0VQ2K9z1Jj6RIKw9Q80E8iMxB7q7U8hKNsz0tnJQ=; b=e1eVnAKIbbPzEVLH+CdhYJYsBoOaeL9gJIu9B3k6Pq/PCqjdsk/hjgUx/tufnSjM/aEVT6 1vOdriKsyTjFksoHY8zfvfPH6k0rJ0gk4cuf7LS3JdSr4Z78YfxmMWY2tlQV4E0AKAZ1l3 Nf0B3q9AKYGLho0cB+aiN2HmZY7sPds= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687541308; 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: in-reply-to:in-reply-to:references:references; bh=6fU0VQ2K9z1Jj6RIKw9Q80E8iMxB7q7U8hKNsz0tnJQ=; b=CvvxRZ26f/jjHZlW29BtwO8KasMP2xwicGzDWbvReCOv6EoNAfgyPCPK+mXI8qST+lzlGc BumN8YJa4vP86CnZinKzzUwNV9ullMTAj0UCCzy/jY/98rRnvt5ayXLARmT4SlfBhI9igX 4z9KGopmGoZqhKSlgsUmJHGEMr0xPes= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-VO3m0188MSKb8BYgYtfSCQ-1; Fri, 23 Jun 2023 13:28:27 -0400 X-MC-Unique: VO3m0188MSKb8BYgYtfSCQ-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-76248f3057bso16702785a.1 for ; Fri, 23 Jun 2023 10:28:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687541306; x=1690133306; 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=6fU0VQ2K9z1Jj6RIKw9Q80E8iMxB7q7U8hKNsz0tnJQ=; b=Tg/f/f1qox5rFhmMiVRZxOtLMtCAboadM2/xqZRxUguX0jOmfaVSAcuQXi+zV7GWh/ fULyMj7F2v+DiJryhVPP0US7yWRxhGdV38JRY4Z4Au5IlnZL5cmuogN9otGceU0w22br C2Qn8ik76z2haECw/wqZjwCZF3TcCoJ3Ti9Ar+rHxH0mU5TorOr40kjeoWOZCkb3MEew hcvDsJ+xMUTzOCPYD2U5SzMWWgOC5fR/91bHXqBdS8Ftt72Xmgq6i1h13t5g8wRC7Irg NYBFaL28lovcTk8MVLS+3waOB2kTtycdhOFuiMcnQ7JYkM/adKY1T5qCpgWFsRFNsK54 1NHg== X-Gm-Message-State: AC+VfDz7lWdeFdI0YBWXr+Xg2hZtAP4Al4RL0+4qKIhtPRGWb66c7zjq 1pZXFP+j8t7g1rvppYGmU/faUF8ahjdF2Ihlol+zuS2d0W7ON4jAvOYH7BnaOITs2NtEtYL/+1E whjfCAYHVFuk= X-Received: by 2002:a05:620a:2889:b0:75b:23a1:82a4 with SMTP id j9-20020a05620a288900b0075b23a182a4mr26765903qkp.5.1687541306770; Fri, 23 Jun 2023 10:28:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7VViwaF12FfX/6pdG6AhUpCLUwFn4YR+G53Vb5p5iJruwoc/aa4i7ism3ViDHYJzAgSv9udQ== X-Received: by 2002:a05:620a:2889:b0:75b:23a1:82a4 with SMTP id j9-20020a05620a288900b0075b23a182a4mr26765869qkp.5.1687541306451; Fri, 23 Jun 2023 10:28:26 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id a30-20020a0ca99e000000b0062b35b691cdsm5293141qvb.93.2023.06.23.10.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 10:28:25 -0700 (PDT) Date: Fri, 23 Jun 2023 13:28:24 -0400 From: Peter Xu To: Jason Gunthorpe Cc: "Kasireddy, Vivek" , David Hildenbrand , "dri-devel@lists.freedesktop.org" , "linux-mm@kvack.org" , Mike Kravetz , Gerd Hoffmann , "Kim, Dongwon" , Andrew Morton , James Houghton , Jerome Marchand , "Chang, Junxiao" , "Kirill A . Shutemov" , "Hocko, Michal" , Muchun Song , John Hubbard Subject: Re: [PATCH v1 0/2] udmabuf: Add back support for mapping hugetlb pages Message-ID: References: <20230622072710.3707315-1-vivek.kasireddy@intel.com> <6e429fbc-e0e6-53c0-c545-2e2cbbe757de@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1DE4D4000E X-Stat-Signature: qwyzyqb8jhqthstf4erjn4xzcqyqwsrt X-HE-Tag: 1687541308-33401 X-HE-Meta: U2FsdGVkX1/gkNuQuWcvd90s8wqwi0x2KJ04BjJJ7LoWQZ6jExm6OMbHtCKB57ysLjuftro7yqGFTPdqGsg3a4TbuXm2gJzbY1X+f+XQN1m9Iu0oBGzK2ufm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ylB/gA48pn5+31n2+ezMvtLronETkqw3bQtEbvnuqL8Ibt+OMnHZsEp1tKTTrxFX4B+3oLU/BLl4nHqFfb5J1uG2L0AqiH3O2w+euCz9LeKOjGYgYzQJZwktpZasTQqSSAsDUFXzELJH4bfPn+b2DzEbjzwO18EoTwAvIQUmKw1xkijaSDYJ4/k8J+bViuD0F74j2IwQf/yP09FIrIWw97FPGGmtbn1Vt6Zsj/neZgdCLCMCVM8yPWuf9nuT0r6piWCChbPww1Qe9wLm0fFg== 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 Fri, Jun 23, 2023 at 01:37:58PM -0300, Jason Gunthorpe wrote: > On Fri, Jun 23, 2023 at 12:35:45PM -0400, Peter Xu wrote: > > > It seems the previous concern on using gup was majorly fork(), if this is it: > > > > https://patchwork.freedesktop.org/patch/210992/?series=39879&rev=2#comment_414213 > > Fork and GUP have been fixed since that comment anyhow there is no > longer a problem using GUP and fork together. Ah, I read it previously as a requirement that the child will also be able the see the same / coherent page when manipulating the dmabuf later after fork(), e.g., the udmabuf can be created before fork(). > > > Could it also be guarded by just making sure the pages are MAP_SHARED when > > creating the udmabuf, if fork() is a requirement of the feature? > > Also a resaonable thing to do > > > For instance, what if the userapp just punchs a hole in the shmem/hugetlbfs > > file after creating the udmabuf (I see that F_SEAL_SHRINK is required, but > > at least not F_SEAL_WRITE with current impl), and fault a new page into the > > page cache? > > It becomes incoherent just like all other GUP users if userspace > explicitly manipulates the VMAs. It is no different to what happens > with VFIO, qemu should treat this memory the same as it does for VFIO > memory. Agreed. -- Peter Xu