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 8A562EE14D3 for ; Wed, 6 Sep 2023 19:06:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B1B0E8D0007; Wed, 6 Sep 2023 15:06:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACB498D0005; Wed, 6 Sep 2023 15:06:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 994058D0007; Wed, 6 Sep 2023 15:06:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 880388D0005 for ; Wed, 6 Sep 2023 15:06:39 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 609F5B4227 for ; Wed, 6 Sep 2023 19:06:39 +0000 (UTC) X-FDA: 81207104118.30.52ED99C Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) by imf08.hostedemail.com (Postfix) with ESMTP id 29365160035 for ; Wed, 6 Sep 2023 19:06:36 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of geert.uytterhoeven@gmail.com designates 209.85.128.182 as permitted sender) smtp.mailfrom=geert.uytterhoeven@gmail.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694027197; 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=Hr7cLgUZCclofomOdxpQVhNfG1jKUPi2HnqwisL8720=; b=Txtp/pelSyAvFl473iU+yJyHt+S2i0IdMYgiVZVqzWix/xPicBT7hpdXEZhraelbnKJm/H g9u/XjbrY/D0da/fSvPwhNg8oYx0zI+SzKCpjqfw087COk4qhQL6+JhCMcOyZKsv/uS1mx /r+kRjkgjnhx81qLarkpUu5yHz44UXU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694027197; a=rsa-sha256; cv=none; b=RbZyx1/SBcY9lMTYvXJjq4+SXlHUp7ivxy3pYfGrnsoUxNI+j6/Ghjojz8E2AbRmmMwfNx Wfs6XkirPlEdu/6CutEcp+mRp7vyTL9FbxrkkrlShfaLAoSigp4vm/U3SKd7AcPSRmTWn6 fnLV8I9cMX61Yh0uBN9lfMYQxJV0au4= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of geert.uytterhoeven@gmail.com designates 209.85.128.182 as permitted sender) smtp.mailfrom=geert.uytterhoeven@gmail.com; dmarc=none Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-59288c68eb8so2036387b3.0 for ; Wed, 06 Sep 2023 12:06:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694027196; x=1694631996; 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=Hr7cLgUZCclofomOdxpQVhNfG1jKUPi2HnqwisL8720=; b=Behfl/rcpzybjZMOZTNzAxro9oAWaipEqsVQi+dDf8i92ldPyEpUbx24wgb5wFh4k2 DEvz8bNMjJC+LgyWtcFRG/NlpMPLU9DiVqAwB9twirtO0IQZkLW8sU7bjuzoTB+gZPbs nsKWhWUwEqqeR6Dp6S9YehgSA7i2+4e/WaYv/BWmu/nyObf6NKy6A8wCrsaUPPmbHhXn 4MxVJmsY6jMmJvHc7pcS8xZ4sLy2ijUB8SQnhCSqL+Ug7i07+bbyGqoE0Br3X9xBJLk1 qhwW6iUYxT3xSANakrf5l12YT7bCJu40R5wriCBewl5ztwPoxnRwF9/5QSFfD/ncWprr CxYg== X-Gm-Message-State: AOJu0YxJKxXWSb6UDNwasbWJvBHeJaj2Rnyu2iG1Ld5GB9/161zeVzrh +hWklYSiAiAvuOmSoFbNUuRVQbAaAA0Dhg== X-Google-Smtp-Source: AGHT+IFHWNQ+ezJ7xjcVE+wWXhTegjVUr2UymNG/T4fDsLumatUW5cNjeH+rRad3MEce+0g15hC8vg== X-Received: by 2002:a0d:f404:0:b0:589:d617:e7c4 with SMTP id d4-20020a0df404000000b00589d617e7c4mr17619922ywf.16.1694027195966; Wed, 06 Sep 2023 12:06:35 -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 t76-20020a81834f000000b00592a0cad26esm3879091ywf.26.2023.09.06.12.06.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Sep 2023 12:06:35 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-d7d50ba994eso170692276.1 for ; Wed, 06 Sep 2023 12:06:34 -0700 (PDT) X-Received: by 2002:a25:7691:0:b0:d6b:8ea4:b8a1 with SMTP id r139-20020a257691000000b00d6b8ea4b8a1mr18126841ybc.12.1694027194758; Wed, 06 Sep 2023 12:06:34 -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> In-Reply-To: <20230906152325.dblzauybyoq5kd35@revolver> From: Geert Uytterhoeven Date: Wed, 6 Sep 2023 21:06:22 +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: "Liam R. Howlett" Cc: 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 , "Paul E. McKenney" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: y18jrhfhh9p3jy5hd18jyug9p4deqzff X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 29365160035 X-Rspam-User: X-HE-Tag: 1694027196-157527 X-HE-Meta: U2FsdGVkX1+xJuVWPBlAsF3kAsLhV5IRe4fRhbObH/1cUwdbQZxZHQEE9Z8TVH3zmy79xcsBppJjEZz5C9SP8LQB4HvouZFynWHL49M4jpeN9Zx+WbAJmTNTrtgUQvYKWbFbhb9QkHXjEE5pQK/IIRvkZsG1EuwV5Bv77i2a5K0XMVL8GKmFbg/3hZ9AE9UhYREeklw+trzBc+Oou+xK66L2K+hApiFP99ZLaHWgSPv70trSMrJ3z+bpJW/mexKHyHkAQiOlM3MFDjtfxczSHNfiENomyBLdkgFGzBvpELL+y6ibP0QrolNNDbpbUwdxSg/gXe5prgZDW/+MQYk6wwCxebgLRJlBTAwEvI7h1x7r9DdzIP9XXkgZl8ZNuoXgqEDIqDf6krTKLxUglHKx3yPdvgtcPC9RmO/ymYhY7bue4P/j50V/ADXrianfM1rFGG7R43rgBKbY9t6HpWtiPSIq8Ss/FWDr5qEwpwn2KxmfyqRkes6Dmulzdbc8E/16ELGVBMTHbby7OPZJhOy/I8Y0g9s8Jaglqdk1iWU5KGXp6t/XLbSmyp+FCr56S8HjZIputiA4Q46u1UhOEdn2C+F3J9xRdfDy6DBgluHcrgOD+Jl8oBdh+lT5Py5ULXff2GNrvngo5e40UzZyfBJ9bjZH3zboV3P0kml8KE63feQVI30RU3cmDWFvYwU01OMMX7bQINb0z2XIeDjB4Jb3mdzohEZAQomXldZJjKfKiCQJRCHioi3I1BzJBUGlHv7T1XncAAV5jEQhpw7cAh+mptaktnzcHoW8zg3qykix8eibx1T8pQJc6ZW+w5bvm44b4qfFO7sohl0djqdTY2KSHgRwT0GMqRV9KtACaZT8jF4lKBMeLwcGBPfLnNG8k6sHRBBmiZuvjjM1csu/6XVCjHq1iTYuAZZJ2MGzzAYN4nwK55RCMFJ+sFFrGrZQpLfv5bZ0FUXDFRps30BGWlt yA/4Ir81 q1zS7cKG3rAfMChKgCYkb5rUFgevg882cwEcc4a8yc1BXfRLIZ5e2ceTgWDA5AV3S1b0Ekeh6kVsIDGjpCaCbyLsGkHF82OL+hgYWVD199r1vidqwej10HKDCOgdZu9OreYT1IP4rbTSXUsORQvOVA8jgcSN5KYRj1K9+U9ozC6RxB0hLhlk2O1qYjnTeVljouogVHX/c0JJJKZ6ZekayBSZkiy6YcINjNShYlUuxnGpZf2JZg0IOytj4+zyiuJyqisz+1c2ScFsU2EKxdBFHr3NuxvA25SUr83BedKn/ALyCAO9Oi0MgV3AlPkFsJyIBhSv/ecQE1w6H8H34z2nVzA6KRJDnGqa/+BZSl3Yk+qi7ZNcF2p9QHShoiUzJBu/g2r1rw4oFd9Tav45jqZj9JmkF0RtyfgzVR0hBT5OhoQMOvZg5+ovHoD9Dndhb6e2V5BXRTZROcCK2/qRYu+QXVt06mkh7RosrOfIH0lTaGIC1LCFjOV9dTVxiRLKT9A61DkoX+nybC7G74rFQe9lv5WqF57tz+pq5g0s4z7O3glnCXBQJu9mtK5OPTw== 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 Liam, On Wed, Sep 6, 2023 at 5:24=E2=80=AFPM Liam R. Howlett wrote: > * Geert Uytterhoeven [230829 12:42]: > > On Fri, 18 Aug 2023, Liam R. Howlett wrote: > > > The current implementation of append may cause duplicate data and/or > > > incorrect ranges to be returned to a reader during an update. Althou= gh > > > this has not been reported or seen, disable the append write operatio= n > > > while the tree is in rcu mode out of an abundance of caution. > > ... > > > > > > Fixes: 54a611b60590 ("Maple Tree: add new data structure") > > > Cc: stable@vger.kernel.org > > > Signed-off-by: Liam R. Howlett > > > > Thanks for your patch, which is now commit cfeb6ae8bcb96ccf > > ("maple_tree: disable mas_wr_append() when other readers are > > possible") in v6.5, and is being backported to stable. > > > > On Renesas RZ/A1 and RZ/A2 (single-core Cortex-A9), this causes the > > following warning: > > > > clocksource: timer@e803b000: mask: 0xffffffff max_cycles: 0xffffff= ff, max_idle_ns: 28958491609 ns > > sched_clock: 32 bits at 66MHz, resolution 15ns, wraps every 325376= 31224ns > > /soc/timer@e803b000: used for clocksource > > /soc/timer@e803c000: used for clock events > > +------------[ cut here ]------------ > > +WARNING: CPU: 0 PID: 0 at init/main.c:992 start_kernel+0x2f0/0x480 > > +Interrupts were enabled early > > Note that the maple tree is involved in tracking the interrupts, see > kernel/irq/irqdesc.c irq_insert_desc(), etc. > > > +CPU: 0 PID: 0 Comm: swapper Not tainted 6.5.0-rza2mevb-10197-g99b8= 0d6b92b5 #237 > > I cannot find commit id 99b80d6b92b5. That's my local tree, based on renesas-drivers-2023-08-29-v6.5. > > > +Hardware name: Generic R7S9210 (Flattened Device Tree) > > + unwind_backtrace from show_stack+0x10/0x14 > > + show_stack from dump_stack_lvl+0x24/0x3c > > + dump_stack_lvl from __warn+0x74/0xb8 > > + __warn from warn_slowpath_fmt+0x78/0xb0 > > + warn_slowpath_fmt from start_kernel+0x2f0/0x480 > > + start_kernel from 0x0 > > +---[ end trace 0000000000000000 ]--- > > Console: colour dummy device 80x30 > > printk: console [tty0] enabled > > Calibrating delay loop (skipped) preset value.. 1056.00 BogoMIPS (= lpj=3D5280000) > > > > Reverting this commit fixes the issue. > > I have set up testing with qemu for powerpc 32b, and reverting this > patch does not fix it for me. Did you revert the patch or bisect to the > issue? I did bisect the issue (on RZ/A) to cfeb6ae8bcb96ccf. Reverting that commit on top of my local tree fixed the issue. > It also happens on 0e0e9bd5f7b9 (I ran git checkout cfeb6ae8bcb96ccf^ to > get the commit immediately before cfeb6ae8bcb96ccf). That is not the case on Renesas RZ/A (which is arm32). 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