Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2438149rdb; Tue, 12 Sep 2023 01:36:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWeeSu72F17/U94zE9ScX1qwZN93IIAl8b44e8DzIxCt+TkccgohKQW5geguYdmv2PisW5 X-Received: by 2002:a05:6808:3094:b0:3ab:7adb:7b35 with SMTP id bl20-20020a056808309400b003ab7adb7b35mr13093675oib.50.1694507789602; Tue, 12 Sep 2023 01:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694507789; cv=none; d=google.com; s=arc-20160816; b=nCigLDw6QTGmVnyzpmi/P+ZRIUhgXCpFsh+cKRytTUtPdQQ3z05rz1C7GZ45BUcjSu 8LH/072lqvxnNSXeIATLXbWWJ6qTFlrhoONd792h6QbJlbH4vnHdpNpDeOj3Cjm/BKgp XbGzpykGi2yFKUzxmBqMfk9xxNUNBD+CTcYJaNiDWZ2ruVckmk076kgewsTvpvkmKShp WEbzyIt0sW08ZyXvaQZ5G5ESfVZWJctSQU/FyA91q0oKQBsIajvyfjLe64DaP9fRrP4o 1nVGPS+AVYyzeD/noFEekYuS5VnVnycMUxav4+FWCBORb2BKWahuOj4Tgj0cuIArBdDM l1AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=VwNgVj6lyUp/LzpHYZJfsPoK1RxcQztT9ff3FRipHKM=; fh=xShwuOmgx2emNVvxy5j2EbfQuNdrMga5bzfrs83odyU=; b=G7nsna1q9xPSQIU9BMd4aY0SqezXfih/B+zqjYpJXOIPBw3vd1qNADuSmD45t6DA+l 0JPhyUR/oRUd11V1O9OR905wttt+ryiy1ri16zK6rjd2CBqRWvYKRSD7TBJRFNmSVP5Z 38A2Rv15uHR38xwQQkKJZ3HDd2u4VWBJ7aF1rVbHzQtdcXT7kD70XnYWoU3HYVKLguTp gcnRr5Mj5QJt1xz4VZpCQumymDFWGOTYLeC7jxEqtLXCBcZ+ptnA7+JbVn1bTu0KuJI8 ylB0RObYEY9KvNRDWUA7CVBToWe+IjRpC3dtxzciWoYqS2y3vmMjZ07JglYSCrYuU2wE HJjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g190-20020a636bc7000000b00577a519621bsi904782pgc.231.2023.09.12.01.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C216383AB367; Tue, 12 Sep 2023 01:24:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232488AbjILIYA convert rfc822-to-8bit (ORCPT + 99 others); Tue, 12 Sep 2023 04:24:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232532AbjILIXy (ORCPT ); Tue, 12 Sep 2023 04:23:54 -0400 Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DED410D2; Tue, 12 Sep 2023 01:23:50 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-ccc462deca6so4763162276.0; 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=V1fLdHqEQw+6b64FQ11TsQ4iYdId2L8yJKVKJBEUwIL7HpPMKThDLzk33bo7UNH26q AdMjGQTxyR4IAbTKpbN5C55wAY88RiAFniU6wI0XjI9hlNfyz7RNyx4HWPo1gmfzvEXu bcVDOaHUC8x9+fm32P9hhNckp1B32R8B4S0EjMwOs/bNWRGupNGWcCzmDHtW+KZuVEw0 dHnya/a1HqMLWDS1AI6Wo6xlp3/ASNrFZiJbsVLHErzbms9UlQYfIdC9pM/TWsWdOLAX 8WlOKhqNasoKVqEq0QKYk8AX8Po84yujQkGWO3lkJSVxwXkYf+0PxocuzCbGJH3ZkJyf vHQA== X-Gm-Message-State: AOJu0YxSaMf3nmcr7LCWgLNpaDJsIYU0Hu/P2+vxiYLfr+nGfmn89aK/ L/T+pTHJbpJZxoo7zAz/cov5gL9a0TzjHg== X-Received: by 2002:a25:5058:0:b0:d7b:9d44:7574 with SMTP id e85-20020a255058000000b00d7b9d447574mr11070117ybb.64.1694507029333; Tue, 12 Sep 2023 01:23:49 -0700 (PDT) Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com. [209.85.219.172]) by smtp.gmail.com with ESMTPSA id n197-20020a2540ce000000b00d780f43b66dsm2078997yba.63.2023.09.12.01.23.48 (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-f172.google.com with SMTP id 3f1490d57ef6-ccc462deca6so4763146276.0; 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: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Sep 2023 01:24:01 -0700 (PDT) Hi Paul, On Tue, Sep 12, 2023 at 10:14 AM 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 struggling 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 data and/or > > > > > > > > incorrect ranges to be returned to a reader during an update. 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 caution. > > > > > > > > > > > > ... > > > > > > > > > > > > ... > > > > > > > > > RCU-related configs: > > > > > > > > > > > > > > $ grep RCU .config > > > > > > > # RCU Subsystem > > > > > > > CONFIG_TINY_RCU=y > > 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 cfeb6ae8bcb96ccf^. Other people saw an issue on ppc32 with both cfeb6ae8bcb96ccf and cfeb6ae8bcb96ccf^. Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds