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 84AB8C7619A for ; Wed, 5 Apr 2023 19:47:17 +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=UqfkhQcc9IZOBnpt5QW9KKnzJ7eFPjKPYf68OQ/iH24=; b=DPXTU9Iu5UD0Cj 18Pa+qWYGrfrEkY07e9iLMcV6v7vK/Vl5URh8yawSW76mO2GmxkUBkjlmoALQD++eH8Tuv+vXOqR7 FP8hbSYG3R8mt1UqYLoDUFSJvMc4LXx0WUkE27TRZrDxAhtgW3WOUtDLohhxJWocFzXoCbyvW+oDY +ALpwMN8/OET6bWQ2ceSENDqNQl7ZX86ia5BaBIxBMkgwVAwtgmVgxWwmEtgaJki2NevmaRn46ddg H2PZ+4JKxAgz/AsgijBKGKSZMVATv8m5PldKL+GGZvUnE3Aa/LvXM0R2agJen60XEiEfkxwaNBkQa p9XrBjjUvDWhmCS5meaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pk95D-005X0v-2U; Wed, 05 Apr 2023 19:46:15 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pk95A-005Wwb-1c for linux-arm-kernel@lists.infradead.org; Wed, 05 Apr 2023 19:46:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680723963; 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=v0UG0byeuqLhQs+HkvCytAyNPcDi89bMLk15Ot/Yb9o=; b=Vw9jZrsjfAm9Hp5G1Qowwd5s8K40myaMZ9chvV2eRJahUos1gXsC1KpBKKq8/FW0bmlcV7 Y1ZHsTIT8vqKiAGo0iVXbvpoa3pxrJb0J10a97UyqrSwsM+KHG4I3uwxEhZKO+Ks1DShBx ME+f/veHmjk5Au6dJPosqHKIeROJw+0= 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-399-rTa71ey2MCCQay6tZWFKhw-1; Wed, 05 Apr 2023 15:45:59 -0400 X-MC-Unique: rTa71ey2MCCQay6tZWFKhw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 29B30101A550; Wed, 5 Apr 2023 19:45:57 +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 B72E940C6EC4; Wed, 5 Apr 2023 19:45:55 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 8DE6240134449; Wed, 5 Apr 2023 16:45:32 -0300 (-03) Date: Wed, 5 Apr 2023 16:45:32 -0300 From: Marcelo Tosatti To: Frederic Weisbecker Cc: 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, peterz@infradead.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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_124612_624784_A035D0FB X-CRM114-Status: GOOD ( 20.65 ) 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 Wed, Apr 05, 2023 at 01:10:07PM +0200, Frederic Weisbecker wrote: > On Wed, Apr 05, 2023 at 12:44:04PM +0200, Frederic Weisbecker wrote: > > On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: > > > + int state = atomic_read(&ct->state); > > > + /* will return true only for cpus in kernel space */ > > > + return state & CT_STATE_MASK == CONTEXT_KERNEL; > > > +} > > > > Also note that this doesn't stricly prevent userspace from being interrupted. > > You may well observe the CPU in kernel but it may receive the IPI later after > > switching to userspace. > > > > We could arrange for avoiding that with marking ct->state with a pending work bit > > to flush upon user entry/exit but that's a bit more overhead so I first need to > > know about your expectations here, ie: can you tolerate such an occasional > > interruption or not? > > Bah, actually what can we do to prevent from that racy IPI? Not much I fear... Use a different mechanism other than an IPI to ensure in progress __get_free_pages_fast() has finished execution. Isnt this codepath slow path enough that it can use synchronize_rcu_expedited? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel