Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754785AbdCTPpf (ORCPT ); Mon, 20 Mar 2017 11:45:35 -0400 Received: from merlin.infradead.org ([205.233.59.134]:45604 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753381AbdCTPp3 (ORCPT ); Mon, 20 Mar 2017 11:45:29 -0400 Date: Mon, 20 Mar 2017 15:59:38 +0100 From: Peter Zijlstra To: Eric Dumazet Cc: Herbert Xu , David Miller , elena.reshetova@intel.com, keescook@chromium.org, netdev@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kuznet@ms2.inr.ac.ru, jmorris@namei.org, kaber@trash.net, stephen@networkplumber.org, ishkamiel@gmail.com, dwindsor@gmail.com, akpm@linux-foundation.org Subject: Re: [PATCH 07/17] net: convert sock.sk_refcnt from atomic_t to refcount_t Message-ID: <20170320145938.cmj5m33uxunladli@hirez.programming.kicks-ass.net> References: <1489767196.28631.305.camel@edumazet-glaptop3.roam.corp.google.com> <20170318164759.GA23837@gondor.apana.org.au> <20170318.182121.439615057765380575.davem@davemloft.net> <20170320103937.lq7nfnutupr3gkn7@hirez.programming.kicks-ass.net> <20170320131629.GA26405@gondor.apana.org.au> <20170320132357.acygo3umw6fiwb4p@hirez.programming.kicks-ass.net> <20170320132713.GA26954@gondor.apana.org.au> <20170320134017.h3c2jrsnd4guuyu7@hirez.programming.kicks-ass.net> <1490021461.16816.52.camel@edumazet-glaptop3.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490021461.16816.52.camel@edumazet-glaptop3.roam.corp.google.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 470 Lines: 11 On Mon, Mar 20, 2017 at 07:51:01AM -0700, Eric Dumazet wrote: > PowerPC has no efficient atomic_inc() and this definitely shows on > network intensive workloads involving concurrent cores/threads. Correct, PPC LL/SC are dreadfully expensive. > atomic_cmpxchg() on PowerPC is horribly more expensive because of the > added two SYNC instructions. Note that refcount_t uses atomic_cmpxchg_release() and atomic_cmpxchg_relaxed() which avoid most of the painful barriers.