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 7DF45EB64DA for ; Wed, 5 Jul 2023 22:56:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E06508D0002; Wed, 5 Jul 2023 18:56:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB62D8D0001; Wed, 5 Jul 2023 18:56:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C56E98D0002; Wed, 5 Jul 2023 18:56:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B578C8D0001 for ; Wed, 5 Jul 2023 18:56:08 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 87CA6160248 for ; Wed, 5 Jul 2023 22:56:08 +0000 (UTC) X-FDA: 80979068016.15.159F24C Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by imf08.hostedemail.com (Postfix) with ESMTP id C0B16160002 for ; Wed, 5 Jul 2023 22:56:06 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=Vh8cSpe0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf08.hostedemail.com: domain of surenb@google.com designates 209.85.219.178 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688597766; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MXH5f0COeRIrmYm+RjszHRwLzNX1NYGcISEJOTQzrMg=; b=pniwR8NYUIg2ZdXJn0D96p8l3VwWJv+DPuHZQ84WWiX+/BnrXYA/wyRnnnOssy/l1xGeWc Sj1JRQNTN13cJnmqUgDjHlBae6zGQ84IG8ie1T5jqkRh4EGzfiRW5k6dLhfcC+QWwZfJ+f L38bQ9Lt+iJ73sEr27YIz/+ASMLStSM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=Vh8cSpe0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf08.hostedemail.com: domain of surenb@google.com designates 209.85.219.178 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688597766; a=rsa-sha256; cv=none; b=l/FV5Pvm4olv16PMLv5DD9iplAp+PkzwXyHr+jO/RIwWnOlXnuuj+4DVzXN/uNSKOxjdW0 eRXNlJZ+tPDKFZbWlnymGZ5Mf7F+qWLn2Ok0DqEwfprQQSr8YOTYIqaZl/b+cbCACeZd/+ RpEr41dlNJN7wSrr6J5pnUPCSQEacXE= Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-bb3a77abd7bso21602276.0 for ; Wed, 05 Jul 2023 15:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688597766; x=1691189766; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MXH5f0COeRIrmYm+RjszHRwLzNX1NYGcISEJOTQzrMg=; b=Vh8cSpe0/S5MWzwJ44sHchl7rfw8diDnShAROH5IjHPT7bASndrwU5J0y4G+DSCGab 4dW1zVRYZ9bo2dTygJ3CqzGPs8NWppI4MTMyQvb0/7Ju2RXz5r/lZ6ty7mtyvl+I8nMU YP9zGLrbdGYOZ3pa+dPoIuTl7DWd7j436SMdHTk/z9Z3QlQORBYSqxUV6jnWJTHBTcdA P0+8rlLYIHfKRZQ2Hsbf4OX5TJpO68DH/cmBCCsWDXdY/XJp/FpIi7m/ZariaGGuI+Ze 5rmDg9KUKXsdSQmYUMgw2/j+TQqp+E/yZOn1sMYLsm/bMkF75I2as2dY9tiluOMScHa4 T5nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688597766; x=1691189766; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MXH5f0COeRIrmYm+RjszHRwLzNX1NYGcISEJOTQzrMg=; b=S043FAzFDvs0uFYyxXOLpcuQpvVLLCnKOisfE1oYqwaH02EI7gTQEPbS9kMsA6FH65 J22sZetoclQt4nc/QLlsAfnhAS+/z8n5BfvQLB48pAmIMGCKBPXt8n9j8RaNq02hzwnM fsSJplt3ITr/s3PtN1+J2vdSKzivbegOAbU6RDc56CSs2tSVliSEd2mLoqmiWwska6Mq iBJgAXWvViAEbgIE2Ktg90Ljoh2g/4ybtjqIeZ/uY5hCF+TiQ7otQ5m6tN0g9dsni+Au H3m8OY4FLML6mZ0wnGBUu5r1H9aSVe+2ZTtr3UutZqok9XyGSib9pzvkHtwwpzpOWasy V9rQ== X-Gm-Message-State: ABy/qLY/dirWvlUj67ouMPrOQSp3gwRmC2kyllQVN1cO7wnYxlGwe5YZ iUVsbNMG6H30flQBkat7EG12K14zFXVELLGmdnuVpQ== X-Google-Smtp-Source: APBJJlErd6Ezsj6NT38yL9MmEenH7or4rcjo8hiyLs+n1tEpW7QjhI/5/jqij25dHfVxPg1RuQIDdBt3/8Pg4AK7HdA= X-Received: by 2002:a25:f627:0:b0:c5c:6bb8:7e97 with SMTP id t39-20020a25f627000000b00c5c6bb87e97mr258178ybd.36.1688597765617; Wed, 05 Jul 2023 15:56:05 -0700 (PDT) MIME-Version: 1.0 References: <20230227173632.3292573-1-surenb@google.com> <20230227173632.3292573-30-surenb@google.com> <9a8d788c-b8ba-1b8a-fd79-0e25b1b60bed@kernel.org> <2f150512-e460-a9ae-65db-39dc54fe99d6@kernel.org> <04e701fc-2fd8-c4db-73d9-c86d4103641b@applied-asynchrony.com> In-Reply-To: <04e701fc-2fd8-c4db-73d9-c86d4103641b@applied-asynchrony.com> From: Suren Baghdasaryan Date: Wed, 5 Jul 2023 15:55:54 -0700 Message-ID: Subject: Re: [PATCH v4 29/33] x86/mm: try VMA lock-based page fault handling first To: =?UTF-8?Q?Holger_Hoffst=C3=A4tte?= Cc: Jiri Slaby , akpm@linux-foundation.org, michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, paulmck@kernel.org, mingo@redhat.com, will@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, chriscli@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, rppt@kernel.org, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, linux-mm Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: C0B16160002 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ctxwxntwynmikriio9mg9k3jn6yt9wb1 X-HE-Tag: 1688597766-355271 X-HE-Meta: U2FsdGVkX1/8cc3sDMri4upy+4k/c6De9qrwGrTlh/Lp51IeC1ISi/KbNY7sVeHcEm8I5nIejceR8rgyhxMvrrxyj++shITV5AR1NlJ1n5940jis4gtSyRiC9Q3uvFMd7hEyZNJbkBgFnxQDs8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+vpdHOSuzn9HsmWyI3ch4pXijc9avTJV2O93sTECGsfIg70lC//1oo+Dxz9Va8TbtWI8Vufh6lzLAPyT8YImA9hTN6g33a1VjxwnL1zAPjU4QqRYsmVx8L8iHlAuMqpFkzGAQEjqw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000047, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jul 5, 2023 at 3:37=E2=80=AFPM Holger Hoffst=C3=A4tte wrote: > > On 2023-07-06 00:15, Suren Baghdasaryan wrote: > > On Mon, Jul 3, 2023 at 6:52=E2=80=AFAM Holger Hoffst=C3=A4tte > > wrote: > >> > >> On 2023-07-03 12:47, Jiri Slaby wrote: > >>> Cc Jacob Young (from kernel bugzilla) > >>> > >>> On 30. 06. 23, 19:40, Suren Baghdasaryan wrote: > >>>> On Fri, Jun 30, 2023 at 1:43=E2=80=AFAM Jiri Slaby wrote: > >>>>> > >>>>> On 30. 06. 23, 10:28, Jiri Slaby wrote: > >>>>>> > 2348 > >>>>>> clone3({flags=3DCLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_= THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,= child_tid=3D0x7fcaa5882990, parent_tid=3D0x7fcaa5882990, exit_signal=3D0, = stack=3D0x7fcaa5082000, stack_size=3D0x7ffe00, tls=3D0x7fcaa58826c0} =3D> {= parent_tid=3D[2351]}, 88) =3D 2351 > >>>>>> > 2350 <... clone3 resumed> =3D> {parent_tid=3D[2372]}, 88) = =3D 2372 > >>>>>> > 2351 <... clone3 resumed> =3D> {parent_tid=3D[2354]}, 88) = =3D 2354 > >>>>>> > 2351 <... clone3 resumed> =3D> {parent_tid=3D[2357]}, 88) = =3D 2357 > >>>>>> > 2354 <... clone3 resumed> =3D> {parent_tid=3D[2355]}, 88) = =3D 2355 > >>>>>> > 2355 <... clone3 resumed> =3D> {parent_tid=3D[2370]}, 88) = =3D 2370 > >>>>>> > 2370 mmap(NULL, 262144, PROT_READ|PROT_WRITE, > >>>>>> MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 > >>>>>> > 2370 <... mmap resumed>) =3D 0x7fca68249000 > >>>>>> > 2372 <... clone3 resumed> =3D> {parent_tid=3D[2384]}, 88) = =3D 2384 > >>>>>> > 2384 <... clone3 resumed> =3D> {parent_tid=3D[2388]}, 88) = =3D 2388 > >>>>>> > 2388 <... clone3 resumed> =3D> {parent_tid=3D[2392]}, 88) = =3D 2392 > >>>>>> > 2392 <... clone3 resumed> =3D> {parent_tid=3D[2395]}, 88) = =3D 2395 > >>>>>> > 2395 write(2, "runtime: marked free object in s"..., 36 >>>>>> ...> > >>>>>> > >>>>>> I.e. IIUC, all are threads (CLONE_VM) and thread 2370 mapped ANON > >>>>>> 0x7fca68249000 - 0x7fca6827ffff and go in thread 2395 thinks for s= ome > >>>>>> reason 0x7fca6824bec8 in that region is "bad". > >>>> > >>>> Thanks for the analysis Jiri. > >>>> Is it possible from these logs to identify whether 2370 finished the > >>>> mmap operation before 2395 tried to access 0x7fca6824bec8? That acce= ss > >>>> has to happen only after mmap finishes mapping the region. > >>> > >>> Hi, > >>> > >>> it's hard to tell, but I assume so. > >>> > >>> For now, forget about this go's overly complicated, hard to reproduce= case and concentrate on the very nice reduced testcase in: > >>> https://bugzilla.kernel.org/show_bug.cgi?id=3D217624 > >>> ;) > >>> > >>> FWIW, I can reproduce using the test case too. > >>> > >>> thanks, > >> > >> As another (admittedly correlation-only) data point, I noticed at leas= t hourly crashes > >> of Firefox-114 after upgrading to 6.4.1, which had never happened befo= re with 6.3.x. > >> After reverting 0bff0aaea03e2a3ed6 - with a bit of context fixup due t= o follow-up > >> commits in 6.4.1 - it has been rock stable again, for several hours no= w. > > > > Jiri, Holger, would you be able to try > > https://lore.kernel.org/all/20230705171213.2843068-2-surenb@google.com/ > > and see if your issues still exist? > > Just in time! Not 2 minutes ago I finished rebuilding 6.4.2 + the last ve= rsion of > your patches on a second machine (old Intel Sandy Bridge workstation) to = be my > crash test dummy. I removed the BROKEN dependency in mm/Kconfig, manually= set > PER_VMA_LOCK=3Dy and ... it seems to work?! Boots fine, Firefox seems to = work > (but no exhaustive tests yet). I will also rerun a few reboot laps, just = to > exercise this a bit harder and see if something comes up. > > Tomorrow I'll also try again on my Zen2 Thinkpad and will report back. > > Fingers crossed! Thanks! This is promising. > > cheers > Holger