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 68B54CA0ECA for ; Tue, 12 Sep 2023 08:35:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F0DE46B00D2; Tue, 12 Sep 2023 04:35:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBE496B00D3; Tue, 12 Sep 2023 04:35:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D857E6B00D4; Tue, 12 Sep 2023 04:35:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C8F8D6B00D2 for ; Tue, 12 Sep 2023 04:35:00 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9B5A3A0D01 for ; Tue, 12 Sep 2023 08:35:00 +0000 (UTC) X-FDA: 81227285160.04.39C35F2 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by imf11.hostedemail.com (Postfix) with ESMTP id B98C140014 for ; Tue, 12 Sep 2023 08:34:58 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of geert.uytterhoeven@gmail.com designates 209.85.128.180 as permitted sender) smtp.mailfrom=geert.uytterhoeven@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694507698; a=rsa-sha256; cv=none; b=8Kj7JZWTkqLZysabXiCyPZU6dx4ZlQxBBGzQMDFw4q+dh3OXSYTvaCXKD9yh7lMvG74EF5 ifjcTodwI73yzYbbXV+aX0ZdqXCng9TBBFoMtAp3GUHR5+XovrV15UbWMWAwn3xzANz8V/ Pjqu1PbixdKkE8rM8uHv6fX+uSay6wE= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of geert.uytterhoeven@gmail.com designates 209.85.128.180 as permitted sender) smtp.mailfrom=geert.uytterhoeven@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694507698; 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; bh=va0K00GDqUxBnNiJnV24w11PAu0AJJ95xu4LbYWmM+8=; b=Yp57eTtmUUC9Xh0lxE/QT3HZH5s2uLCaXZdbzXhL5ZrKColFqwj8sn5rp5IywfIFt3SLBk P+j4gqGUVIwX5Y2adSyn3bWL5ZN84S+x7fGTbO+FNwpsHfYeqVkjgREAYUATEsCvi+nmr6 iqbcOr44DlJgd2Ju4a8g0FTNVs9Axtk= Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-58d31f142eeso52596727b3.0 for ; Tue, 12 Sep 2023 01:34:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694507698; x=1695112498; 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=va0K00GDqUxBnNiJnV24w11PAu0AJJ95xu4LbYWmM+8=; b=Fl9wJZSZMEm2+RXoy2Jl/p0eIz7ua5s3IxgA19YkreAY5jeVNscnzC8m+HvUNXGS2m 8S0y20u/OsTVQiZ876imvjS84FStmiecNvVY/OFTuU0NndJLnuEjccnoIQHK/dDbK82Q K9Z6clzpNzPoYqb5jHjc1eE6/mAbAm75yJJ3Vbor5HqNk0NEjXEov+yT/nbcLny8S6RD rDlxrd11p+STCcMQLTbXeCyeSnWIJtzrgRktXzxAbLsNPEVrzbRhX0HeWPmJS29Fk2+u dEMWHtZLaiuC/RtggnQ8j0pGlxa1h0+gwHQeQrQAci5StBWVwjC9XtH7xs3Wba7LjiYN ofNA== X-Gm-Message-State: AOJu0Yzo2h0cmv70IEYmg6RiV4NeOTGIehBSyKEXW5EpCUV1dbEzfpdo 9PDv7Vyj2ru8yD1B0y4QWN+2m5/F2PS9QQ== X-Google-Smtp-Source: AGHT+IG1r3crsUCRbaWlNuqb4lalwTWPGWme1l9VKee/wlLV3hWbHUKrxhWfCJeRTeaYKv2m9k6EeA== X-Received: by 2002:a0d:e685:0:b0:58c:676c:b3ef with SMTP id p127-20020a0de685000000b0058c676cb3efmr14139343ywe.6.1694507697781; Tue, 12 Sep 2023 01:34:57 -0700 (PDT) Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com. [209.85.128.179]) by smtp.gmail.com with ESMTPSA id g123-20020a815281000000b0059b1e1b6e5dsm2437890ywb.91.2023.09.12.01.34.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Sep 2023 01:34:56 -0700 (PDT) Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-5924093a9b2so52416217b3.2 for ; Tue, 12 Sep 2023 01:34:56 -0700 (PDT) X-Received: by 2002:a25:a3c5:0:b0:d77:91db:e5c6 with SMTP id e63-20020a25a3c5000000b00d7791dbe5c6mr12060515ybi.17.1694507696692; Tue, 12 Sep 2023 01:34:56 -0700 (PDT) MIME-Version: 1.0 References: <20230819004356.1454718-1-Liam.Howlett@oracle.com> <20230819004356.1454718-2-Liam.Howlett@oracle.com> <3f86d58e-7f36-c6b4-c43a-2a7bcffd3bd@linux-m68k.org> <20230906152325.dblzauybyoq5kd35@revolver> <20230906172954.oq4vogeuco25zam7@revolver> <495849d6-1dc6-4f38-bce7-23c50df3a99f@paulmck-laptop> <20230911235452.xhtnt7ply7ayr53x@revolver> <33150b55-970c-4607-9015-af0e50e4112d@paulmck-laptop> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 12 Sep 2023 10:34:44 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other readers are possible To: paulmck@kernel.org Cc: "Liam R. Howlett" , Andrew Morton , maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Shanker Donthineni Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: B98C140014 X-Stat-Signature: d14wpprxmhaey5r5ptrh54mnzh7ri5gn X-Rspam-User: X-HE-Tag: 1694507698-357891 X-HE-Meta: U2FsdGVkX190gX73sfmxMfVS35DeNWdW6JRTEwBVcXX8ZM2q/WG8gAC4SnnxsYNHGcHJdGkPECS/oRPMUDH20Ub86pDUauxXoX0TxMaTHWgeysd/LElNJoWv8j/R++duuySE3pADOUnrXg6bUVgn1jcLJax1Q607eJ2RXQtoGiFzw7OyzihHZu1JmeOpYtFhtwYOG8el0q6PSk2jbplm/sBdgpEDePt6VPhv8/vufMbZGnM6bjivow22zyq5ZaFaizXnHpdUfM+AEM+q3aaUkpuDO42FM9xlCRNYE521QNTPC4dNmTRR2XjtxAIeesLXKYEoG2ggVbtBlrhxM2H4WgNMihtDM9WTzNwYUijAXVWpVGP2FaRWzuhwN9TcBnL+lzjVTPHQ/Ge3kfeaWuebKYXyP6lnbcI2iFATRv81ZwDc4FsAL+YZx1MoTbb2FiUdlmvODRvmJnzAkBRmivDNe19IAmIt8+wLncTDG2lX79ToPgXTYhu18WMsEITieGsPvjI3Len8m+rdnt9vEy2WJWBQ5R6ypOJgJMnKI6ea3o1ZEAaAHYa9IUVCmeA2x9kWxv6NYtKsc1VfunKul5hG02QEZ9Eyd2zmQ9BZ9u/ttyX4HBmksGPYDaUAMsAD8wcRW7KqMfNr181GiNPzDx9o35cBrdKAN0SjpKSxQJJsQsvovX7p1sdQubQUwBYywzstwzGg7jkp/rbUZpBtEIYj8ZNsMtGWDbKtoG65srgLRtI06d8bsUEeslKKeodjSHB0+gB51BFEggJPETTpkmPJnsTbtK1o7MqKfQcC/rc7gG9MadBkzwvmlKFsrp9QirKWlnRyNmBt4YNvtovEvqufIGwawgMNN2lye+34pAVZD8OJInNSbSM2kmchWGTcWNH2CaQ+U6KgiG39eQcUE+0OVR6PlQPWoepQOIWmsysuB8FyT+Jj6X0kCjsYFfsxRfHw5693N1nORHDwptYiWrI Lc+hnNR2 3XNHI/FTzJazR8XNoVpD22CCCZjHMTbVTZjBtQX/PzjR92Ks9r23MN2ZEtzZX9mKaq/QxJEYLUhzIXrXxXPh3svCEzh1nrMGk2eazeRUCBJHJfuFPHWLFmgwRTYY21sRM/wq9e+UPPzwGZ9S4q2XEw6PfjVqZc5KuWdRaHYuK9NUH9AAl61StOAOLe1duijJ4a1D6+aF7vFbdXwG7m9VNpLMUxHGPwhNto+1ybU40uMSYIgDTaww1x4qba2A+LIUxjNzDgV9yNetYXMzE5eTNsBCU60nwsKyHRItVK7RhKp1Uo+ptBi2zf5DzXi8CEKXaw3aBDM6/nAm0zHcwdCuOJ/7mgYFeWITB+PzQK6FuBy+3A2L+Etpa3y3j6GALHTHdl3tccXczq2QUttrazpp3saUmqI9VQ5wBAxwbT53NerE6eE06plpUbNexGlf2Zxy1aM6h06yplMhbtAmsnRIHkzVUJ3kguRtwSbRQQVeAn2IE/BQKuUkTZ0hdsyIYs8GdbGJoUzervBz8U3rpdPZ6UP4k6jFy0LNihoXRsIX4aKvmJgE+YVFGJggwLg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Paul, On Tue, Sep 12, 2023 at 10:30=E2=80=AFAM Paul E. McKenney wrote: > On Tue, Sep 12, 2023 at 10:23:37AM +0200, Geert Uytterhoeven wrote: > > On Tue, Sep 12, 2023 at 10:14=E2=80=AFAM Paul E. McKenney wrote: > > > On Mon, Sep 11, 2023 at 07:54:52PM -0400, Liam R. Howlett wrote: > > > > * Paul E. McKenney [230906 14:03]: > > > > > On Wed, Sep 06, 2023 at 01:29:54PM -0400, Liam R. Howlett wrote: > > > > > > * Paul E. McKenney [230906 13:24]: > > > > > > > On Wed, Sep 06, 2023 at 11:23:25AM -0400, Liam R. Howlett wro= te: > > > > > > > > (Adding Paul & Shanker to Cc list.. please see below for wh= y) > > > > > > > > > > > > > > > > Apologies on the late response, I was away and have been st= ruggling to > > > > > > > > get a working PPC32 test environment. > > > > > > > > > > > > > > > > * Geert Uytterhoeven [230829 12:42]: > > > > > > > > > Hi Liam, > > > > > > > > > > > > > > > > > > On Fri, 18 Aug 2023, Liam R. Howlett wrote: > > > > > > > > > > The current implementation of append may cause duplicat= e data and/or > > > > > > > > > > incorrect ranges to be returned to a reader during an u= pdate. Although > > > > > > > > > > this has not been reported or seen, disable the append = write operation > > > > > > > > > > while the tree is in rcu mode out of an abundance of ca= ution. > > > > > > > > > > > > > > > > ... > > > > > > > > > > > > > > > > > > ... > > > > > > > > > > > > > RCU-related configs: > > > > > > > > > > > > > > > > > > $ grep RCU .config > > > > > > > > > # RCU Subsystem > > > > > > > > > CONFIG_TINY_RCU=3Dy > > > > > > I must have been asleep last time I looked at this. I was looking at > > > Tree RCU. Please accept my apologies for my lapse. :-/ > > > > > > However, Tiny RCU's call_rcu() also avoids enabling IRQs, so I would > > > have said the same thing, albeit after looking at a lot less RCU code= . > > > > > > TL;DR: > > > > > > 1. Try making the __setup_irq() function's call to mutex_lock() > > > instead be as follows: > > > > > > if (!mutex_trylock(&desc->request_mutex)) > > > mutex_lock(&desc->request_mutex); > > > > > > This might fail if __setup_irq() has other dependencies on a > > > fully operational scheduler. > > > > > > 2. Move that ppc32 call to __setup_irq() much later, most defini= tely > > > after interrupts have been enabled and the scheduler is fully > > > operational. Invoking mutex_lock() before that time is not a > > > good idea. ;-) > > > > There is no call to __setup_irq() from arch/powerpc/? > > Glad it is not just me, given that I didn't see a direct call, either. S= o > later in this email, I asked Liam to put a WARN_ON_ONCE(irqs_disabled()) > just before that mutex_lock() in __setup_irq(). > > Either way, invoking mutex_lock() early in boot before interrupts have > been enabled is a bad idea. ;-) I'll add that WARN_ON_ONCE() too, and will report back later today... > > Note that there are (possibly different) issues seen on ppc32 and on ar= m32 > > (Renesas RZ/A in particular, but not on other Renesas ARM systems). > > > > I saw an issue on arm32 with cfeb6ae8bcb96ccf, but not with cfeb6ae8bcb= 96ccf^. > > Other people saw an issue on ppc32 with both cfeb6ae8bcb96ccf and > > cfeb6ae8bcb96ccf^. > > I look forward to hearing what is the issue in both cases. For RZ/A, my problem report is https://lore.kernel.org/all/3f86d58e-7f36-c6b4-c43a-2a7bcffd3bd@linux-m68k.= org/ Thanks! Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= .org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds