Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp124672lqs; Thu, 13 Jun 2024 06:00:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBDS8sXv6qMmtJ+8iPHUlMD9bvVfKxYXnZX37pqFtNF6Y59uv3qkmsBlmr7SE86Sw4J9RQMPYJLcdoW0jDHuJ9Gp6aib+v4+qfP4zc8A== X-Google-Smtp-Source: AGHT+IE2zR2pPU7Ygf0vJPfpD5UV8ZvXDetZTROtJQuLT1NHvoSccDf5NOuqcRxBKB1ZfZfjjrHb X-Received: by 2002:a05:6214:5c4a:b0:6b0:8e1d:f71a with SMTP id 6a1803df08f44-6b1a731b496mr41445976d6.50.1718283651366; Thu, 13 Jun 2024 06:00:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718283651; cv=pass; d=google.com; s=arc-20160816; b=rP8NSnkW4qsIA3Ss3f9HlsabKLhacc8HxoYfMFur/jF7qYaQT/RtEV38BU/QbOpEyF XrO883KZ/ysojKfz8ihddYomcPwODVzk3O2yyOyqkR07f+oRHHvtoq47yESRM5zJag/M krdb/4DsWk+V3C9f90cozMQ+kkrJAsu+HGUKhjDe3s1ONgqRL4HmunQNxFdZTEzygFzM cByeAx3UwsKSeJxLWofXlDupdG5c0BR7T7P72Vr2jJZVmpTg+ZgHJito7Shbtet0UeeA 1XSsk/p22IE8zOxI1F+cU7D4AMD3tQ6UPyMSN3LkOChzxNLdd1vIhyiMz3dTjuyjRNp6 2TzA== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=k2H5kMSGXAcXtZKV+rbK+tIg7d2r+evwWQcLbezoGwA=; fh=3tnLdQxE3acX3jdDzmCYPbWqVD30YCiLeaNJDDQ8d5k=; b=KHypSvy3TV8GdcjQ7goeZhaY/YoBPjhqwRIG6kfk11u6ueZfG2dWw9aMgm7FulsLkp rBmwhhG4mCLGaZr+jo1OroeTlYsEPOpSSkEVniUVJvJkT0F6LRGlyfQ14MUokX/CiChl bBCdMuBCK1+/t7MBgKRqZ8GmRcQgR1Cq4K0pEy6ohnEyp1qfaXZ9addgxNx/YLq17+Mv sImI7QJ+S2yJco5cVrbPuVxqrYSKqRhF/s3w+E+fA1MF2i+qYhkYDKFiWFlSGxnQiJv0 wMhquuPoNAsP0OgJrcH2/lM/CiXPvQ6lh94n9UGYklhr/FHxg2PayoG5U3105KSsyi7B R7cA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qggwRUUL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2acb8c727si3606536d6.429.2024.06.13.06.00.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 06:00:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qggwRUUL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213247-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 191571C21C88 for ; Thu, 13 Jun 2024 13:00:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7096143868; Thu, 13 Jun 2024 13:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qggwRUUL" 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 C6ED22AF15; Thu, 13 Jun 2024 13:00:42 +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=1718283642; cv=none; b=R+Xx+T8d1n5z/yaXFZvZsrOjAMQPY/CyScJuUzV6ODNecIlxfAufPCgoZ0ecQCaTll6RpefhzjZh3fV+eiKgA73trV1lzM+XZ0L+5dW7RPt7E2G84iHlolXkY5faqb1wFbQoms52A+9lYbTUMOroxHbUNHn8dm8D2rXyyHlMpEQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718283642; c=relaxed/simple; bh=J+FOEDQ8EizaWwa5B+nADOYSJHbx/xeNUz9hDlllVAA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dPhsB9DmoOq9kRjehwg/Rt6+B7nRjeGgcBhZVc/uHb/I7h/iAb/dwyft/MeUjuCEvd1COmI5ETOymQ5f73Ci9rLlaXEwqShnuxTl+Fqtqyns6ik330OpPXX3cVIiAkN5NRSRnCv4FNRu3TBH+t/8jioYZL3NWOjs2DCLZvLKMSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qggwRUUL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEB77C2BBFC; Thu, 13 Jun 2024 13:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718283642; bh=J+FOEDQ8EizaWwa5B+nADOYSJHbx/xeNUz9hDlllVAA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qggwRUULEqiXxuZ7j5UvKifzy33DHtdZrKO56gBNXhQgLtA73AndYpzFdFKPtgajQ eZ2FrWkaHiyu1CdoFUoJoAYYrvE/N2+CUEp/qa3f0Af+VlZQyOvYOKG67D0tjcqo0x 3EW1/WldLUz1c60Qlz/5z2q1SN7/pTXJ3oF6Xdw9Bd3BKzB0X/HP6kxPWzRVlb+7z4 9mbcbdJWED1dzELNE6rA9JFZltzNE25ja+CDOS0rLms/EmFDwbgjCb9OqLuY02UOac Ml+wL3j/PPtPYrIAHbcgznafOfDKP/T+JvE6NY0UA7S9SC3cj2JEtsBYFk0OTfG0WS sRAQ05C8tc5Xg== Date: Thu, 13 Jun 2024 07:00:40 -0600 From: Keith Busch To: Christoph Hellwig Cc: Nilay Shroff , Keith Busch , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, sagi@grimberg.me, paulmck@kernel.org, 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: References: <20240612155135.3060667-1-kbusch@meta.com> <20240613081016.GA21500@lst.de> 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: <20240613081016.GA21500@lst.de> On Thu, Jun 13, 2024 at 10:10:16AM +0200, Christoph Hellwig wrote: > On Thu, Jun 13, 2024 at 10:26:11AM +0530, Nilay Shroff wrote: > > I am wondering whether we really need the _rcu version of list_cut here? > > I think that @head could point to an _rcu protected list and that's true > > for this patch. So there might be concurrent readers accessing @head using > > _rcu list-traversal primitives, such as list_for_each_entry_rcu(). > > Yes, I can't see how this works for a RCU lists without very careful > memory ordering. > > Btw, another thing - the old vs new list ordering is reversed vs > list_splice*, which is a bit confusing (as are the parameter names > both for list_splice* and this new helper). Can you switch them > around to match? The parameters follow the existing conventions from list_cut_back and list_cut_position. Those functions cut off from the head to the "entry", and this one cuts off the "entry" to the tail instead.