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 5EA8DC43334 for ; Thu, 30 Jun 2022 16:09:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE1BC8E0002; Thu, 30 Jun 2022 12:09:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C91BC8E0001; Thu, 30 Jun 2022 12:09:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5AE68E0002; Thu, 30 Jun 2022 12:09:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A86BE8E0001 for ; Thu, 30 Jun 2022 12:09:12 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 72A8960F40 for ; Thu, 30 Jun 2022 16:09:12 +0000 (UTC) X-FDA: 79635386544.09.15FDCD6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf07.hostedemail.com (Postfix) with ESMTP id C310C40043 for ; Thu, 30 Jun 2022 16:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656605351; 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=P6L8uC01GwQiAV6RdRK9BzdNht1S61slyDLTSeTcpAU=; b=YeqWCHuvvnNQ9pXb1DZzm9UEBx2jF0CdtqzMuqowZOe+8EaVbXAEFxpLUMirvxCEbq9gcs 51bZRKXTdzfhkWYV+h+TCUTC/kr2F2jkGFn3Vn7wRzxx6fGR8Bu9K5yl80YJF143hh2PEy zxFMo2mFWYmKb4UO3iXfd2boEUcJk0I= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-193-ouowDgW3NJSZx6-x5QHUvQ-1; Thu, 30 Jun 2022 12:09:10 -0400 X-MC-Unique: ouowDgW3NJSZx6-x5QHUvQ-1 Received: by mail-io1-f71.google.com with SMTP id y22-20020a056602215600b00673b11a9cd5so10285026ioy.7 for ; Thu, 30 Jun 2022 09:09:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=P6L8uC01GwQiAV6RdRK9BzdNht1S61slyDLTSeTcpAU=; b=NDZSeoguwPToK9np8BwiM1M+KIW8bTkgoKcVHvbB3YEYrXe0Btt5DwuHlfhPvMyAgT 2FSojAm+h+YZxnbc/HitG7Lvw2Fymh5QDU6LFDAu9xK4yj0gL2ixPho2EdMhXm9vJ6xp hU79ZOiwg8Kyh/YnBEogeHD4kAr1uH8SBnud5db+xryEYF7uw7YwQ1ib5wAjpjUnCVBO dwbY6PuTpffCJSWPWjm3TfPGR2QI5hBuq6fplDMhZKAOolv4D44+gZNSoo7TUEjjy27R H3I5XsR47dhGSa6sLbNU/QJzBdjuw/NpyhizF+QzwD7vBVO6SbVwLBgxvxO9orS4kylQ d+wg== X-Gm-Message-State: AJIora8zryen6ONdqSonI2YM7jP9St5vgX+Z4oKzVP2wwFugVLDBmoYk uA3oluUnh+LcOoBiAwdOBMZjR3ZPdYV/H1xxvhyLX6yFAuazg+J8ECqnIhPuGB8p5VPJJaN9lwn foRsgD71tJts= X-Received: by 2002:a05:6e02:2168:b0:2da:a170:5b6 with SMTP id s8-20020a056e02216800b002daa17005b6mr5438809ilv.321.1656605349253; Thu, 30 Jun 2022 09:09:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vYs4hpmFf8NNNcZENp1x0RUK/4W/wnRloQB873SdxXYOvH1nEO/bmbYREOBpnUXfKVyFsahg== X-Received: by 2002:a05:6e02:2168:b0:2da:a170:5b6 with SMTP id s8-20020a056e02216800b002daa17005b6mr5438789ilv.321.1656605348961; Thu, 30 Jun 2022 09:09:08 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id e39-20020a022127000000b0032e49fcc241sm8698697jaa.176.2022.06.30.09.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 09:09:06 -0700 (PDT) Date: Thu, 30 Jun 2022 12:09:04 -0400 From: Peter Xu To: "Dr. David Alan Gilbert" Cc: James Houghton , Matthew Wilcox , Mike Kravetz , Muchun Song , David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Jue Wang , Manish Mishra , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Nadav Amit Subject: Re: [RFC PATCH 00/26] hugetlb: Introduce HugeTLB high-granularity mapping Message-ID: References: <20220624173656.2033256-1-jthoughton@google.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 ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YeqWCHuv; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf07.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656605351; a=rsa-sha256; cv=none; b=0fXyu2JzfJVv379inwTH0/Ac9L9uJOvMn5Hg9GxZw904rl1LCu6ox05SyEUKqlrS6x/9tj BiLY5uC4T4fBwmim/xEczWOqa/7Sp0v1grQ1F4exEB+o8l20XS7yhJuqzPqpgbSskyrtpJ WEt/WP/L7djZGYOWQWrte2N+KbExkwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656605351; 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=P6L8uC01GwQiAV6RdRK9BzdNht1S61slyDLTSeTcpAU=; b=mGe6MO39cjUwN2lMDV6FI4pGCPpd3Ynm8cHmvSwlj7fYGkwGVSmhGZP8j0Q5CjOYheALbC xPsKk1RVsaJas2DhKY2lBzoXuuIFoyndYu87KRqU9TLrTthttgbdKm7QN3oFME7g4uEcWp tD1EQkswPbknBXgrWNLbkbzB19Qf9NU= X-Stat-Signature: q8couitsa4m4b5rkqd67qjey4gi84rkj X-Rspamd-Queue-Id: C310C40043 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YeqWCHuv; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf07.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1656605351-767265 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 Tue, Jun 28, 2022 at 09:20:41AM +0100, Dr. David Alan Gilbert wrote: > One other thing I thought of; you provide the modified 'CONTINUE' > behaviour, which works for postcopy as long as you use two mappings in > userspace; one protected by userfault, and one which you do the writes > to, and then issue the CONTINUE into the protected mapping; that's fine, > but it's not currently how we have our postcopy code wired up in qemu, > we have one mapping and use UFFDIO_COPY to place the page. > Requiring the two mappings is fine, but it's probably worth pointing out > the need for it somewhere. It'll be about CONTINUE, maybe not directly related to sub-page mapping, but indeed that's something we may need to do. It's also in my poc [1] previously (I never got time to get back to it yet though..). It's just that two mappings are not required. E.g., one could use a fd on the file and lseek()/write() to the file to update content rather than using another mapping. It might be just slower. Or, IMHO an app can legally just delay faulting of some mapping using minor mode and maybe the app doesn't even need to modify the page content before CONTINUE for some reason, then it's even not needed to have either the other mapping or the fd. Fundamentally, MINOR mode and CONTINUE provides another way to trap page fault when page cache existed. It doesn't really define whether or how the data will be modified. It's just that for QEMU unfortunately we may need to have that two mappings just for this use case indeed.. [1] https://github.com/xzpeter/qemu/commit/41538a9a8ff5c981af879afe48e4ecca9a1aabc8 Thanks, -- Peter Xu