Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-08 Thread Suren Baghdasaryan
On Sat, Jul 8, 2023 at 12:23 PM Linus Torvalds wrote: > > On Sat, 8 Jul 2023 at 12:17, Suren Baghdasaryan wrote: > > > > Do you want me to disable per-VMA locks by default as well? > > No. I seriously believe that if the per-vma locking is so broken that > it needs to be disabled in a development

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-08 Thread Linus Torvalds
On Sat, 8 Jul 2023 at 12:17, Suren Baghdasaryan wrote: > > Do you want me to disable per-VMA locks by default as well? No. I seriously believe that if the per-vma locking is so broken that it needs to be disabled in a development kernel, we should just admit failure, and revert it all. And not i

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-08 Thread Linus Torvalds
On Sat, 8 Jul 2023 at 11:40, Suren Baghdasaryan wrote: > > My understanding was that flush_cache_dup_mm() is there to ensure > nothing is in the cache, so locking VMAs before doing that would > ensure that no page faults would pollute the caches after we flushed > them. Is that reasoning incorrect

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-08 Thread Suren Baghdasaryan
On Sat, Jul 8, 2023 at 11:05 AM Linus Torvalds wrote: > > On Sat, 8 Jul 2023 at 10:39, Andrew Morton wrote: > > > > That was the v1 fix, but after some discussion > > (https://lkml.kernel.org/r/20230705063711.2670599-1-sur...@google.com) > > it was decided to take the "excessive" approach. > > Th

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-08 Thread Linus Torvalds
On Sat, 8 Jul 2023 at 10:39, Andrew Morton wrote: > > That was the v1 fix, but after some discussion > (https://lkml.kernel.org/r/20230705063711.2670599-1-sur...@google.com) > it was decided to take the "excessive" approach. That makes absolutely _zero_ sense. It seems to be complete voodoo prog

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-08 Thread Andrew Morton
On Sat, 8 Jul 2023 10:29:42 -0700 Linus Torvalds wrote: > On Sat, 8 Jul 2023 at 04:35, Thorsten Leemhuis > wrote: > > > > The plan since early this week is to mark CONFIG_PER_VMA_LOCK as broken; > > latest patch that does this is this one afaics: > > Bah. > > Both marking it as broken and the

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-08 Thread Linus Torvalds
On Sat, 8 Jul 2023 at 04:35, Thorsten Leemhuis wrote: > > The plan since early this week is to mark CONFIG_PER_VMA_LOCK as broken; > latest patch that does this is this one afaics: Bah. Both marking it as broken and the pending fix seems excessive. Why isn't the trivial fix just to say "yes, fo

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-08 Thread Thorsten Leemhuis
[adding Linus to the list of recipients to ensure the fix makes it into -rc1 (and can finally be backported to -stable). Linus, here is the backstory, as I assume you haven't seen this yet: CONFIG_PER_VMA_LOCK (which defaults to Y; merged for v6.4-rc1 in 0bff0aaea03 ("x86/mm: try VMA lock-based p

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-05 Thread Suren Baghdasaryan
On Wed, Jul 5, 2023 at 9:14 AM Suren Baghdasaryan wrote: > > On Wed, Jul 5, 2023 at 8:49 AM Andrew Morton > wrote: > > > > On Wed, 5 Jul 2023 10:51:57 +0200 "Linux regression tracking (Thorsten > > Leemhuis)" wrote: > > > > > >>> I'm in wait-a-few-days-mode on this. To see if we have a backpo

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-05 Thread Suren Baghdasaryan
On Wed, Jul 5, 2023 at 8:49 AM Andrew Morton wrote: > > On Wed, 5 Jul 2023 10:51:57 +0200 "Linux regression tracking (Thorsten > Leemhuis)" wrote: > > > >>> I'm in wait-a-few-days-mode on this. To see if we have a backportable > > >>> fix rather than disabling the feature in -stable. > > > > An

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-05 Thread Andrew Morton
On Wed, 5 Jul 2023 10:51:57 +0200 "Linux regression tracking (Thorsten Leemhuis)" wrote: > >>> I'm in wait-a-few-days-mode on this. To see if we have a backportable > >>> fix rather than disabling the feature in -stable. > > Andrew, how long will you remain in "wait-a-few-days-mode"? Given wha

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-05 Thread Greg KH
On Wed, Jul 05, 2023 at 10:51:57AM +0200, Linux regression tracking (Thorsten Leemhuis) wrote: > On 05.07.23 09:08, Greg KH wrote: > > On Tue, Jul 04, 2023 at 01:22:54PM -0700, Suren Baghdasaryan wrote: > >> On Tue, Jul 4, 2023 at 9:18 AM Andrew Morton > >> wrote: > >>> On Tue, 4 Jul 2023 09:00:

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-05 Thread Linux regression tracking (Thorsten Leemhuis)
On 05.07.23 09:08, Greg KH wrote: > On Tue, Jul 04, 2023 at 01:22:54PM -0700, Suren Baghdasaryan wrote: >> On Tue, Jul 4, 2023 at 9:18 AM Andrew Morton >> wrote: >>> On Tue, 4 Jul 2023 09:00:19 +0100 Greg KH >>> wrote: Thanks! I'll investigate this later today. After discussing with >>

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-05 Thread Greg KH
On Tue, Jul 04, 2023 at 01:22:54PM -0700, Suren Baghdasaryan wrote: > On Tue, Jul 4, 2023 at 9:18 AM Andrew Morton > wrote: > > > > On Tue, 4 Jul 2023 09:00:19 +0100 Greg KH > > wrote: > > > > > > > > > Thanks! I'll investigate this later today. After discussing with > > > > > > > Andrew, we wo

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-04 Thread Suren Baghdasaryan
On Tue, Jul 4, 2023 at 3:04 PM Suren Baghdasaryan wrote: > > On Tue, Jul 4, 2023 at 2:28 PM Andrew Morton > wrote: > > > > On Tue, 4 Jul 2023 13:22:54 -0700 Suren Baghdasaryan > > wrote: > > > > > On Tue, Jul 4, 2023 at 9:18 AM Andrew Morton > > > wrote: > > > > > > > > On Tue, 4 Jul 2023 09

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-04 Thread Suren Baghdasaryan
On Tue, Jul 4, 2023 at 2:28 PM Andrew Morton wrote: > > On Tue, 4 Jul 2023 13:22:54 -0700 Suren Baghdasaryan > wrote: > > > On Tue, Jul 4, 2023 at 9:18 AM Andrew Morton > > wrote: > > > > > > On Tue, 4 Jul 2023 09:00:19 +0100 Greg KH > > > wrote: > > > > > > > > > > > Thanks! I'll investigat

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-04 Thread Andrew Morton
On Tue, 4 Jul 2023 13:22:54 -0700 Suren Baghdasaryan wrote: > On Tue, Jul 4, 2023 at 9:18 AM Andrew Morton > wrote: > > > > On Tue, 4 Jul 2023 09:00:19 +0100 Greg KH > > wrote: > > > > > > > > > Thanks! I'll investigate this later today. After discussing with > > > > > > > Andrew, we would li

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-04 Thread Suren Baghdasaryan
On Tue, Jul 4, 2023 at 9:18 AM Andrew Morton wrote: > > On Tue, 4 Jul 2023 09:00:19 +0100 Greg KH wrote: > > > > > > > Thanks! I'll investigate this later today. After discussing with > > > > > > Andrew, we would like to disable CONFIG_PER_VMA_LOCK by default > > > > > > until > > > > > > the is

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-04 Thread Andrew Morton
On Tue, 4 Jul 2023 09:00:19 +0100 Greg KH wrote: > > > > > Thanks! I'll investigate this later today. After discussing with > > > > > Andrew, we would like to disable CONFIG_PER_VMA_LOCK by default until > > > > > the issue is fixed. I'll post a patch shortly. > > > > > > > > Posted at: > > > >

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-04 Thread Greg KH
On Tue, Jul 04, 2023 at 12:45:39AM -0700, Suren Baghdasaryan wrote: > On Mon, Jul 3, 2023 at 11:44 AM Greg KH wrote: > > > > On Mon, Jul 03, 2023 at 11:27:19AM -0700, Suren Baghdasaryan wrote: > > > On Mon, Jul 3, 2023 at 11:08 AM Suren Baghdasaryan > > > wrote: > > > > > > > > On Mon, Jul 3, 20

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-04 Thread Suren Baghdasaryan
On Mon, Jul 3, 2023 at 11:44 AM Greg KH wrote: > > On Mon, Jul 03, 2023 at 11:27:19AM -0700, Suren Baghdasaryan wrote: > > On Mon, Jul 3, 2023 at 11:08 AM Suren Baghdasaryan > > wrote: > > > > > > On Mon, Jul 3, 2023 at 2:53 AM Linux regression tracking (Thorsten > > > Leemhuis) wrote: > > > >

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-03 Thread Greg KH
On Mon, Jul 03, 2023 at 11:27:19AM -0700, Suren Baghdasaryan wrote: > On Mon, Jul 3, 2023 at 11:08 AM Suren Baghdasaryan wrote: > > > > On Mon, Jul 3, 2023 at 2:53 AM Linux regression tracking (Thorsten > > Leemhuis) wrote: > > > > > > On 02.07.23 14:27, Bagas Sanjaya wrote: > > > > I notice a re

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-03 Thread Suren Baghdasaryan
On Mon, Jul 3, 2023 at 11:08 AM Suren Baghdasaryan wrote: > > On Mon, Jul 3, 2023 at 2:53 AM Linux regression tracking (Thorsten > Leemhuis) wrote: > > > > On 02.07.23 14:27, Bagas Sanjaya wrote: > > > I notice a regression report on Bugzilla [1]. Quoting from it: > > > > > >> After upgrading to

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-03 Thread Suren Baghdasaryan
On Mon, Jul 3, 2023 at 2:53 AM Linux regression tracking (Thorsten Leemhuis) wrote: > > On 02.07.23 14:27, Bagas Sanjaya wrote: > > I notice a regression report on Bugzilla [1]. Quoting from it: > > > >> After upgrading to kernel version 6.4.0 from 6.3.9, I noticed frequent but > >> random crashe

Re: Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-03 Thread Linux regression tracking (Thorsten Leemhuis)
On 02.07.23 14:27, Bagas Sanjaya wrote: > I notice a regression report on Bugzilla [1]. Quoting from it: > >> After upgrading to kernel version 6.4.0 from 6.3.9, I noticed frequent but >> random crashes in a user space program. After a lot of reduction, I have >> come up with the following repr

Fwd: Memory corruption in multithreaded user space program while calling fork

2023-07-02 Thread Bagas Sanjaya
Hi, I notice a regression report on Bugzilla [1]. Quoting from it: > After upgrading to kernel version 6.4.0 from 6.3.9, I noticed frequent but > random crashes in a user space program. After a lot of reduction, I have > come up with the following reproducer program: > > $ uname -a > Linux ja