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 4FA10C7618D for ; Thu, 6 Apr 2023 13:17:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7D226B007D; Thu, 6 Apr 2023 09:17:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A21D36B007B; Thu, 6 Apr 2023 09:17:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C4A36B007D; Thu, 6 Apr 2023 09:17:04 -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 809C96B0074 for ; Thu, 6 Apr 2023 09:17:04 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 847D78127E for ; Thu, 6 Apr 2023 13:17:03 +0000 (UTC) X-FDA: 80651016726.26.29DFDE7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 5D50440019 for ; Thu, 6 Apr 2023 13:17:01 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=L9bvvX0H; spf=pass (imf04.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680787021; 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=rEZb6SaUsngmnCMPg4YGowc9TbgaZEBXr+mRqfM4dbw=; b=ZGyDU9BiIHCZjcszcAwcXVNXRw1nDXpprF7IdqFjH09/AvAP7WdWHaJ5WRQpdIJS5qe9RI Fc++U21+sSEkPRhMUfUoCDZ2XULLp9Syx5W1fRuxVtCKYfs6SIaFj2XhgM92AAWTTgXb7a uFlrLNrHGAbHrh7Nb2e1KQtiy4PqRAc= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=L9bvvX0H; spf=pass (imf04.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680787021; a=rsa-sha256; cv=none; b=zMJrdR8OcwuXhygchJ+sw6Qx5I1oB/tKRPgeBmGXZPTG2LSuWSS5aOK2OTxIbDxc9R9euX 485vkGWGWVQr8CQ5e8GvhPnmNabu8tpPFQV3tafu5GgpjWQ25R68kXbdTT+Bnn9pGvVZMt gY+XpKMIXcSKPio/EFg8LwOLea1I5bY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680787020; 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=rEZb6SaUsngmnCMPg4YGowc9TbgaZEBXr+mRqfM4dbw=; b=L9bvvX0HUgj5Ia4Sdazsh7hYJdQ7NjenSVL2IEAavelW4pO6fF8Bapm3+mqjmPKExqhCOS 1PMoofur1pZCogD3rEJUr9OCLY465Xx2RejyHj6TruoXRsCtsS3Zq74abVpau5BqYSjf4a Fut0ai/sTJeD8VnDz9aA9b8QxVq7ca0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-10l_5oWZPX2YbGgfWqkGXw-1; Thu, 06 Apr 2023 09:16:57 -0400 X-MC-Unique: 10l_5oWZPX2YbGgfWqkGXw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B0A9884EC0; Thu, 6 Apr 2023 13:16:55 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82F2D2166B26; Thu, 6 Apr 2023 13:16:54 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id A64FC40EB07D7; Thu, 6 Apr 2023 09:49:22 -0300 (-03) Date: Thu, 6 Apr 2023 09:49:22 -0300 From: Marcelo Tosatti To: Peter Zijlstra Cc: Frederic Weisbecker , Yair Podemsky , linux@armlinux.org.uk, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, will@kernel.org, aneesh.kumar@linux.ibm.com, akpm@linux-foundation.org, arnd@arndb.de, keescook@chromium.org, paulmck@kernel.org, jpoimboe@kernel.org, samitolvanen@google.com, ardb@kernel.org, juerg.haefliger@canonical.com, rmk+kernel@armlinux.org.uk, geert+renesas@glider.be, tony@atomide.com, linus.walleij@linaro.org, sebastian.reichel@collabora.com, nick.hawkins@hpe.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, vschneid@redhat.com, dhildenb@redhat.com, alougovs@redhat.com Subject: Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode Message-ID: References: <20230404134224.137038-1-ypodemsk@redhat.com> <20230404134224.137038-4-ypodemsk@redhat.com> <20230405195457.GC365912@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405195457.GC365912@hirez.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: am1hu4eeh8x4dz1n4j1aueja849yd8oe X-Rspamd-Queue-Id: 5D50440019 X-HE-Tag: 1680787021-948460 X-HE-Meta: U2FsdGVkX1/ElXDtJgvws7zyfcmwnBXP7DkrOWuUq3+n6wO4GVntP/U7CXPRkCRIO3O0//56H06HDPgl9WhV+3A0cxN5Nl3pS1kNIzOnbMYds/DzSZXAHRkwP2bNSdrwM0HCUPMEprX+0Jg+v7Q9+aEM2hmLgZRglWRrZqWuFq0yAKtkYrYohoZie2Ktw5aoaNpNshppQOVYxHcWOpWCGdLi4YOJYe5gmv72a/33uXjUSLrGRVVInULhWM4yMuzKPt+wUIHDTDqTWYlthPu4hEZdPdqfYLmbxcuhIMzOTV6k5XlbUvxbqnhlngItCqvBwAt4Y/hp9uo8yKRzUAbfMYNHQK7FAo7SDxaJuz8y3fDpolkSTMYMKGrt56fp7I0dPs5B9+X2e7fyVl0FjKcX81rRpvDzWZRf3u142DMjbzb4eZmSH0uuDWqCMTN3o0MIWi+p5NUUwXPpuKQxeuFg68Ry2bphl4Y1MsVCQF9lwWQfoTLTbxoNI0st5iyyOmLqqDWzrFjX2d4pKsrFtHIXiyli3Mgw7RvrP8bGPaYMYXiHNBo48NpJ5IVvMmKn9AeVR/l5Wxtyvqjya6nisj8fntoyRInMnUYl7lIGZ3/XxCLdGu6fEwH9MlAo3Fi6utUz1VoCz6/aLbCgPrbDGI4Q6NZMERnZ6SRjcJJUyHD2fEKeBffWT1wzBu7iYw383RW5by0dFGzj9ReH8mX8zjlEdQI567qoGhu6s9BlvewbQDzLme35grNQdN9Re44Oq9w7bPsHOCDZC98F0MwStOyakRqLZmF8wk05YVnu0932zdT2XK2GmGo2jLFBKbTHNILvN9FlzAjW9BzPvtOwzA5wGSdPzIV+GfJ2njSXtfyvPwfJuhnHJh9fw1BThqswjoVLyf7yQRaiaYL0+ylprZ8aN6HV5+JVn2b1zO/PDozn2uCw6SvBc9hjw+GbWaDVpel5AfofIEbcgtYt1JToYJm 5TFaAPQZ 8ajjh4BtSpikuC7UY9SfuA4AzsAm7FVVNlo2ppcomIBAJ3qaW5aOI1B77Z5/eDNinV4JNEHGnQm7cAHbe5IROg3nvHwKp2lehkfJ+WaaPioMBso3MwpxbX2Dhf4HyLAWUMtpFJ2y2EUxiNO9JD4pcOBL3yUmzBnDYqGFtqinVGxwJMZ44rC07ZSOskVMMWkfxEM3oVMbzUNShTvadNz5fszoriaEwLqNf0kT7rD3fHoxcC8rUWIlaMidfnQwsK9KMGd4453DWx6OxkvJTN2UWfe+4qcxNSclZjaf0S11xztCVeKdMBluA1xjdyQ== 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 Wed, Apr 05, 2023 at 09:54:57PM +0200, Peter Zijlstra wrote: > On Wed, Apr 05, 2023 at 04:43:14PM -0300, Marcelo Tosatti wrote: > > > Two points: > > > > 1) For a virtualized system, the overhead is not only of executing the > > IPI but: > > > > VM-exit > > run VM-exit code in host > > handle IPI > > run VM-entry code in host > > VM-entry > > I thought we could do IPIs without VMexit these days? Yes, IPIs to vCPU (guest context). In this case we can consider an IPI to the host pCPU (which requires VM-exit from guest context). > Also virt... /me walks away. > > > 2) Depends on the application and the definition of "occasional". > > > > For certain types of applications (for example PLC software or > > RAN processing), upon occurrence of an event, it is necessary to > > complete a certain task in a maximum amount of time (deadline). > > If the application is properly NOHZ_FULL and never does a kernel entry, > it will never get that IPI. If it is a pile of shit and does kernel > entries while it pretends to be NOHZ_FULL it gets to keep the pieces and > no amount of crying will get me to care. I suppose its common practice to use certain system calls in latency sensitive applications, for example nanosleep. Some examples: 1) cyclictest (nanosleep) 2) PLC programs (nanosleep) A system call does not necessarily have to take locks, does it ? Or even if application does system calls, but runs under a VM, then you are requiring it to never VM-exit. This reduces the flexibility of developing such applications.