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 2F103C77B7A for ; Tue, 16 May 2023 12:09:58 +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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bkQBXVO+8XnxMxTGYc0PO1aaPcQsOq2wCDecZ5NV7hU=; b=XLqSH2yEJEdPym MTyj1fNzelltlUXQuwuxTLs+CXJNWYtjNb+B+C0ru3aGLHh4zVOYex2LpOFMeswgIp4N9bCXziSVL 5Fxq7+H8ZcuVPaCWyxKtN1HGYYdu65yOzRnkxi1/0Wi1SmgPx5C9LKgScsEFifzb6WdueCvvz+YNi Yiyw1ErWdH5mGPgjWGrgn3GFM2IQoh8r3vdfxezoETCFlg8PXuAN92kQ/uM3HnRMjsYXhAVoiInry 63OJvcwtvBp/E6X88HAs59hSJG20bDPY+8f0B96eDS+Jg5GYNWLLaY8VWlnQy0B8QQix8y5osMZ7N DZ66KQ9TEidzR394XGjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pytUp-005grF-1Y; Tue, 16 May 2023 12:09:39 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pytUm-005gpc-1J for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 12:09:37 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684238972; 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: in-reply-to:in-reply-to:references:references; bh=0CQ+jS14zLcnozgvOt5eiAa5pnAfQVabet0JoqqqapU=; b=F+R2Q6l3OudIxAF2jpENc2N+1M/KC8Ts6Rt8UXgtKA/3XngNdjIfvLbntEgX9q7cB3tCwT WOUxSp5Ez4+d+Hk6mZBU92bor8JY4eKrbYFtbOlS6ndBuUL3CYrZek18mQxv0j1Bj98Rbj fvJKjXYnuUSFbGahhxQWc5l24KTpWLt2b++x3LqultAvytsoitub3nLCiOSp8oqgW22xsB RWq8BST/h+tFP1DqfwfjnDE5iS30P7Pu+Fk8cR5Gd/zwovnBhGrTUbXKGVfN9JnkdNn+7r gr9gnJ9fBJsWbLqHfIG1++RGzN47TvTJUDmG7rBS81ewEOusWBeR2VKyixj7RA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684238972; 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: in-reply-to:in-reply-to:references:references; bh=0CQ+jS14zLcnozgvOt5eiAa5pnAfQVabet0JoqqqapU=; b=j+adUGTyuvlY/Dec510Z92zNWQxc+nbL6bbqR+ZX5EwNTbLmocylleWbkLnaEoMyJJarnQ AoGjc6/qa5rLQBCg== To: "Russell King (Oracle)" 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 , x86@kernel.org Subject: Re: Excessive TLB flush ranges In-Reply-To: References: <87a5y5a6kj.ffs@tglx> <87353x9y3l.ffs@tglx> <87zg658fla.ffs@tglx> <87r0rg93z5.ffs@tglx> <87cz308y3s.ffs@tglx> Date: Tue, 16 May 2023 14:09:32 +0200 Message-ID: <87y1lo7a0z.ffs@tglx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_050936_586693_EBD497C2 X-CRM114-Status: GOOD ( 22.76 ) 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 Tue, May 16 2023 at 09:48, Russell King wrote: > On Tue, May 16, 2023 at 10:44:07AM +0200, Thomas Gleixner wrote: >> On Tue, May 16 2023 at 09:19, Russell King wrote: >> > On Tue, May 16, 2023 at 08:37:18AM +0200, Thomas Gleixner wrote: >> >> void flush_tlb_kernel_vas(struct list_head *list, unsigned int num_entries): >> >> >> >> So that an architecture can decide whether it's worth to do walk the >> >> entries or whether it resorts to a flush all. >> > >> > Is "num_entries" what an arch would want to use? How would it use that? >> > It doesn't tell an arch whether there is a large range of many list >> > entries, or a single entry covering a large range. >> >> Does it matter? >> >> The total number of entries to flush is what accumulates and at some >> architecture specific threshold that becomes more expensive than a full >> flush, independent of the range of the individual list entries, no? > > It depends what you mean by "num_entries" - is that the number of > pages to be flushed in total in the range? Yes. The sum of all va list ranges. > If so, what does a valid "start" and "end" range passed to > __purge_vmap_area_lazy() mean for num_entries - does that go to > (end - start) / PAGE_SIZE, or would it still be restricted to the > sum of that per list entry? If so, what's the point of passing in > "start" and "end" to this function? _vm_unmap_aliases() collects dirty ranges from per cpu vmap_block_queue (what ever that is) and hands a start..end range to __purge_vmap_area_lazy(). As I pointed out already, this can also end up being an excessive range because there is no guarantee that those individual collected ranges are consecutive. Though I have no idea how to cure that right now. AFAICT this was done to spare flush IPIs, but the mm folks should be able to explain that properly. In the problematic case at hand and what I've seen from tracing so far, e.g. for module unload this looks always the same. A small range of direct map collected and then a bunch of vmap entries from the purge list. But have not yet tried hard to figure out whether that direct map collection is ever going to cover a larger range for no reason. Thanks, tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel