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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2EB0CDB481 for ; Wed, 24 Jun 2026 13:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z2iAFOHBRMR/Xa17pT7sXAqMACpdvIbkzmpfw9EGJVs=; b=hIn70LgjB723UNH3cvehzEhUoU oVcWMgHiV0jJDmdWvLnrFWe939nHUZtcEm7P7AVsDBgv/Fzja+VVFER4mCFquK3OfAps9IxxAAgXa qap9AecBkIxuN4MPu1D7dqjSdlnbmLYBPVXb3yvNpd5KErCjzD9vK8vADfvAUf1+pelBQGjtD6/3F HYEXA9ZGt2URZgku/uzpJ+iQjyyLdsZNgGFggUYriNOHVPT7iPteu8D6jocux1zOQINNc3czcM/+D 6RZgoQ2NXdhKUz2o0YaZtOs4nstDOKu/DV329Km0y9vqJRCdkzc74BaqOpYZtHH29Gra3X2ztNtIK SlW3NsNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wcNIp-00000007nYe-2RpD; Wed, 24 Jun 2026 13:06:03 +0000 Received: from out-182.mta0.migadu.com ([91.218.175.182]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wcNIm-00000007nY8-2Ngn for kexec@lists.infradead.org; Wed, 24 Jun 2026 13:06:02 +0000 Message-ID: <96334e07-dbd9-47a0-93f5-ac4762b7b919@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782306356; h=from:from: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=Z2iAFOHBRMR/Xa17pT7sXAqMACpdvIbkzmpfw9EGJVs=; b=t7N5AMoP0/i8dFY3FrC7HO2yNmLfeZFETlWYqXUODrlmNpqyaftZywjo0y9UNn13O8QGRa AXb39zIwwMhdHGGwdLIWZOxZlc/RB5gme76K1wm+eYFw8s2/p0wLK8vNz3AEO2CElTbLsC uEFuGXWFUWXMM2nzKZ+r26KvGnuXTwQ= Date: Wed, 24 Jun 2026 21:05:32 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v3 0/7] Prepare mutable list iterators to cache cursor state To: Jani Nikula , Andrew Morton , David Hildenbrand , Jens Axboe , Tejun Heo , Alexander Viro , Christian Brauner , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Johannes Weiner , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Thomas Gleixner , Juri Lelli , Vincent Guittot , Paul Moore , Andy Shevchenko , "Paul E. McKenney" , Shakeel Butt , =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: David Howells , Simona Vetter , Randy Dunlap , Luca Ceresoli , Philipp Stanner , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, audit@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-perf-users@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kexec@lists.infradead.org, live-patching@vger.kernel.org, linux-modules@vger.kernel.org, linux-crypto@vger.kernel.org, linux-pm@vger.kernel.org, rcu@vger.kernel.org, sched-ext@lists.linux.dev, linux-mm@kvack.org, virtualization@lists.linux.dev, damon@lists.linux.dev, llvm@lists.linux.dev, chengkaitao References: <20260622040533.29824-1-kaitao.cheng@linux.dev> <88f34c7fa5a3d1700cc8005818751d6aa31f09df@intel.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kaitao Cheng In-Reply-To: <88f34c7fa5a3d1700cc8005818751d6aa31f09df@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260624_060601_023774_B984EEBD X-CRM114-Status: GOOD ( 13.91 ) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org 在 2026/6/22 16:37, Jani Nikula 写道: > On Mon, 22 Jun 2026, Kaitao Cheng wrote: >> Add *_mutable() iterator variants for list, hlist and llist. The new >> helpers are variadic and support both forms. In the common case, the >> caller omits the temporary cursor and the macro creates a unique internal >> cursor with typeof(pos) and __UNIQUE_ID(). If a loop really needs an >> explicit temporary cursor, the caller can still pass it and the helper >> keeps the existing *_safe() behaviour. >> >> For example, a call site may use the shorter form: >> >> list_for_each_entry_mutable(pos, head, member) >> >> or keep the explicit temporary cursor form: >> >> list_for_each_entry_mutable(pos, tmp, head, member) > > I'm unconvinced it's a good idea to allow two forms with macro trickery, > *especially* when it's not the last argument you can omit. I think it's > a footgun. > > IMO stick with the first form only, and there'll always be the _safe > variant that can be used when the temp pointer is needed. Could we go back to the v1 version? What do you think of that implementation approach? https://lore.kernel.org/all/20260529082149.76764-1-kaitao.cheng@linux.dev/ -- Thanks Kaitao Cheng