Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp247525lqs; Thu, 13 Jun 2024 09:02:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWh42k1UsSZ6y9WIe2M9UNunopjHhGkoUhpiQoFDd/5RaX5H+U6nde+frdE8SNABOegpKF0GTaz/9qrPB0/wQdnXCBNpaY6EcNyyg+p/A== X-Google-Smtp-Source: AGHT+IHW7QsKrVwVavgjyangVJjsPrkxYDRaYleJ++e8KSSeAXLZC6NxTkbancDBQ9S77lQvIvSL X-Received: by 2002:a17:907:9723:b0:a6f:58a6:fed8 with SMTP id a640c23a62f3a-a6f60d37df8mr18767766b.28.1718294525787; Thu, 13 Jun 2024 09:02:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718294525; cv=pass; d=google.com; s=arc-20160816; b=dUHhiqYRWfhQC4yvT+l53OL4VL6GFNH4afuhS6fGLSJmai/iGv2RRbA3ax/OzXVq8E /l35hdlDOT7ShvtD1D0dNj+UDCZ0l4CR3EcbJOo7snwivwOcr3i3gG76dTsImS8+j6cZ DqwzsWesyoPRrEbsCUHZ6ifneWE6sEdesO9Z3ULODWivKyqwPG8d/m/x+1VBz/FiLAra 5UWKmavpTutFWBhId/YBc5/76E1KbtV8T7wolh6PcLB/m6Lb57gKhoanaoQaTMurCuiV K5PbplJkJ5a8h/XYAUNLQodzq02+tWQ/Iba0RYXAw8rEq8QT9q78rV5qPfzkT5Iqnqkl 7Obg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=bMyBbJCraYwS5brTdEj0q8aTkLOVuU/Ab+cP6Azdquo=; fh=Sw5v7FvwBe2M9WB+NcgMlodt0MPurFzTw/uTn2UdxSU=; b=w7IQZlcYS1Z/hf1f6fQK3flO0/FtBLZk0XunCouD3k7ucB7BJ5K5WCQrtXrLbZngkZ h5RdXtAbhYJvBqMR5K9ABF1PRNaT36pAsZFWnFnsDnDeGEczP0Nuho2j2/aFQiyx8v1D sP1nB4qoFLZokr/ppA35FWjvodWeEdaaxy+DynVHgU+n1Z68HTCylccFtgzgDZKFtr65 XFXdVQeLDDhyGdNHnZ4oMAo3XW9cS80kw1nbXLoHu6zu2fZkNMrO6nBI82SVkpRlbel2 VNaoPDNTHt+GizcRe8buQ63lAkMCApoXVyVDiWU8D+YWYt0VUVpKebnh4KDT5lzRXSsi ufUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BWvGEL72; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56dd6b0csi81892366b.370.2024.06.13.09.02.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 09:02:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BWvGEL72; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 811361F24E28 for ; Thu, 13 Jun 2024 16:02:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1552412FB2D; Thu, 13 Jun 2024 16:01:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BWvGEL72" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 383FA12F5B8; Thu, 13 Jun 2024 16:01:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718294508; cv=none; b=eAzEvHYdeTMtJref3kyWY4h5ec2zET6pfegajit/+0n2rL0sqxN2bWfrKMRf1dWGJsMDWdE1OXyCwnO5J6AGfdx6Zh3cp8Ldr8KXrpReUm6StWY8Abde6FSEdKo7ElgmSjTo+SJLHYVYzQ6IJR0caCqOgp/dVueSeOvROC/Y8hY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718294508; c=relaxed/simple; bh=LKy2D6arl+GpL0o3xCQY76R9veCG4oWlZUUz2h91SqE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g5+NmHeK1RrokD8hOdsPWSPwJM6QuXkhvXeYOPikCwuTSgHit1889ywXr0r2SXjQJY+lCgqAiVzXhUmu9M+Hr3TBqBGDN1fTDrUrRyikSG2fuJIhsBDXfRWylG+LsnpH4L9ZRI0KA6t9xvQyDofU1LqPONkgCg12NnL+Oc4ibA4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BWvGEL72; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF1B1C2BBFC; Thu, 13 Jun 2024 16:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718294507; bh=LKy2D6arl+GpL0o3xCQY76R9veCG4oWlZUUz2h91SqE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=BWvGEL72ILqyPUF+a50b+MgblLneW9UZ4U+mwtAbphD3OOWIfcm8diwW/DyAGQRkT HsOf6n1lx2Wu0+5s+1mYY1lvtMPqImxjd7Tug6v/R2J3dYlrZZ+8uRmhVes/imJVUk i2LMzNDim98YcN8Vs8K4tb4cVb1E8N+sLWAjhH8aVM95ZI8rY9Tofc4A7fP08WmpNY q0s5RYjGBiSVbdRq8CLCYwVcIGSS54T144xFSLCQsxPRoxsUixbJcf3TxqMKy2099g JtNqYySXF+cBKKQRrgcUvDbESpqp3+MPjHATiyWTQg+DaeWpE6FhJcWxrJx+dsUJuN O6vxSMW6Lgraw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 54042CE04D4; Thu, 13 Jun 2024 09:01:47 -0700 (PDT) Date: Thu, 13 Jun 2024 09:01:47 -0700 From: "Paul E. McKenney" To: Keith Busch Cc: Nilay Shroff , l@kbusch-mbp.dhcp.thefacebook.com, Keith Busch , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, hch@lst.de, sagi@grimberg.me, davidgow@google.com, akpm@linux-foundation.org, venkat88@linux.vnet.ibm.com Subject: Re: [PATCH 1/2] list: introduce a new cutting helper Message-ID: <046f42c5-34b5-41a2-9680-5ef86ef25c01@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20240612155135.3060667-1-kbusch@meta.com> <31eb40f9-d68d-4348-b1fd-3cf057939297@paulmck-laptop> <73b994eb-c689-48e0-b09c-a414041a0525@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Jun 13, 2024 at 09:40:36AM -0600, Keith Busch wrote: > On Thu, Jun 13, 2024 at 08:15:06AM -0700, Paul E. McKenney wrote: > > On Thu, Jun 13, 2024 at 08:47:26AM -0600, Keith Busch wrote: > > > > > > > > Just make a helper function like this: > > > > > > > > static void my_synchronize_srcu(void) > > > > { > > > > synchronize_srcu(&my_srcu_struct); > > > > } > > > > > > > > Or am I missing something subtle here? > > > > > > That would work if we had a global srcu, but the intended usage > > > dynamically allocates one per device the driver is attached to, so a > > > void callback doesn't know which one to sync. > > > > Ah, good point! I suppose that a further suggestion to just JIT the > > needed function would not be well-received? ;-) > > > > I cannot resist suggesting placing a pointer to the srcu_struct in > > the task structure. /me runs... > > > > Perhaps somewhat more constructively, my usual question: Is it really > > necessary to have per-driver SRCU here? What would break if there was > > a global srcu_struct that applied to all drivers? > > There's not a strict need for srcu_struct to be per device that I know > of. It was just done this way to keep usage localized to the parts that > need to be protected. The fear being that one device's long running > reader could prevent another device from quickly tearing down. That is a legitimate concern. Is there a way to avoid this issue by making this be a statement parameter to a macro? Thanx, Paul