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 D31DEC7EE2C for ; Mon, 15 May 2023 18:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=Vtpr7Wx+RMUluQl62Ccgf5SocH4y8O8EOsmC1wjObuo=; b=OaaVZPKJsGSIbz wBPSfLGx6rg35PAz76q0LLMTdBH9SYPsaPsmAsSY1Vi8GJSrkfbEj8SYfB3fCCfRkoZ/aPwg6yDTp nj12RBpt3Ew4vwyFXB/nMGMLghw21teDipUanZIR5GYywsDsuCu9YNDV8Kve605xliYuY/JqzbU2+ tZ45h04iU/D7YsMl04bsc4mPaop+AnnDj+9Cp6nG6qCI646kGO/JiTHH7PMHwdfgJjGadKSOre6/N 7/veu+p7wPoXYgP1TRmPfJ1DurNb2tWlBlw4gJ4smEBlXjkRhk8P0v0z066IFwgZ6Ys/iRTULTgCm aT20rShDbHQjepazDPjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pycUc-0034BO-39; Mon, 15 May 2023 18:00:18 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pybXf-002qlM-0R for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 16:59:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=03WQ4gY7HWGVDUGAFyYi7JYNGXgrgmD82zWJxbTzK/4=; b=uFNqaFGmLrHIV5KG6xCmVClf9x ormm42ra24CWiwlGJQneG4o05C+zB9NY0SxvkvRIwV1Mafvkt/Xwg9DII4cnghceiQMY3KMz6LCF3 KP6DNkZczJZ1tmexGASPIq3IRff4yapkRZww7350sdc74FpA5wZVwXgXYVrjlvOOqBYk67ZJ1QcLa P+ulzmlaGrDvfEy733rUOxUK7iYLe42BFL43GVo93O2Z9LfarS67gmLKpQ0gFLSKoot31rOXQIryF XcTGf9tvtxHTwqyp9n2pz+8BQXD49wtE4wP3TiUjQumzPjh3EdDnC+mHzfbEunEZq+LZX48/GXNtN 5pUfbclg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33036) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pybXW-00048O-Cd; Mon, 15 May 2023 17:59:14 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pybXT-0008M6-BO; Mon, 15 May 2023 17:59:11 +0100 Date: Mon, 15 May 2023 17:59:11 +0100 From: "Russell King (Oracle)" To: Thomas Gleixner Cc: Andrew Morton , linux-mm@kvack.org, Christoph Hellwig , Uladzislau Rezki , Lorenzo Stoakes , Peter Zijlstra , Baoquan He , John Ogness , linux-arm-kernel@lists.infradead.org, Mark Rutland , Marc Zyngier Subject: Re: Excessive TLB flush ranges Message-ID: References: <87a5y5a6kj.ffs@tglx> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87a5y5a6kj.ffs@tglx> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_095923_172454_28FF7CE7 X-CRM114-Status: GOOD ( 12.78 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 15, 2023 at 06:43:40PM +0200, Thomas Gleixner wrote: > Folks! > > We're observing massive latencies and slowdowns on ARM32 machines due to > excessive TLB flush ranges. > > Those can be observed when tearing down a process, which has a seccomp > BPF filter installed. ARM32 uses the vmalloc area for module space. > > bpf_prog_free_deferred() > vfree() > _vm_unmap_aliases() > collect_per_cpu_vmap_blocks: start:0x95c8d000 end:0x95c8e000 size:0x1000 > __purge_vmap_area_lazy(start:0x95c8d000, end:0x95c8e000) > > va_start:0xf08a1000 va_end:0xf08a5000 size:0x00004000 gap:0x5ac13000 (371731 pages) > va_start:0xf08a5000 va_end:0xf08a9000 size:0x00004000 gap:0x00000000 ( 0 pages) > va_start:0xf08a9000 va_end:0xf08ad000 size:0x00004000 gap:0x00000000 ( 0 pages) > va_start:0xf08ad000 va_end:0xf08b1000 size:0x00004000 gap:0x00000000 ( 0 pages) > va_start:0xf08b3000 va_end:0xf08b7000 size:0x00004000 gap:0x00002000 ( 2 pages) > va_start:0xf08b7000 va_end:0xf08bb000 size:0x00004000 gap:0x00000000 ( 0 pages) > va_start:0xf08bb000 va_end:0xf08bf000 size:0x00004000 gap:0x00000000 ( 0 pages) > va_start:0xf0a15000 va_end:0xf0a17000 size:0x00002000 gap:0x00156000 ( 342 pages) > > flush_tlb_kernel_range(start:0x95c8d000, end:0xf0a17000) > > Does 372106 flush operations where only 31 are useful So, you asked the architecture to flush a large range, and are then surprised if it takes a long time. There is no way to know how many of those are useful. Now, while using the sledge hammer of flushing all TLB entries may sound like a good answer, if we're only evicting 31 entries, the other entries are probably useful to have, no? I think that you'd only run into this if you had a huge BPF program and you tore it down, no? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel