[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <480e9492-2043-4788-eaff-4995e9e3b56e@redhat.com>
Date: Wed, 5 Apr 2023 14:00:17 +0200
From: David Hildenbrand <david@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <frederic@...nel.org>
Cc: Yair Podemsky <ypodemsk@...hat.com>, linux@...linux.org.uk,
mpe@...erman.id.au, npiggin@...il.com, christophe.leroy@...roup.eu,
hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
borntraeger@...ux.ibm.com, svens@...ux.ibm.com,
davem@...emloft.net, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, will@...nel.org, aneesh.kumar@...ux.ibm.com,
akpm@...ux-foundation.org, arnd@...db.de, keescook@...omium.org,
paulmck@...nel.org, jpoimboe@...nel.org, samitolvanen@...gle.com,
ardb@...nel.org, juerg.haefliger@...onical.com,
rmk+kernel@...linux.org.uk, geert+renesas@...der.be,
tony@...mide.com, linus.walleij@...aro.org,
sebastian.reichel@...labora.com, nick.hawkins@....com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org,
sparclinux@...r.kernel.org, linux-arch@...r.kernel.org,
linux-mm@...ck.org, mtosatti@...hat.com, vschneid@...hat.com,
dhildenb@...hat.com, alougovs@...hat.com
Subject: Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI
only to CPUs in kernel mode
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
Powered by blists - more mailing lists