From patchwork Fri Sep 22 08:12:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 143364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:a55:b0:13f:353d:d1ed with SMTP id 21csp4571641rwb; Fri, 22 Sep 2023 04:07:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnrEUhcHnZ/1lxKDKD1EEZ7JNawT9Sd47lLkv2mBFu4k8662WYHMgHhK9ytptoIReYxcel X-Received: by 2002:a05:6602:4182:b0:79f:9eb4:3ea1 with SMTP id bx2-20020a056602418200b0079f9eb43ea1mr1526864iob.3.1695380838626; Fri, 22 Sep 2023 04:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695380838; cv=none; d=google.com; s=arc-20160816; b=PegSwxMtxX7ZvGKKaNlzFFYFe5vo4LfVQVj7v7vUhSGC1y+p44+dRHSFWEQGUYDhGD 8PSjWIe2Vvel9ciIpqLyuPtdGFG/ZRFesXWRdO3M9J883jHQ7Mp+B5suF+SDVOsmRZvj h3PlCdZBfKw4oaly+dlTsJCfg2sNRSI1OYhIdB26rbRN3k5vtq5+Y7aV2BURVRx2P59T Nnm7pKOImdaH+o693BetXek5adV3G0+tnNHRDbtNbYOQ9cR9X1dFfh+xbi5NpAv1JI4T r8IulCY4TWB9Zewd/rj20GoQbvOfGalUIurMM3yuP8J0PlO0gTP7RBBE54I9WA/5a2mC WAFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=zIjjyICu9jgMK43t3DhKBMd6B4Guoddzcy+mtiYR0/4=; fh=pjTKlRr6OaFt7mHBfa0j1YfribakEwSEg6kPzBg+Jss=; b=jCPk9sYNOKSvoPVFAJMCluj2DIfYtgzdWBHONYe3cje4zRc9ZMISvre65wTrJqVC3e aTvwBMAYOeLiikMhs14ilXqfAmpkMeh+zx4/+FbXJUvXpM/cV7HqhQV/XgywROhayowd kekH1SMcLZ98/9eCZY0KXNpZM9AnOJW9oOjjETLcfFY+wzNV7CnIlE2o1l9EOAifydsd axHA9CPKgiXBj4HtrlwXrgToVKYgm63osVOPwLjQiBovYDWFKj6JVxT3tKcjosIBqbyX qgloltTpLbph5V8W6I4E+r1CCqjJBj/HYARfnSMTiWl3P43AdXZ5L6bhgiwoJUZBRnr7 UANA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WXQqho3I; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=BfgeIdM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z5-20020aa78885000000b0068e3fe64a03si3784639pfe.308.2023.09.22.04.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 04:07:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WXQqho3I; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=BfgeIdM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DE17A805E40C; Fri, 22 Sep 2023 01:13:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232443AbjIVINL (ORCPT + 30 others); Fri, 22 Sep 2023 04:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232222AbjIVIMt (ORCPT ); Fri, 22 Sep 2023 04:12:49 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 166ED1BFF; Fri, 22 Sep 2023 01:12:16 -0700 (PDT) Date: Fri, 22 Sep 2023 08:12:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695370334; h=from:from:sender: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; bh=zIjjyICu9jgMK43t3DhKBMd6B4Guoddzcy+mtiYR0/4=; b=WXQqho3IrubgdyV4BejLJ3/KLwdunxUMlXu9+MVVbExUKBgacvXVTP2TPJcDYpfezxwIET oOaI3w2zhj7ksEbzENU7a3+6w/Bokgj6K4kUmM5Y8J1R7pndzD1PUNCoZF4+xIAFTlzFkI 8IKn0VmyoF/DQQm0de7U97259ffZv5TzgyQf/nIUBq9gaZrkIkZ6X4/wxLXgZRyCuG+7Xh bvMh/LUi4cVHbCUyl/BdCSq+jOYnN/RpYTzSK+M7m5/kdQ/ZAq5Xhtm3JMWCNP1ydYomEX n+AmjT8Ju0TT6h3igDTvwYrKTxlTT9PfNxH7q0vQB3XHCn0OSh7V2GH07cuw1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695370334; h=from:from:sender: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; bh=zIjjyICu9jgMK43t3DhKBMd6B4Guoddzcy+mtiYR0/4=; b=BfgeIdM6OQPI6m8b/0GBu0K1GkPNxSjEJ9Vz1NuqKb2tXg9CAyi8+LbnPzM3EaS7bDt/SE tEbQcTVB/ct4ieDA== From: "tip-bot2 for Ingo Molnar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] : Introduce the list_for_each_reverse() method Cc: Ingo Molnar , Linus Torvalds , linux-kernel@vger.kernel.org, x86@kernel.org MIME-Version: 1.0 Message-ID: <169537033408.27769.12070730521509427015.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 01:13:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777735658294304552 X-GMAIL-MSGID: 1777735658294304552 The following commit has been merged into the sched/core branch of tip: Commit-ID: 8bf0cdfac7f8aa3fa6151b5c5f5eebdb44a64e89 Gitweb: https://git.kernel.org/tip/8bf0cdfac7f8aa3fa6151b5c5f5eebdb44a64e89 Author: Ingo Molnar AuthorDate: Thu, 21 Sep 2023 11:32:58 +02:00 Committer: Ingo Molnar CommitterDate: Fri, 22 Sep 2023 09:38:42 +02:00 : Introduce the list_for_each_reverse() method The list_head counterpart of list_for_each_entry_reverse() was missing, add it to complete the list handling APIs in . [ This new API is also relied on by a WIP scheduler patch, so this variant is not a theoretical possibility only. ] Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org --- include/linux/list.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/list.h b/include/linux/list.h index 164b4d0..1837cae 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -687,6 +687,14 @@ static inline void list_splice_tail_init(struct list_head *list, for (pos = (head)->next; !list_is_head(pos, (head)); pos = pos->next) /** + * list_for_each_reverse - iterate backwards over a list + * @pos: the &struct list_head to use as a loop cursor. + * @head: the head for your list. + */ +#define list_for_each_reverse(pos, head) \ + for (pos = (head)->prev; pos != (head); pos = pos->prev) + +/** * list_for_each_rcu - Iterate over a list in an RCU-safe fashion * @pos: the &struct list_head to use as a loop cursor. * @head: the head for your list.