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 A3953CA0ECF for ; Tue, 12 Sep 2023 08:30:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 399D86B00CE; Tue, 12 Sep 2023 04:30:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 349CD6B00D1; Tue, 12 Sep 2023 04:30:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 211806B00D2; Tue, 12 Sep 2023 04:30:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0C21A6B00CE for ; Tue, 12 Sep 2023 04:30:11 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C97B7B3F89 for ; Tue, 12 Sep 2023 08:30:10 +0000 (UTC) X-FDA: 81227272980.20.738DCFB Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id EC453C000E for ; Tue, 12 Sep 2023 08:30:08 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UyZPN0b+; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of "SRS0=rctY=E4=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=rctY=E4=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694507409; h=from:from:sender:reply-to: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=0OeyW32ZbcAa8bL4QbaGnz8AT8JlNRZH+lY5ada0ibg=; b=abgnz1XXI+dmpv7hZUQt9FOXJRmvRdN64F7UrqsDbDzQ2prqfTGT0Dq2L6IEb7+/lZ2fbT AmmUt14PqKEF7yySoE9FMdSEP6S5KXz/8sel1FRi10r/W3b6K0RgkSBrRK90xXq+jvinob MBLnl62I8Ud1dUaOxrmBXsCfa/0gJlk= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UyZPN0b+; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of "SRS0=rctY=E4=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=rctY=E4=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694507409; a=rsa-sha256; cv=none; b=4S6d8Po8v73nSBQNLCFCGgbJUhABi26UG4wjOouSwHJQzMgF69KRAxbavZGPPoOXu17/B1 oo50nSP0a9rvJMu78UzxuKRH51tBJ21GULiyR83tAmRkzaDJA4Iv/w/3Hq4jvPqHAO/GPH vcIncGExP34p0Z3cwrxGFUCYgHdikFk= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E95A4615E8; Tue, 12 Sep 2023 08:30:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C832C433CA; Tue, 12 Sep 2023 08:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694507407; bh=QQYwp3XazbIjORrq6ZGSJLrdEA/lnRZIf7JA2RHvWA4=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=UyZPN0b+Xsg2KIpknTrqItF1NIzVHtlSIpLt4FY9hjbGXSQG7SbWQ4YeU8n2dWEyG ZiDhrf2rWkigShL4SF31UICLhXmtVnKx42jNMQX32T2ogjqjWil3QOdfdmxyiK1B6Q FupNdTVEMk0mCWgy583R6r77vKqzffHHNsEVnm0sI0xVbJCSgKXTPz7F5Q1+El+EMr 4ax3DU/1nAXu2LYwq9Q7AgwCfJ6F17ZSlLySEVgJ8edaj/Ewq9pjihmw7JE69k+Bd/ T+kZdgBpXKB2fCLWoxcBafqEBdaZDSBy4E+tGM6+gc8VPRRw1v+qNY1a8hs6m6bJa0 lfCSvdAZAkh1Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E07BBCE093C; Tue, 12 Sep 2023 01:30:06 -0700 (PDT) Date: Tue, 12 Sep 2023 01:30:06 -0700 From: "Paul E. McKenney" To: Geert Uytterhoeven 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 Subject: Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other readers are possible Message-ID: Reply-To: paulmck@kernel.org 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: EC453C000E X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: cowhp8d534z98aui5mp3579u7babetw4 X-HE-Tag: 1694507408-124752 X-HE-Meta: U2FsdGVkX19YT3RhBHYo8EH0oD5qZGqztF67IP/wZ0162XAWSrj2yiZnpMQIbzZmj1H1TyG7UI2AJ6vy+20jXE/e5nWGQ1uGpFNuaBZOBBLsug82hwT0D62/yJDACBK6qdADVCvioqX5lQnBftbIv3kCcyfhQL1caS0zwfPnGGfE6nQxmrLF5KQwK5cip0KoBJ0lgfovJfxuUQHOqAHgtrW1uGTHZaiCdCOs9nO/kQVXj9NhSzzkk+/d8eEFHR4wP2KuzamFXSk946NzIRtXL+kw2JSSiEOyChz81D8uvyvBQhlo7WH3hzGZNUGRHRuSmKdBtLHDxGTv5BLXpEu5A3fTgqcUSLyFiGQn7QoGb3Bo6U7dGdqQb8A0z+aQOhZnDlhh7rNrZDJr7BkKlwsqjfy+pCJWg/Cpkk980A40sT4jThoHML6RU2C+dHRB2o21N+EPW87U7bJyb3Vs057lS+vaoR3oGN44TrVfcpELTySGuvtChnJXgNEHj/4C8r/jmm4g1Y4QUw1XboohhFCKPrgy02575WzbLhynCj5TzJ8+tf0KzsNnRE2hEvnuJeLiEUZpcSkkl3ufgcpHhD1lJaxDmLG1hHFBKaFW1/8T6R6y06XwXAnuzfXeTQdpvlgkoBmQP/y+bgGLug8I/HEW+59NO4DZuuyhss2O0PMuBxWlbiN3TK3p0V2Dm8ddtwjRzGtGdAMF3Vd/+vYAMH8yoZv9nqw2bwcYSdx/XkhoaDe3G5EvGyJC2it1cW3OmuhpR73ajuhahV6eUs6pJYnQ8i/+IMk1UsBdMMM2PXXLou+CuietJrlVbNNFKMIQRDTZy1A8ribn3bBN8XroCq9m8S1H44/o/jQG+qDLt8l5ILp12qAjbtTTEpol6BCdEmDB6Ys4ZyvWTCMluY6yKosEM9OSNG7gPiLVwBWVLr7rOHTLUjN8s4wxYgk8VmlZ/zFtL2lD6b10avwbUEZNYf+ tgwoSru9 VoUypMUd4YyCfeQl409h5f/zFZE4uCXUkrymLG2SfrP8gl56wZShPr0INto+skijUS5TmNVdhdiKCQ7c/4TJKx9ArBjXu9xzq5sgJkL02KWtfl4Y/fJb4oZHlQkrWW4lS3BSuajgF/2RqkVbGfagKVzwJawpvH9KY6jvXLwOyYQuqFyFx6JlbgZ7rNzGBqazEuBfmsDGVfDsCqTomSvd5SaRo/xbx7O6Z5zRRSBhxic7/oPsyQKseDqYhdJ+DkAPRFlpoijBD8NWFOYlQbl5f+NnMh+pYXYKtiI3RQ89/coBoeQxJBia+LLS/MNwm/0Xe3tls7JpVpHxC2YxwtdfPuXqgT3arKdObXZb4TelaL1UQ38EOJafnqBcLOrMBfocZwkaLvfIvTa5lvVftpShoB/Sd+jRHedxNgkyf13jYpgPZr/7tQHiFe662XLH7yifMlPNUAU9cASi9NuGUPyCKRYpNV2W41NDSx+JUNb8GeZMS8ZMqkYhrnbl2FcfC+dO5KoEAyI8GSh8Dc9guukwGwu2IZxEgwTetioMp3Q67mj6x4VvD6OHpp+To6bzm4/9e7rP6slq6opuSG/QEg+cNtQRCRD1PQ9DcW2dRN3vIvk2P+tt6SVxyfWt5wYuM26ygNjNQKq2FMF5DQkut4Mo56aI3rjoY5HW6+G/Dii5zzaRt3NoVTarMAbcxXq4pTCkM0XMt55xHyFTIDQHkxypoAx9LlGPoWS0Ydpdi5DShE/XAfZGcIyLmR/3JD/9DU9A+aADqHJ8SRFQ9kmG4OtJPM8kdzCu+x1tSdjTv1/tvnEXWVj8= 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: On Tue, Sep 12, 2023 at 10:23:37AM +0200, Geert Uytterhoeven wrote: > 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/? Glad it is not just me, given that I didn't see a direct call, either. So 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. ;-) > 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^. I look forward to hearing what is the issue in both cases. Thanx, Paul > 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