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 07B91C7619A for ; Wed, 5 Apr 2023 12:01:26 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7tsBelV4vjpWUxM6tZqwUtHechR7ULsnBPDxtra3hkE=; b=v3tvoXCa095U0E DYQ1NHB3AWxXl29ACNay4Lqx4r1FeEtlWOo7Jv+jAz94mmwCzQaHopzfxT+r9kI+wCCK77r3ZeNx0 Y4e/3iQgxok0SWLyswKG6OtS5ZZPOLq+TwBe/LJC0a7NK1ENN/k/qZ7r0O6JkLmAFMT/ZADZS99mM Ot07Lmb+lSv8GjdV/TLWcWvc3U3Rpgjm66UedMb9Oqg6ohYGcVjoqQJW+gTggeSsIBZo1UegDFLwb nbrkUH3H6fb5k831z0RCc0F4ZYMcR6Nu1ChBNGjqrlZZe0PWmf1J9NzD0YBYFdV+kdrYDDaea+4M1 KXluL3Egv89Pgx/a1r5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pk1oT-004LbT-24; Wed, 05 Apr 2023 12:00:29 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pk1oP-004LaY-2U for linux-arm-kernel@lists.infradead.org; Wed, 05 Apr 2023 12:00:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680696024; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RSlHLlJfuqzoKBsSMqongiC+StHcDiIfT1vSmb6xVfw=; b=g7kiVUStmMqlVf6kKVkdAaBI6r+wCGh1ipMKnr0c8EMjpfYZ4c2BiN7Ny8x9g4vBp3WYAM 0dfvO5luk2oRbpGJ2yGEIL0bJDqwiYRwBes6k87LtPnkdMElgeeJOKlVuRoSmmNaAeB9Vp mLOBSm9pljj1GFwaDca8gEHWvDFtCXQ= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252-TlXYGlu3P9qRoUyYZgRt1Q-1; Wed, 05 Apr 2023 08:00:22 -0400 X-MC-Unique: TlXYGlu3P9qRoUyYZgRt1Q-1 Received: by mail-wm1-f72.google.com with SMTP id bg33-20020a05600c3ca100b003ef6d684105so14760759wmb.1 for ; Wed, 05 Apr 2023 05:00:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680696020; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RSlHLlJfuqzoKBsSMqongiC+StHcDiIfT1vSmb6xVfw=; b=ku/pLJobZgvrlhtOXZpkc4SsXZkXqfH8VR8Kd2TBB9ekc/D6eOXwVrZ++v/bVtCxfo amquLQ1+qkoP2DyukQDhpsUYJfyCXanKY/+qRH5UkejjEIGpt5pILmg+3Q05kk4G51iV nP85qsnLoZ6At9LAwWWondW0gUf53fm1mXkJ80uc3/EzB3yU3MEKOdn/7zZWE5zh6tCa VAAJZshkTi7FFUHMGjJDU/7Jik/GLt5XXeJZ//eRI+IZd1HCeYPPiKZUJ7haRn2HkN9n 2874bHX0USeXPq5LBbidaUl98lVsaiM//CKNNmlSk6eURLN67X9SzRWHubBjnipM1BCC jt7A== X-Gm-Message-State: AAQBX9e5qXpk4HiLJw2/OWSjvZDwwVSgYmjUjw5Oaerlgg0PieMdjIoz joQo5wPOtD9HYR/iOg/B6+UaF8lVJhUdkDzX6Kh0pQ8kmATG3cyTve9i8qfQS1/XS/p/bJnKnX2 uKIEPsD9PbgeJwhVLwb2SupIhm/8OYYQPzfY= X-Received: by 2002:adf:f851:0:b0:2c6:85ef:4086 with SMTP id d17-20020adff851000000b002c685ef4086mr4082496wrq.32.1680696020605; Wed, 05 Apr 2023 05:00:20 -0700 (PDT) X-Google-Smtp-Source: AKy350a1LUfUOKuj3jMotBlpC19SVSB9cyW7enGegvzefcAmYdi8D6SEfOrURf0tsGiN5OpOE9NhWQ== X-Received: by 2002:adf:f851:0:b0:2c6:85ef:4086 with SMTP id d17-20020adff851000000b002c685ef4086mr4082439wrq.32.1680696020257; Wed, 05 Apr 2023 05:00:20 -0700 (PDT) Received: from ?IPV6:2003:cb:c703:d00:ca74:d9ea:11e0:dfb? (p200300cbc7030d00ca74d9ea11e00dfb.dip0.t-ipconnect.de. [2003:cb:c703:d00:ca74:d9ea:11e0:dfb]) by smtp.gmail.com with ESMTPSA id b13-20020adff24d000000b002c573778432sm14717731wrp.102.2023.04.05.05.00.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Apr 2023 05:00:19 -0700 (PDT) Message-ID: <480e9492-2043-4788-eaff-4995e9e3b56e@redhat.com> Date: Wed, 5 Apr 2023 14:00:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode To: Peter Zijlstra , 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, 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, mtosatti@redhat.com, vschneid@redhat.com, dhildenb@redhat.com, alougovs@redhat.com References: <20230404134224.137038-1-ypodemsk@redhat.com> <20230404134224.137038-4-ypodemsk@redhat.com> <20230405114148.GA351571@hirez.programming.kicks-ass.net> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230405114148.GA351571@hirez.programming.kicks-ass.net> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_050025_889709_0C63A73B X-CRM114-Status: GOOD ( 19.19 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 05.04.23 13:41, Peter Zijlstra wrote: > 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... > > Yeah, so I don't think that's actually a problem. The premise is that > *IFF* NOHZ_FULL stays in userspace, then it will never observe the IPI. > > If it violates this by doing syscalls or other kernel entries; it gets > to keep the pieces. Yair is currently on vacation, so I'm replying on his behalf. Indeed, RT userspace is supposed to not call into the kernel, that's the premise. -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel