Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36482203rwd; Tue, 11 Jul 2023 01:20:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFX1WFDUmPvEbo9asK4/LAU0M5rn/MoW6cRZG9fJa9BlrIiqsBSWSDpX6oQT5P5C6Qy3gAW X-Received: by 2002:a17:906:7a5e:b0:993:d7d2:7f1c with SMTP id i30-20020a1709067a5e00b00993d7d27f1cmr10219938ejo.5.1689063635559; Tue, 11 Jul 2023 01:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689063635; cv=none; d=google.com; s=arc-20160816; b=M7uP2CPupEH89mxpUPN54dflVJYHatTSP6kyW9b0+Ns9JaRhHIKXRSq9MjK0Ua1asr n7f3/qafOy/1YvkF2NoaWWVWh3xWWDGhCzZDjPCFkg82G/e8ELmmawk3ma98MNlrR0II IWDLgjmts0GfN8oDthDsV6uzcni0NCm1YR064eq4IQqZ+RfBK9RpWgOEOZAGsdfgMJIS lyw9mE5W7C8iKP/t/25nSKc9rsaiX4xwz8A939n1IOa34kdshX0QqsW+uZC7mJjud73Y tpLoFI8b2DwofVRlXFKCGsUgZQuyALFWA7MVU3lpvnjoUeSlLODfh6OgHggiKxuiTTjl 3Thw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lkPK/GMPSBp/4g2qtcrJmujy1568nlXOGlV287FaDRc=; fh=9KG1GxoJIHO8DA9/W8zOCR/cizSACkxrp9LVRbza3AA=; b=V+EDyf/1xNX48Fbbb3u2CreVc7yDh9QTqaw9P7ChgPbbZcCgzQZ0JBX/VJ34MzJXAn KXNscGWGSzbbVBHYBzGfXec0nbemOMP0mSL5jDUgLdmSEN9mBtrO4Y/zj32Z6WZd9HJC B+6vpzs0LxUtOP/HEz1cGyaCfONySuRfnpKk09Xnk4oWMouKEpBWww4pW75TAqcaoESs Y4MXPLudyaO/TcEmEYIpkYjfBKgpTYv6Aj8RMxfGGPAq7DKTS+MK5wimaTIxL5cCBhi5 5SKTZHdHU2/h8ZfQ5UpXuxtMucvBWikwwHN0xU8LWhthFp/3RvJvwuz8RnDj0vptgDKd PZQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=K19Nrzp1; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz22-20020a170906f2d600b00992c5cfbfc9si1485107ejb.361.2023.07.11.01.20.11; Tue, 11 Jul 2023 01:20:35 -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=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=K19Nrzp1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231189AbjGKHyl (ORCPT + 99 others); Tue, 11 Jul 2023 03:54:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjGKHyk (ORCPT ); Tue, 11 Jul 2023 03:54:40 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D2A6CF for ; Tue, 11 Jul 2023 00:54:38 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbfa811667so29870125e9.1 for ; Tue, 11 Jul 2023 00:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1689062077; x=1691654077; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lkPK/GMPSBp/4g2qtcrJmujy1568nlXOGlV287FaDRc=; b=K19Nrzp1xAN9FNNb8XRkpzz0wzk3pqohF7q8+RkvdexxFbKKM7d+ucdX6H3xvRoCoo IAvl+ydAs/IUYirGbQwvOuyp4A0dkj0s/nO7Wc0g1z2W/DpIfxDUlqKRDsMZPbh+6SZG UCe4MHkpZvEjCz72zHCdheewAIwOwYPwkVsqdEE4tkrDZGuGTwCnzvidF2fVjDqYCvIA qBjO2GW0gO8pham8mPm4K1v0bW74ZtjwGzEIJCFFnbFQdOXWS+dnNjbtCeWOne6Ej7AW hqxv8/DVt4rvAqBoBN53nUXsUuqopDb/uAEA2da0pu6momATMv5C5drS+dFGgJdqinm7 l2Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689062077; x=1691654077; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lkPK/GMPSBp/4g2qtcrJmujy1568nlXOGlV287FaDRc=; b=in6BJH4uByzvT1/KVQxQ2wHFuUSLae5AEEmJa87XSbImuxO61K3fFw22EHU4roLNF9 URz7lP10LPrYPkx+UIcXv0Y8fLyxFhUevp+9dQ5b/kFZpkVvqEVOmOUKw61TFdQyMxfC 9czBSzW1Gx+ZdltDMk/NLhdBFrBmszfqaEocSVyvzJZd2jHt09ZZhc2Ndl9Nd9bEDTyi bIHS5k/TB19uo2I5R/Co3vDfQo7Tjss0DzZBxYVhom41ajPjvHwPHGMjHXd5eRbj4YU1 cbuVVGhgozoNdw0ukGRVCT0dZGh/Ny+Vqt5BdO19SitdwS4jQDNME2aWVwSwf2lTRi4B jObg== X-Gm-Message-State: ABy/qLYEPh2nEzwnoK+NQoT7RCvSFOHgp4y+RMnD2UiIdF3S4IZdyfqy SpkZ0k9xHrW4cBLQiid+clXpGg== X-Received: by 2002:a5d:6947:0:b0:314:2736:ba3e with SMTP id r7-20020a5d6947000000b003142736ba3emr17296610wrw.3.1689062076885; Tue, 11 Jul 2023 00:54:36 -0700 (PDT) Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id i6-20020a5d55c6000000b003145521f4e5sm1481156wrw.116.2023.07.11.00.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 00:54:36 -0700 (PDT) From: Alexandre Ghiti To: Will Deacon , "Aneesh Kumar K . V" , Andrew Morton , Nick Piggin , Peter Zijlstra , Mayuresh Chitale , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexandre Ghiti Subject: [PATCH 0/4] riscv: tlb flush improvements Date: Tue, 11 Jul 2023 09:54:30 +0200 Message-Id: <20230711075434.10936-1-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org This series optimizes the tlb flushes on riscv which used to simply flush the whole tlb whatever the size of the range to flush or the size of the stride. Patch 3 introduces a threshold that is microarchitecture specific and will very likely be modified by vendors, not sure though which mechanism we'll use to do that (dt? alternatives? vendor initialization code?). Next steps would be to implement: - svinval extension as Mayuresh did here [1] - BATCHED_UNMAP_TLB_FLUSH (I'll wait for arm64 patchset to land) - MMU_GATHER_RCU_TABLE_FREE - MMU_GATHER_MERGE_VMAS Any other idea welcome. [1] https://lore.kernel.org/linux-riscv/20230623123849.1425805-1-mchitale@ventanamicro.com/ Alexandre Ghiti (4): riscv: Improve flush_tlb() riscv: Improve flush_tlb_range() for hugetlb pages riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole tlb riscv: Improve flush_tlb_kernel_range() arch/riscv/include/asm/tlb.h | 6 +- arch/riscv/include/asm/tlbflush.h | 12 ++-- arch/riscv/mm/tlbflush.c | 93 +++++++++++++++++++++++++++---- 3 files changed, 94 insertions(+), 17 deletions(-) -- 2.39.2