Message ID | 20230203192822.106773-1-vipinsh@google.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1020364wrn; Fri, 3 Feb 2023 11:29:08 -0800 (PST) X-Google-Smtp-Source: AK7set8bGvOr0AlWkEzpOZtiGnO7e6RoUR0CNcvApp+yui+/TDSdhT2si8pyyIu4gx46VQ4JDfYX X-Received: by 2002:a17:906:4713:b0:885:6a2e:f941 with SMTP id y19-20020a170906471300b008856a2ef941mr11146887ejq.54.1675452548763; Fri, 03 Feb 2023 11:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675452548; cv=none; d=google.com; s=arc-20160816; b=KCWjJCWCtA6zfgeAnLoWKgH3z6USSPI2WxikDNwx0LcxfT/E8Blr5OqLv5QXQT27qX /eR1c8p0O3hTJ9q3yJVmKQtBDpcmfsKCZ82BlJsxWqVu2nY8mOktf5aZYdUv90xI+3XN PEUh5dCk1eDDpGn95k775EY9akp5rGcxTUc4l70d0vWzrJFqn+1sQ3Gv8eAyafXQkAq1 LXFjnhzQK1QO+qUj4CogtlQe4o4ZJ33iWMlNc93n4CzOOKCvf45Se3Kq2ugDJZLMxZY4 wTiZIJg/DTkRawJtnoEf99e1hJrydD9Q0USOqvjNAnE/K18b4g8KV0frXyWc5mWl/w0d Gwqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=HYLbgv7PVml2TewJA39IQMx5unqixaCZm+fzISzoQck=; b=pGFObQMOa4lR2fX5t2IA7s5OnldLCnT9apSQM2/EHNdWBx0gYeSlv0iW0N3ECWfAU5 zLZRvKphiPOtKDPp271+LamKpgZsjIcVtDqxXAs78lYko+cfUg4p93ZI55gWiMHn8ZjB kzx3OI+JY1qInzP5kR8VxcWZIm6M/HBtzQ/uQtNyiB0EFlZGXCVXCBzSH1RZWuAHU5r5 u5Z4ynhcU+I+dwrwrcuiII4qaCSJKH2RIhTUSl6VYb1sf4ifR+PiB1UkwWzq0c3jA3q8 VjucZ0enpbKcaVJKc1CbH9C/bzB1RBzqRsQ3JodYUIFiLdNrguAMFE2GI4VyPrPaYc2T FRXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MgHXL1T0; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id uj32-20020a170907c9a000b008897b74cf83si3384296ejc.290.2023.02.03.11.28.44; Fri, 03 Feb 2023 11:29:08 -0800 (PST) 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=MgHXL1T0; 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 S233020AbjBCT22 (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Fri, 3 Feb 2023 14:28:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232165AbjBCT21 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Feb 2023 14:28:27 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22733A0015 for <linux-kernel@vger.kernel.org>; Fri, 3 Feb 2023 11:28:26 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id p202-20020a25d8d3000000b00858a2a2cc15so5750040ybg.21 for <linux-kernel@vger.kernel.org>; Fri, 03 Feb 2023 11:28:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=HYLbgv7PVml2TewJA39IQMx5unqixaCZm+fzISzoQck=; b=MgHXL1T0AXZF0y1gq0TZV5NccJ6+f+xPNHRDSplMsbk2zAu+iuQSSjXQim55qlV6h3 J5BW9kwO39dl0DDltWIVGmC79n7ioUTCHgdkosNuKFGf3wVF5A5pnhPx5OdJHrrrX3Cz xQeKJSrNWA5vgguVlHbPoul8GTEXnmhUk7re+cseIeXl7gez+iS2VhCfK/Ok0wPNiXdK nHmljn7nW0Sqsxk7EVjaL98w20RQf1849MlevOLP8abKDVh87rbMt/Eecdiz5FuLAEXF nnY0dwqCP63oZU4lwAqAEFEGABZiksibqZbclqOW/p9rlvLzf8M9x3uFV5vitlozfRML Jzvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HYLbgv7PVml2TewJA39IQMx5unqixaCZm+fzISzoQck=; b=fsZFjUIYuy2XBCKPdXkHYKipk3fFC1T/s5x+fM/kHGO0dvmlaeNxTbmjUCBW4zPBUu atLqlbUZeHs9qRAdZcb4wCdNAfSwnGTjtBOirDtMEHMC+JLSGh18XxX9HjakDW73PITw EsLTSL9q7jN6x6WGcnrpwSliMpbjXatv7NlJ9P9FbvU8X5y2n4IHAfmlTZy88RVlIoIk AWaVrd83B7B5b7e2ZIf3qGeK4ZaWLyC55g6y7tvKpfDkplEs2Hiyy0lXhqYVlETheY2d 5ZUb9i+Qaf0zcDS2D/hZaU/T2WHL1it14DNeFhV6Mxbm+YxxRnHCjQ/8zGB9B24htILk CBFg== X-Gm-Message-State: AO0yUKXhpkqroBeekS05rOSQ8BwHwvmjc85BIl4RrLt6vXXOvMnCL3kc 3NQx4dso984XUw+lElO0Z+oSc0ijRAjN X-Received: from vipin.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:479f]) (user=vipinsh job=sendgmr) by 2002:a81:449:0:b0:524:3a4d:14b1 with SMTP id 70-20020a810449000000b005243a4d14b1mr532193ywe.174.1675452505354; Fri, 03 Feb 2023 11:28:25 -0800 (PST) Date: Fri, 3 Feb 2023 11:28:17 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog Message-ID: <20230203192822.106773-1-vipinsh@google.com> Subject: [Patch v2 0/5] Optimize clear dirty log From: Vipin Sharma <vipinsh@google.com> To: seanjc@google.com, pbonzini@redhat.com, bgardon@google.com, dmatlack@google.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vipin Sharma <vipinsh@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756839331731335921?= X-GMAIL-MSGID: =?utf-8?q?1756839331731335921?= |
Series |
Optimize clear dirty log
|
|
Message
Vipin Sharma
Feb. 3, 2023, 7:28 p.m. UTC
Hi, This patch series has optimized control flow of clearing dirty log and improved its performance by ~38%. Patch 2 has more details about optimization. It also got rid of many variants of the handle_changed_spte family of functions and converged logic to one handle_changed_spte() function. It also remove tdp_mmu_set_spte_no_[acc_track|dirty_log] and various booleans for controlling them. Thanks Vipin v2: - Clear dirty log and age gfn range does not go through handle_changed_spte, they handle their SPTE changes locally to improve their speed. - Clear only specific bits atomically when updating SPTEs in clearing dirty log and aging gfn range functions. - Removed tdp_mmu_set_spte_no_[acc_track|dirty_log] APIs. - Converged all handle_changed_spte related functions to one place. v1: https://lore.kernel.org/lkml/20230125213857.824959-1-vipinsh@google.com/ Vipin Sharma (5): KVM: x86/mmu: Make separate function to check for SPTEs atomic write conditions KVM: x86/mmu: Optimize SPTE change flow for clear-dirty-log KVM: x86/mmu: Optimize SPTE change for aging gfn range KVM: x86/mmu: Remove handle_changed_spte_dirty_log() KVM: x86/mmu: Merge all handle_changed_pte* functions. arch/x86/kvm/mmu/tdp_iter.h | 29 +++++-- arch/x86/kvm/mmu/tdp_mmu.c | 163 +++++++++++------------------------- 2 files changed, 72 insertions(+), 120 deletions(-)