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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E994AC52D7C for ; Mon, 12 Aug 2024 18:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CS/foRtcZMYFWa8Ji2iV8cMwHHCfkc9T1S0QgRlZmIU=; b=V4iX5NKH7sQRue0uU9ao6kbF3Q wg0NaKi/SkzRStMAtBOoQBXVQEqqhRL2vjFQrjokNBy8QTLIfi0XOwM0d5aRTaJn8cDpxhQRCPm/C A9JOb5tVxZLLDgKbN4ct53XzuCWGapaBvezSmZMQRw3bwBGpkWKAd/jQephUJLFRyRsjNu0pmjUYw TUxgNPRAhJ1iA3Y9pFn5L8ejoUUmocVRqo0urx+yjVX154vZyliwranawW8pCUtOabMetw1v9udln SykWiXVSDKhJuk4jgA5ibW/gt+pRYjrQ9m2mmKhVBQnSindqWtEcnA3w7uirQe0YhjUNJmWsp6udI uEG406NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdaFw-00000001GRr-2Wrt; Mon, 12 Aug 2024 18:59:00 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdaFC-00000001GJO-0Pkt for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 18:58:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723489092; 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=CS/foRtcZMYFWa8Ji2iV8cMwHHCfkc9T1S0QgRlZmIU=; b=SA/QspGrAn+5OeRX3LupCnXgZF37EB/xbzo+WF0BhiWbvxbpbBkW/DLTqcxPBYrkGSUS/O cGMUBeG3Esg1LMWRzwcaQitvdWTO8sFV21PZQUKz3uFwHa0AsfSffdvwuHS46W/Xg5KrOW T3MaUD2S5KPqZ1ec7a7+fek0gY01Jyw= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-90-68baWQCKNWG-TMSDTJDghA-1; Mon, 12 Aug 2024 14:58:11 -0400 X-MC-Unique: 68baWQCKNWG-TMSDTJDghA-1 Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-4f51f3b2e7fso226527e0c.2 for ; Mon, 12 Aug 2024 11:58:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723489091; x=1724093891; h=in-reply-to:content-transfer-encoding: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=CS/foRtcZMYFWa8Ji2iV8cMwHHCfkc9T1S0QgRlZmIU=; b=JGqouSHQlPRv6qEUu/ojGMErDe1LjTFV6i4CkfI8SO5caiw+BgZDoDYARBUxs69Y8X 2Tv7x9WRwQXY/3hH01eFgq2nP+iyas6ztDU9aoitAHfblWrUmwFb5E91mkqfglRCl8F2 4hnRdnom5aKHsQC0Six6k8UmvQmXuIa33t3sT42E1YHzVqOcLJstMEb1wSl9fdRHyRp2 DpC8iIzinVyF1DA6+87itcforyec5j1KRmx8SoSK2BVtMFwSaJOy4CiEX9Eboo5E0a2N dFTmvCd9PVRgso5HOAZJYE9WrhGjOeXivP5uXDk1n9NLkd9CR4uMScrAwCaSP56XLLV2 i0gQ== X-Forwarded-Encrypted: i=1; AJvYcCUdvM89W+pRqjGw/W8tNakUiQv9Rf/rQFpLRUraCiyE576k9iy77h8G9hb1JTJxGoAX+FAgTHV7IkF+xoxCEiBy@lists.infradead.org X-Gm-Message-State: AOJu0Ywar1F4ikHEhXSGyanNbvR2jlaf6G32G7nBkRlp01IzWqk1/GRN cdAEF2aOAJXsOy6KyuV2V6Yrqo+jKpJWKMp/10e1zNMTg8i6C9ViFP6aiohwANIGEo2Ce6T62v4 DEQwa0gUB5NMIparYhxCcfWg5OQLRnvuYRCpXG6mZRZm+3tlHm1jpn7Nnx14ElRlYMuT4mzpZ X-Received: by 2002:a05:6102:509f:b0:48d:aced:abff with SMTP id ada2fe7eead31-49743942d92mr923674137.1.1723489090928; Mon, 12 Aug 2024 11:58:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEepDCRiassfXhH0DrId4yrgbBwPcT6rwZlyon1JDzVmoNGkXNaVZAYMSjbHfXIwNLjo/ZC3Q== X-Received: by 2002:a05:6102:509f:b0:48d:aced:abff with SMTP id ada2fe7eead31-49743942d92mr923659137.1.1723489090577; Mon, 12 Aug 2024 11:58:10 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-841367f32besm801295241.40.2024.08.12.11.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Aug 2024 11:58:10 -0700 (PDT) Date: Mon, 12 Aug 2024 14:58:07 -0400 From: Peter Xu To: Axel Rasmussen Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sean Christopherson , Oscar Salvador , Jason Gunthorpe , linux-arm-kernel@lists.infradead.org, x86@kernel.org, Will Deacon , Gavin Shan , Paolo Bonzini , Zi Yan , Andrew Morton , Catalin Marinas , Ingo Molnar , Alistair Popple , Borislav Petkov , David Hildenbrand , Thomas Gleixner , kvm@vger.kernel.org, Dave Hansen , Alex Williamson , Yan Zhao Subject: Re: [PATCH 10/19] KVM: Use follow_pfnmap API Message-ID: References: <20240809160909.1023470-1-peterx@redhat.com> <20240809160909.1023470-11-peterx@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 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240812_115814_230726_3E0FE6D6 X-CRM114-Status: GOOD ( 18.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 09, 2024 at 10:23:20AM -0700, Axel Rasmussen wrote: > On Fri, Aug 9, 2024 at 9:09 AM Peter Xu wrote: > > > > Use the new pfnmap API to allow huge MMIO mappings for VMs. The rest work > > is done perfectly on the other side (host_pfn_mapping_level()). > > I don't think it has to be done in this series, but a future > optimization to consider is having follow_pfnmap just tell the caller > about the mapping level directly. It already found this information as > part of its walk. I think there's a possibility to simplify KVM / > avoid it having to do its own walk again later. AFAIU pfnmap isn't special in this case, as we do the "walk pgtable twice" idea also to a generic page here, so probably not directly relevant to this patch alone. But I agree with you, sounds like something we can consider trying. I would be curious on whether the perf difference would be measurable in this specific case, though. I mean, this first walk will heat up all the things, so I'd expect the 2nd walk (which is lockless) later be pretty fast normally. Thanks, -- Peter Xu