Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7713148ybl; Thu, 16 Jan 2020 04:28:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzq9+ZwOmBTcODQtjTJkJY53Pz7v9O05TccnUpoHL+tmzNhrkTIKkh3bd6TElZEwOxul/JD X-Received: by 2002:aca:72cd:: with SMTP id p196mr3609113oic.99.1579177716894; Thu, 16 Jan 2020 04:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579177716; cv=none; d=google.com; s=arc-20160816; b=DO1l0ycRdQchIO5IwqZUOsm3SDcYr62q5D9wJKzXhSrzNkxJWvrWBp1Cd5Lven5Fr8 GUkipG/lICaDS0W32F/LL+IDfN/Wxzi5dHSEocSyOKKrd8U97tcQLZJfkbHUpxHtzUHb EQ0fKkJVXC+dUGE2U+Am8cp4F8DlzUB5FbsbAHpe2Vwdybtc6NjMWoVmKal1baq3YvC2 mDvuB3XyFPwp+UiYL/aBXZey/S+WWIA25POoMprGIOZeOMNiVUf1iXJV2Lqm+As0Gk83 XauOaUqu05OEf6p+OBpk11DG3NMYplfpBkio6/nx/UcDAfZBmWDe9HH/q8BS01/a1uKV rE/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=8eEuHBSClRsllq8m/mQ9m6anJGjxw4e3fc/RFVWNYLk=; b=SnULFisGSzeoEJfbJEGnL26CJdEl75om4Tv+sOMtvQDOabAX4g++dyArpRdbAuNRVc MD5jIs6bORFLwjnrMrDtpSHbb5es+AhXpgDaJ9UwZfU/xi3KD3NsuLdMZJbkLvEHe6VN 95UQwE89AX29LCqb+6F0NOc0dtbQhFWoYijR0DC5/lo64YoLbE3A/oVCzeCUsQD0Raa5 4bWhPsrxcr/U9yc0NYRm1zyGji7jwBYSCNO2QP/SrWCSS0d73GidMUL53SnxrzlErrWv lpxsOuWATwMfojmZ1J5+Y40S2PsUTUP4+cGmx9bBMhu6z77Y7mAJJAgPM4soK5r0/k2F LrGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si12128902oif.167.2020.01.16.04.28.24; Thu, 16 Jan 2020 04:28:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726896AbgAPM11 (ORCPT + 99 others); Thu, 16 Jan 2020 07:27:27 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:38050 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbgAPM10 (ORCPT ); Thu, 16 Jan 2020 07:27:26 -0500 Received: from localhost (82-95-191-104.ip.xs4all.nl [82.95.191.104]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 6FAC815B52F09; Thu, 16 Jan 2020 04:27:24 -0800 (PST) Date: Thu, 16 Jan 2020 04:27:22 -0800 (PST) Message-Id: <20200116.042722.153124126288244814.davem@davemloft.net> To: zhangshaokun@hisilicon.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jinyuqi@huawei.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, edumazet@google.com, guoyang2@huawei.com Subject: Re: [PATCH] net: optimize cmpxchg in ip_idents_reserve From: David Miller In-Reply-To: <1579058620-26684-1-git-send-email-zhangshaokun@hisilicon.com> References: <1579058620-26684-1-git-send-email-zhangshaokun@hisilicon.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 16 Jan 2020 04:27:26 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shaokun Zhang Date: Wed, 15 Jan 2020 11:23:40 +0800 > From: Yuqi Jin > > atomic_try_cmpxchg is called instead of atomic_cmpxchg that can reduce > the access number of the global variable @p_id in the loop. Let's > optimize it for performance. > > Cc: "David S. Miller" > Cc: Alexey Kuznetsov > Cc: Hideaki YOSHIFUJI > Cc: Eric Dumazet > Cc: Yang Guo > Signed-off-by: Yuqi Jin > Signed-off-by: Shaokun Zhang I doubt this makes any measurable improvement in performance. If you can document a specific measurable improvement under a useful set of circumstances for real usage, then put those details into the commit message and resubmit. Otherwise, I'm not applying this, sorry.