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 0137BCA0EC3 for ; Tue, 12 Sep 2023 08:23:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 802B46B00CE; Tue, 12 Sep 2023 04:23:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B2906B00CF; Tue, 12 Sep 2023 04:23:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C7DD6B00D0; Tue, 12 Sep 2023 04:23:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5BA506B00CE for ; Tue, 12 Sep 2023 04:23:52 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2FE60B3F4F for ; Tue, 12 Sep 2023 08:23:52 +0000 (UTC) X-FDA: 81227257104.12.231B19B Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) by imf08.hostedemail.com (Postfix) with ESMTP id 3E1AD160014 for ; Tue, 12 Sep 2023 08:23:50 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf08.hostedemail.com: domain of geert.uytterhoeven@gmail.com designates 209.85.219.172 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=1694507030; 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=xHZ8eeFK6SlfNu714uZ9TQyNIbYwztkyzv/gWNYPv8w=; b=3LhvpNGVO+mTh6pkie0dxfAFVoOBbua0vl+pu5FJ/oykjigOuO9cem6yV3XgvGptJ/ERAX QzSbwPztVTTAtyjO1MTobrhXSsWDLA0hqxwZgtmI5uqAVaX8oWSDkRgPT9zAc2pzaLa5mB oU6eGimcJg98iBVbeosVaIjq6WZ8ji4= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf08.hostedemail.com: domain of geert.uytterhoeven@gmail.com designates 209.85.219.172 as permitted sender) smtp.mailfrom=geert.uytterhoeven@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694507030; a=rsa-sha256; cv=none; b=sbliPNR1pfDWtvqi/RAUnvkvLei2Cle7Ji+225lyB1HDyGsJ6w85iw4MzakSXIB0HjQ+tE KqaOqfjTx2Soi0NyqSeS2Rq3hypMtu4qdjnFSEh+V02PBbGYEMzeSYI5NszZw60lkP16b1 aQ4e8MpaIG0OAbAT3fPqjCtSH/e3RVc= Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-d80211e8df8so3591590276.3 for ; Tue, 12 Sep 2023 01:23:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694507029; x=1695111829; 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=xHZ8eeFK6SlfNu714uZ9TQyNIbYwztkyzv/gWNYPv8w=; b=DygvGyzj+7eryrbHshuGOLdwKkbpmiwVSczz/kkjZriC2lfq4r1HgP7rVzzNrO/5PD 8iwUwR8S9L9UGM2ZUJVkVykjz3hb5nRf5RebjPZwbdUHKKwhTfyrY+Lla6IurVneKNTM Jfg/wJAG4vERDnkbXeItN/dYGODAhG63bKOcIcYN2bn/pZov1/1ta/MDKIlUpeFwnjT5 TLG42RWknsvNaRuUr4DCl+6EJjAlTHk+RAXR8zT0mVGX2AZBKa6dilI2306kR9+oyJJw UY/m4vVPz1r5QPKfYJT5m/WH05/SMcyM3dqwP9hCQB2kouTcL4jEy1xV/ppGoqLONQB9 uqkg== X-Gm-Message-State: AOJu0Yy4VIM2V/CXaje/vUzCRP6xcMPjg/32Xh8BzIxfBizZmhK3TmLp HmwWnqw9GH4W+aYrMERAglaBRYRegBatbQ== X-Google-Smtp-Source: AGHT+IEhaM9RK40eHdZFMTokFlDvHAShBE5ntqhWGp3rnfPtmER/V2Y9gpraH032TejQ6X5Au4bP5w== X-Received: by 2002:a25:da87:0:b0:d77:cd42:9138 with SMTP id n129-20020a25da87000000b00d77cd429138mr11986027ybf.63.1694507029015; Tue, 12 Sep 2023 01:23:49 -0700 (PDT) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com. [209.85.219.175]) by smtp.gmail.com with ESMTPSA id j12-20020a25d20c000000b00d7481ed7e45sm2091675ybg.56.2023.09.12.01.23.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Sep 2023 01:23:48 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-d80211e8df8so3591576276.3 for ; Tue, 12 Sep 2023 01:23:48 -0700 (PDT) X-Received: by 2002:a25:4d46:0:b0:d06:2494:ef77 with SMTP id a67-20020a254d46000000b00d062494ef77mr10820004ybb.16.1694507028362; Tue, 12 Sep 2023 01:23:48 -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: <33150b55-970c-4607-9015-af0e50e4112d@paulmck-laptop> From: Geert Uytterhoeven Date: Tue, 12 Sep 2023 10:23:37 +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: rspam09 X-Rspamd-Queue-Id: 3E1AD160014 X-Stat-Signature: wf464kc9asaici6q3n5ue5ywhayo15r3 X-Rspam-User: X-HE-Tag: 1694507030-526274 X-HE-Meta: U2FsdGVkX1+rax6iqq6hcpo3NyBjoc64NRpC0pdQzAHNSOkiJg7PDwRzew3ctmm8cnJHXdINqRcCgExEwA+9saXNia6gk1K3yfeAbAZ5EjAYFxSJKtYtHRkt1yKViQyAigbMDY9TnXaS937MPwSrfq+hPDuLrnvUZDp43BfqkaWqJkM3FhFITLQb026ZIp4311I7KhoEvqWaGGzyg6siPZtOQfR+Cfyzw89OC+zDm5XNr5JEppFmNRKm+jJPtR5Orp04hHgNWelv26VIHyhItCrozrYaaJuK6Ztyz2wXQhrxe9MeYzH6A4pbj1hpahSsusnR0Aecz7z5rQat4RnzpAmrU2tuQm8xVASgVh+fcORD0S82GoezvqfRNj3G+J/GsrmrqNIbrsUOBgwGi3bQoTs22B2sDRfG2yQTl+m9Ht8HYYpQbcZuiuH7ud0cuD13l/L6bd/+cdEnvQb8P8yfQEJUm4Syi2r7s3i6erCnif3BJND5mFuoe5nt3bJRymoHqqKEMHAyl1dao4W7uLRdL2d1ZyKSXLT+L8RuunqA1XNinG9f+j2YzDxHskNJYI4f7dQs/5XWOVbzhl2N14fCwLrpk38SF2D8bWM0/Twn/iwK1tarzDJiGnmaXv13SXcxR37xWi+oMA9R+EZdyuJd1bYdbI4qjFAreLvh6hqLzrp0gsxktHjIGz9p5tE/D1iT0yqsY1a5/Ju8m+ypLe83HMpTA1OGk3pGZzlReY5rIwAPJkyacg8bv31vo+qvKU7UbpPmxZU0WZ9Pa+2AJB8vFfRIhJsHoT78MZEWBGHbCIHH/uq9G0+wpOc0+W6JD8Zi7Nm37+8tYsFjp9crlkAFop0FHcDYNffkLeR/Y0dS3/OWDSvf9VsNtznv778dFxS1G8mwm1HKh5jIBGoDs9c+wadkCuLkPJLU+1NRRWUzUD5/HUJH7kHtrPdfHzc2Vg2tGLi24LmCK2Ax6+6w5M9 14KQaF3V m7aMl7ymY5qtkJI5lUrouSOnFGeh6ryIl/u3PBD7rU5XcvjQh56SmG+a5P0RfblnJrWNKc5VLS21SK35CGBkcH+JSMzZADBLV+dU4lciArf/Bs//3QB6uV7YDS6Q0CLYII9zo7yHDwHJhXfNPHnuRAT8NmkvUw/yIyOpRc+QzvK6yLNF7Gc5zcT9LGH0EhyyKiwlfTsYvUcc7nB9P+eLWbsktJaqp+dJGYK8gapSiv6bf526TsHsHQiEA/zyHHPuz3tqpDrFl9Ca2n6/81G1+f1hxAstv5xmkqLYqMZ0JhomhehJyY6/dgxxIdqKzv2nh9EyXvq3OmyLGT6JcMXhJUthvwEAoq/ry5pkMqFauDjeXNy//OCvys6jEiQXigEr0bX7HeHCvyR+dtAuBOsmGsXCELVVHtey5Y7mnsCygmgdm225Y5StU1eg/H6mE2oU+wxj62argLUDjaGXKf7sXhSghzQCohLtmz/LCoxz3Cf5oliocCYPxjLO9m5JJnFaQ8SbMmamzb23pfQYWsk7OI5RSswH+VuB9Zp3U/+gvaYjFoWhutWbMEURvZw== 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: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 wrote: > > > > > > (Adding Paul & Shanker to Cc list.. please see below for why) > > > > > > > > > > > > Apologies on the late response, I was away and have been strugg= ling 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 duplicate da= ta and/or > > > > > > > > incorrect ranges to be returned to a reader during an updat= e. Although > > > > > > > > this has not been reported or seen, disable the append writ= e operation > > > > > > > > while the tree is in rcu mode out of an abundance of cautio= n. > > > > > > > > > > > > ... > > > > > > > > > > > > ... > > > > > > > > > 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 definitely > 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/? Note that there are (possibly different) issues seen on ppc32 and on arm32 (Renesas RZ/A in particular, but not on other Renesas ARM systems). I saw an issue on arm32 with cfeb6ae8bcb96ccf, but not with cfeb6ae8bcb96cc= f^. Other people saw an issue on ppc32 with both cfeb6ae8bcb96ccf and cfeb6ae8bcb96ccf^. 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