From patchwork Sun Mar 12 14:41: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: 68355 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp745016wrd; Sun, 12 Mar 2023 07:42:53 -0700 (PDT) X-Google-Smtp-Source: AK7set8Nf/0yCkJM50RKmZAwHVzGP7CMefZPkC5F/XCcy6Uva8msIyCW4XN9sVFP/0mOpdG6xxss X-Received: by 2002:a17:902:eccb:b0:19f:2503:a201 with SMTP id a11-20020a170902eccb00b0019f2503a201mr4656321plh.29.1678632173542; Sun, 12 Mar 2023 07:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678632173; cv=none; d=google.com; s=arc-20160816; b=X+Ytg1YUcQ/oJcIjjTz/Wkoush0qaXAjtqj4p+ZEmlfO5A/xNrv7m9gDr5gB36+Fd+ ujl/ycjSzFXs2FE4sLdDl62rw9qM+FwQsg0Ik9hmy3InsPG8HoEUlaozEOBrxrLrZOGS XHid1SrNWDdYExi5QRYBeImpL7yz4EWv9i1mA0C4r/oFt0GjLlAYyQvQpNDmGSlGHVj0 medKGKuo5Jkh7pSJr1wqcfpXQvgoXgGmkrPFus1HB97bENRDLiOk2F2M0VbvHigzEG0P HCvPhOjRzahwuHemX9XQwedVJJIwfOBDcwmWCDcjm695ZaA219XweVxTwQJWY/02fuof x01g== 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:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=qNiI+K/uDME8lIOLd0254ouP3TSGpYvgkL8w+k81abs=; b=ftaLEEO90SpfTowU68Sa9ah5dDhRp2flpCJFQKajZu2W5xQngDLvmJm3iezn8cpQDK QOVHSkzM3gPAraaEIYQw2aPtYqQT8/NIees4p/T8DKYaILWzujrBiNLfuebPUpL/qNk7 lkK0uAz+eBFiX/0i/lKmCRc7MPK+a07rNWykBQto8NuuevzoS7FjRgJuln0CpFZ5/EzB SQMmJ8DTq5vQmuXJUdFuvf0RZb6lvX7h58MbAqoAlQjteE5ZeJVegK56mtDiXc4/H0E0 pOnaHOyrpEn6978dDbR0c7MtEkv05NF/FAWMHCEPQWGa3BWE59BgwIRKeI5ulh9rn2Lc HcSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SBt074EY; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 11-20020a63184b000000b004fbaaa789bbsi4199445pgy.667.2023.03.12.07.42.41; Sun, 12 Mar 2023 07:42:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SBt074EY; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229665AbjCLOlW (ORCPT + 99 others); Sun, 12 Mar 2023 10:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbjCLOlR (ORCPT ); Sun, 12 Mar 2023 10:41:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B16F457CB; Sun, 12 Mar 2023 07:41:16 -0700 (PDT) Date: Sun, 12 Mar 2023 14:41:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1678632074; 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: in-reply-to:in-reply-to:references:references; bh=qNiI+K/uDME8lIOLd0254ouP3TSGpYvgkL8w+k81abs=; b=SBt074EYKLdmcaOnKqzJVYZB4dmbOKcA10P0kvEoHVqhhTswhEVmYjPXqTwM6l9cMx6K9E rOksGxiZpH4ydr0tS4MIJjkHJnRG5kEfwmj+R71hGTU7znyOKuIT2RzLTSH2zbynpYr1fT Aexl59uxTuQqRoFALHFM2FOtVv0b3NknITOzIgZqE9lTMu62wSMcDhjQtvmVx2Ogr7XLi9 uXgrNpzLWJiO1qDzsbTymY0kptalLu4uygN8JDFdKL8foZmByLa2Pz7SU8JYCcJgCVASGg tPAPmXNowYsI7nISL+R6sQUiJm3rklY2L2P+pMTQhS76GaTFBL4eAJrTqxTziw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1678632074; 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: in-reply-to:in-reply-to:references:references; bh=qNiI+K/uDME8lIOLd0254ouP3TSGpYvgkL8w+k81abs=; b=Jv8GwNd3c1+X/Xxe3CgbL72oHaRQj8At3Wll9q/yFamMnCjB4rrhfbbiqfTnTEMl0oAeca J0YBrAbURDzBW+Dg== From: "tip-bot2 for Andrzej Hajda" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] llist: simplify __llist_del_all Cc: Andrzej Hajda , "Peter Zijlstra (Intel)" , Andi Shyti , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230118154450.73842-4-andrzej.hajda@intel.com> References: <20230118154450.73842-4-andrzej.hajda@intel.com> MIME-Version: 1.0 Message-ID: <167863207410.5837.11889564974236848879.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755375828587040486?= X-GMAIL-MSGID: =?utf-8?q?1760173409780923552?= The following commit has been merged into the locking/core branch of tip: Commit-ID: ce27b24cbf7f62b74c4cbf807a06f42a14ccf981 Gitweb: https://git.kernel.org/tip/ce27b24cbf7f62b74c4cbf807a06f42a14ccf981 Author: Andrzej Hajda AuthorDate: Wed, 18 Jan 2023 16:44:47 +01:00 Committer: Peter Zijlstra CommitterDate: Sat, 11 Mar 2023 14:03:59 +01:00 llist: simplify __llist_del_all llist_del_all uses xchg, let's use __xchg here. Signed-off-by: Andrzej Hajda Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20230118154450.73842-4-andrzej.hajda@intel.com --- include/linux/llist.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/llist.h b/include/linux/llist.h index 85bda2d..4dc1d18 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h @@ -50,6 +50,7 @@ #include #include +#include #include #include @@ -241,10 +242,7 @@ static inline struct llist_node *llist_del_all(struct llist_head *head) static inline struct llist_node *__llist_del_all(struct llist_head *head) { - struct llist_node *first = head->first; - - head->first = NULL; - return first; + return __xchg(&head->first, NULL); } extern struct llist_node *llist_del_first(struct llist_head *head);