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 991E6C77B75 for ; Tue, 16 May 2023 06:46:30 +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=AGsddOzecC7nn1hP8xVyV8Sl786hpcgiVqOYGEcDxjA=; b=pRKbYmWPj+KpOg AF0jC837E/VybnMZ/h9IoV8jxAE5WtosLgRRDFeKYSfwfWSpy45krO3vf/IdQTP1PzZ5+46IATJym DnXJHuSEQUKHIxBoDzhWDtXFbdcxd9PjbIk1YI3gRBdyWA3FvLKuTMpsU6vtyLZi5wyhvKVMSWT5S Zj2fwZhXKdLiXmU4FaPl8BGfAQQ9O8X0+zKFEMj79Iwl7kxOUgsZplYQzFftTfDuVgV8RwlhbJXiS oLNwAlSY47L1a87b0qAiNN9IkYkbFyRqFYfwZkf6pTDAL0Pb8WMofGG12imb+fFmPwipkX1CacrS4 rKzSowdl1KPmEh88jJVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyoRk-004YFB-1w; Tue, 16 May 2023 06:46:08 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyoRh-004YDX-2V for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 06:46:07 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684219564; 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=T0pJW8FsQ/W0a0sLTNPepIH59AxRXaaj71u89PT9jXI=; b=SQb9z37fZztMolTVD9OGHY0UBWBvB1RoAt9gTN1l9AxKzVK+wT9r0S1JfGrCLLDr8JR/pD l7UcHRqJe803TVKHhvrF4WfLV1naza7+Pql7M1I/7TkRzp4rWhRU2ig+W9v61cjWTFgjEl W/onf4Bo55d6wy0oH8xYR97d2Xqm6LlqXkbnOzwR/AaRMK+czSmFuinc6CC0VJ6X8YWlaK GuOXoUrCmAcPvSEuMgkB+6FTpm1NGOfG23ACZPDdE/qc2E7u4QKHLszd8rCJTVrJpqFUGe jWiRrezRxeBHPcS7T1TLiZyW+EzcOKQvYEaQXvWWsFh87pK5LWKYCFB3fsI1LQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684219564; 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=T0pJW8FsQ/W0a0sLTNPepIH59AxRXaaj71u89PT9jXI=; b=7VhqL8RfurMeIoshIVb/nWFBWSfKmagmy+E7JckP4p4d5gsH7E6Tx4qh7EnJZCl94CW5qa r9Ps6/g9Nz/53OCA== 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: <87r0rg93z5.ffs@tglx> References: <87a5y5a6kj.ffs@tglx> <87353x9y3l.ffs@tglx> <87zg658fla.ffs@tglx> <87r0rg93z5.ffs@tglx> Date: Tue, 16 May 2023 08:46:03 +0200 Message-ID: <87leho93kk.ffs@tglx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_234605_959904_6CC0C1B5 X-CRM114-Status: GOOD ( 13.98 ) 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 08:37, Thomas Gleixner wrote: > On Mon, May 15 2023 at 22:31, Russell King wrote: >> In the case you have, are "start" and "end" set on function entry >> to a range, or are they set to ULONG_MAX,0 ? What I'm wondering is >> whether we could get away with just having flush_tlb_kernel_vas(). >> >> Whether that's acceptable to others is a different question :) > > As I said flush_tlb_kernel_vas() should be > > 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. The only issue is that the flush range which is handed in from _vm_unmap_aliases(), i.e. the conglomorate of to be mopped up TLBs is an aggregate too. In this particular BPF case it's always one page, but that obviously might end up being a horrible large range too. Though there is no way to do that fake vmap_area trick I used in __purge_vmap_area_lazy(). Bah! Thanks, tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8C3CC77B75 for ; Tue, 16 May 2023 06:46:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4CC71900003; Tue, 16 May 2023 02:46:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 47CAF900002; Tue, 16 May 2023 02:46:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36AF8900003; Tue, 16 May 2023 02:46:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 28CB8900002 for ; Tue, 16 May 2023 02:46:09 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D42E71C67AF for ; Tue, 16 May 2023 06:46:08 +0000 (UTC) X-FDA: 80795183616.29.D0A4491 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf02.hostedemail.com (Postfix) with ESMTP id 242258000C for ; Tue, 16 May 2023 06:46:05 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=SQb9z37f; dkim=pass header.d=linutronix.de header.s=2020e header.b=7VhqL8Rf; spf=pass (imf02.hostedemail.com: domain of tglx@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=tglx@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684219566; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=T0pJW8FsQ/W0a0sLTNPepIH59AxRXaaj71u89PT9jXI=; b=CV4NAobLQ3/d6xucZRXClRQVWOfhnpnlmqk4vHbbP3YQ0VRB9a0XmM3cTP0MSphGjgqVkx k8/L+ewMXCKjsS+Tk4RpL/NwlgUq8vgwNVxwMg/NATQYSn5upNK5Ipk5oyXzAl+kB4RXy7 otCKFclqW/AHYQp3TbD8SZ39K/eBUXg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684219566; a=rsa-sha256; cv=none; b=d39S6q+CZ8NvHyWKiG7oOkXA78bc2EERCUN/Mo/FJUtb0k3rKQSMwe/mgxQZzaMw3OSu7I VzDk0zLESKnbJYdUw5UpcDxfwqYtcewAeRYl8v+gJJtt0CovUDOLHvOYRM3yNNE+7qlMw3 pSjiePGQswlkucLoYlKSbZrc7M5yMJ4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=SQb9z37f; dkim=pass header.d=linutronix.de header.s=2020e header.b=7VhqL8Rf; spf=pass (imf02.hostedemail.com: domain of tglx@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=tglx@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684219564; 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=T0pJW8FsQ/W0a0sLTNPepIH59AxRXaaj71u89PT9jXI=; b=SQb9z37fZztMolTVD9OGHY0UBWBvB1RoAt9gTN1l9AxKzVK+wT9r0S1JfGrCLLDr8JR/pD l7UcHRqJe803TVKHhvrF4WfLV1naza7+Pql7M1I/7TkRzp4rWhRU2ig+W9v61cjWTFgjEl W/onf4Bo55d6wy0oH8xYR97d2Xqm6LlqXkbnOzwR/AaRMK+czSmFuinc6CC0VJ6X8YWlaK GuOXoUrCmAcPvSEuMgkB+6FTpm1NGOfG23ACZPDdE/qc2E7u4QKHLszd8rCJTVrJpqFUGe jWiRrezRxeBHPcS7T1TLiZyW+EzcOKQvYEaQXvWWsFh87pK5LWKYCFB3fsI1LQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684219564; 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=T0pJW8FsQ/W0a0sLTNPepIH59AxRXaaj71u89PT9jXI=; b=7VhqL8RfurMeIoshIVb/nWFBWSfKmagmy+E7JckP4p4d5gsH7E6Tx4qh7EnJZCl94CW5qa r9Ps6/g9Nz/53OCA== 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: <87r0rg93z5.ffs@tglx> References: <87a5y5a6kj.ffs@tglx> <87353x9y3l.ffs@tglx> <87zg658fla.ffs@tglx> <87r0rg93z5.ffs@tglx> Date: Tue, 16 May 2023 08:46:03 +0200 Message-ID: <87leho93kk.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Stat-Signature: s5djsxj7pun3d4c49jq6im6sxmz3o1dn X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 242258000C X-HE-Tag: 1684219565-166068 X-HE-Meta: U2FsdGVkX19g6L4oGtlyoQvBKlaq3JvdA7mt/Hll8TYfiZ0vLTUcBjQ4GE+U4p8paEKBW0DRrL6teYy49BU7AGiGEVPrT/fBldOZ4MzecyRPoBQOGpS/3Iy2JB1PtYA/iBrxCv3Rvwr41cJcFbioxceuM9GHKbLuWkZM+fDAW44ytDpYSpT4GpMxfhH5BLp0BK67w132AdzIi6qCDBUWGpB/Tt7KqnwhhkHZQf0GtLBqbCMMNOgXWQV2hNFOtssx53RYq98z7w4s8Fy3iFCblKrIT+5KmU+cm0BJxiif9v6TN/KX2lcFDLBWMHiFLSm4Y1WJJ6w+1fQ7eY89TxFTNdQ7Bp7GAWMIQT/oNXW764edrTrzTeCqIhrM6vG4v9/dzzLy94SWA4Fvnc3oudovO1t0eC4mpsCED7Ft1qR5D+GJ43hTc/hav+6Qjf1qvZOKM2OA6xDH9i7q/XtC9jwBuPk6xS95jhcY0HL5NzwYRcgD0ItWaGGoHjpTaD7RcVa2WIWC1Hy0GCQsDFEzoR+Qa1wXD5gT1YGugs4//YvSoMwS6WDLepVAuy2EkxyrR/lNJRUB3s4ekKAtHkeStPbi6Ku9EYkTT2rOswKFbdGr6PA/BMNvJMa1AZwd8LuHBQZB2xdlkqWP88exJDXux4Sb3HWABUK3uTSo/ycQmVrzGvky5CCyndTeJq8dEPKqmjrS3FN4cMOH+bbZuhIR9Z6tlD9NAtonyx83TiPdXQNf2hvk7NOWRSxRu4tD880lazYcSumityACTjwLUR8+gvYgswosuX+PD+/lBVcjtSJTnWLS5csJrZlrH9uyJc2qPwXZojd0xiwJl3nLUniwWednUtHb1cRvjHuhPdgE4ch99+fKhZCvo82nf8IfCtnyoAvJ3tUjT+v+snw0ZCIprS8qVpCyLumsrDktURAPtW+zJThYHlGJQMKhgq1geOm7J84S4LgN/jbCinKpm1YVAna 33Nz6vSW a58glMGyMUpssNfjHCB5UydokELNzX3iz0vGvq0OSAZmRzF0= 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: On Tue, May 16 2023 at 08:37, Thomas Gleixner wrote: > On Mon, May 15 2023 at 22:31, Russell King wrote: >> In the case you have, are "start" and "end" set on function entry >> to a range, or are they set to ULONG_MAX,0 ? What I'm wondering is >> whether we could get away with just having flush_tlb_kernel_vas(). >> >> Whether that's acceptable to others is a different question :) > > As I said flush_tlb_kernel_vas() should be > > 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. The only issue is that the flush range which is handed in from _vm_unmap_aliases(), i.e. the conglomorate of to be mopped up TLBs is an aggregate too. In this particular BPF case it's always one page, but that obviously might end up being a horrible large range too. Though there is no way to do that fake vmap_area trick I used in __purge_vmap_area_lazy(). Bah! Thanks, tglx