Message ID | 20230801085402.1168351-3-alexghiti@rivosinc.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 8CE30EB64DD for <linux-mm@archiver.kernel.org>; Tue, 1 Aug 2023 08:56:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 293D58E000B; Tue, 1 Aug 2023 04:56:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21D4E8E0002; Tue, 1 Aug 2023 04:56:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10C268E000B; Tue, 1 Aug 2023 04:56:12 -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 F29D98E0002 for <linux-mm@kvack.org>; Tue, 1 Aug 2023 04:56:11 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BBF201A0482 for <linux-mm@kvack.org>; Tue, 1 Aug 2023 08:56:11 +0000 (UTC) X-FDA: 81074928942.09.9D6A982 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by imf14.hostedemail.com (Postfix) with ESMTP id DE347100007 for <linux-mm@kvack.org>; Tue, 1 Aug 2023 08:56:09 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=P1QobXoc; dmarc=none; spf=pass (imf14.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690880170; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YdYxZtsdohXkJiEqvE1Q59ExwQkgmM2r74atDceIuW4=; b=V5PxRyw5fFROnjxs/JiDxL5hvjKUKsu02pNE2S12ZWddAQ9CulxF92ESf/ecpG1/jCIzWs G/kjq6vE0V57E0JTsApgo22KssmU9weApn6yy91+0QeUN0tk9XgdXk3ptXMyHgFBtcHLdi LZp9MLFyIvAyClbWjjZ+PRNo/n8VUIs= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=P1QobXoc; dmarc=none; spf=pass (imf14.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690880170; a=rsa-sha256; cv=none; b=U2UWcAVEyIsjw1kWLnlVRA6GByxnxqpyk0+TOqgV+1HlNLAanybAnvqc5oKmQjVZXBIvGN SiyEiPRnFcT6H3ldXDmcSO91UUgC3CfZ2UXoB5JAC+jq1LJWV0mjf57zHqu0aOsT53n3Kx hURR30F5yr7L8cPpGkuJAHSmF3KD+/g= Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3fbd33a57b6so59866585e9.2 for <linux-mm@kvack.org>; Tue, 01 Aug 2023 01:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1690880168; x=1691484968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YdYxZtsdohXkJiEqvE1Q59ExwQkgmM2r74atDceIuW4=; b=P1QobXoccsE3+9czY0EpajvoT8IDASIi5MHnVOCPkE2PMZjb4NqJkp3pvl6huP8YRq inBiQsncpHkOkganYv8SrZAOd3CtSTRw0CEuM5zl62vwXj74EYJEKz1rWmjPNAGUwXcZ 0T//g3rQxb50UzHNokVzEi/3Xp6BVR9XQED7mluE4W1zuOqwh31OFZ6aHgZa9eXfLMxk Ybdk6zmtonm5+VeE6xBp3pLoAkOzJzfiBcOkz9WrXEMNt9py7w/QriiUEhWdVim5+GYl oNYLzRRYgjWZYYev+98Hpz+c7VOxxXWdwErfKirkGLaiOfoY7c7Toqiek1j1aM9FuYjR xmww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690880168; x=1691484968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YdYxZtsdohXkJiEqvE1Q59ExwQkgmM2r74atDceIuW4=; b=SzP6N4MCVTf3DZii27spM5lMH+CJYKP4gzHnjahWDUJIHmdIEw73UK073RQmOv0hZ0 u5VbSXDEgbWhayMahbMos8W5SyXQX/ZxNlgPqM03kLPrlX2jDuaBlMyUQWm7B8oJ/qyg 5GYTQtwcPSiGZEni/6PZBsQE/uyNBmmT7O/lZaiUw9zBfUyyaRiZcdyIis2a6UKQLmgm v5CdyOba8YdppgaJDcuMwT3z1nHXjJHvuBHT4jvgnlKHMdsLeDI0PQS3y/Wfx3Va2qi8 hkvZDrmEEvK6j88f7vmiCy/GMUeJmL0N7DQtTBWF0721X41pyQ0J5DhujlIG7L0q+w6L LvKg== X-Gm-Message-State: ABy/qLZfySSN42TPiSl59RpIcI6g69Iy9CgyOMhYL4NdeZVvUwr88FuN pT9qz+GWY5YYOrjjQLbCyg2Jpg== X-Google-Smtp-Source: APBJJlG/YdSyO9mZdobMpVoP2KrhKuvsBSBkyDxEF7tvWdeyE2ucJPc2rpUQPp8XKp43TrymC0aSMA== X-Received: by 2002:a7b:c4c5:0:b0:3fe:f99:1ba with SMTP id g5-20020a7bc4c5000000b003fe0f9901bamr1969783wmk.2.1690880168420; Tue, 01 Aug 2023 01:56:08 -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 l12-20020a7bc44c000000b003fe215e4492sm4763826wmi.4.2023.08.01.01.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 01:56:08 -0700 (PDT) From: Alexandre Ghiti <alexghiti@rivosinc.com> To: Will Deacon <will@kernel.org>, "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>, Andrew Morton <akpm@linux-foundation.org>, Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>, Mayuresh Chitale <mchitale@ventanamicro.com>, Vincent Chen <vincent.chen@sifive.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexandre Ghiti <alexghiti@rivosinc.com>, Andrew Jones <ajones@ventanamicro.com> Subject: [PATCH v3 2/4] riscv: Improve flush_tlb_range() for hugetlb pages Date: Tue, 1 Aug 2023 10:54:00 +0200 Message-Id: <20230801085402.1168351-3-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230801085402.1168351-1-alexghiti@rivosinc.com> References: <20230801085402.1168351-1-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE347100007 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: whyr45hzsxst1bgtux55rqjnfkejhoju X-HE-Tag: 1690880169-965622 X-HE-Meta: U2FsdGVkX1/87ot5gLpwjMOuRe0FIah+PYErkjQuTB/p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S5qGWyJUQGFOc8uMujaf+yvp9x1qh3z1/+ewLET3WuEiQx7vZTi5h76qOkyZpbGcTnKK2esWstv7w9jU88UD0Fc8RUL08/zdRV/GQvR9+nE9bn7Sg5qjJVKgFKodS81dLW5FtMuudu+ksf++DzLtqFBc6BWXvP5VoAB9jfB9vn95Ci0k4u8IfrSvx2xJxHFILNWQMOsuhBBk++a8tmC8HTnX2rpe0uRk3o8VrvWbvhDuGf5g0UjLwbk2qtTM5Iz+h5cZZf7ftOXUm9brxX6pbKShKThZqVZJQSND7TbOzUvDsZhLk0jZH97eJcUm26RMY9on3O12lVawGnUytbmwALZnapDQNb+973T6ItBeCm5Io1LxYJV/yMSteWpJe33JAxOj6MqJlY/rvB5K4nvx0HCD01JXnI8HBrQ7XXwxQQwTDo= 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: <linux-mm.kvack.org> |
Series |
riscv: tlb flush improvements
|
expand
|
diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index fa03289853d8..d883df0dee4a 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -3,6 +3,7 @@ #include <linux/mm.h> #include <linux/smp.h> #include <linux/sched.h> +#include <linux/hugetlb.h> #include <asm/sbi.h> #include <asm/mmu_context.h> @@ -147,7 +148,13 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { - __flush_tlb_range(vma->vm_mm, start, end - start, PAGE_SIZE); + unsigned long stride_size; + + stride_size = is_vm_hugetlb_page(vma) ? + huge_page_size(hstate_vma(vma)) : + PAGE_SIZE; + + __flush_tlb_range(vma->vm_mm, start, end - start, stride_size); } #ifdef CONFIG_TRANSPARENT_HUGEPAGE void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,