Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp699986ybx; Thu, 7 Nov 2019 01:14:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwrXWka2ieDUDPdMlilP9fXaehoH2P1XZgCyMT5YBe0083ucL0igrfp/DldQ6jUjAAT8f/4 X-Received: by 2002:aa7:c6c9:: with SMTP id b9mr2339074eds.1.1573118068607; Thu, 07 Nov 2019 01:14:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573118068; cv=none; d=google.com; s=arc-20160816; b=J7AjqpK2kNtM6sSYHzqbBY0jwSsjGznrFoIFjO3hnbOQIgGoRzuwY0Ay6VVnRtzURJ wfWmDyOsVbfYxG0TZ6xcgA5etgsmeZVQWHCLHwy3FemjS2TGByO7O7wl8Un5QsvLRHxA nGvosKSvjAqMjm3K8qcMjDgffXBH6o1l0ySzesPcWfX+cEAz0tQexgLQcqb2Aj89dK0C r/YvpanYAb+nqJCgUnbfwi4CJuh75iWjesd75cWjRWN8l+g6Ey80KP60QPZpmz29tf1b 2SVnJRpiA/VezhU5Jdnj+UL1I25kWiNH0oLnijCO9DNRs5XJP0tgqP5KJaqc8HwibilU S6UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FnjcmqdyH4g49j39DaanpiQaE9BjmqVF3dDDWSNg+UA=; b=IP0J1Ez3FrWSqDKYYsqKP47icZEPTfUbshIKgg4KGiLi7OBey3ZhzDHZqPvZdw0O5I qJSYH8FvCFbNwrrSi0UPjCsohbVe9ke+CVP0E8zpPzXcbWYX6XwWwNLLl/Q0VtmrAqto 7aSVHSk/uDhJOGvbHMs7owN6qv59bjFKAjqxcWSzBmFRQhj1nioUyS1d40ed+OFxwVUn u/pnc7BLwjf/amMnz7TMOnTSfrNe3o/wwB/LXK3h2YEGivk0SVoJn+5+cZkwzScupXE7 LgS+/qEE5dGsLy+0RXs/BDnlsUZ+wXd1yzOq7tZC+/runvhOdjP5rhZ5xMEKZTDWeg0b S//w== 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 i47si977335eda.91.2019.11.07.01.14.05; Thu, 07 Nov 2019 01:14:28 -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 S2387702AbfKGJNW convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 Nov 2019 04:13:22 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:46704 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733170AbfKGJNW (ORCPT ); Thu, 7 Nov 2019 04:13:22 -0500 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1iSdqx-0001sC-6P; Thu, 07 Nov 2019 10:13:19 +0100 Date: Thu, 7 Nov 2019 10:13:19 +0100 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: Dennis Zhou , Tejun Heo , Christoph Lameter , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" Subject: Re: [PATCH] percpu-refcount: Use normal instead of RCU-sched" Message-ID: <20191107091319.6zf5tmdi54amtann@linutronix.de> References: <20191002112252.ro7wpdylqlrsbamc@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20191002112252.ro7wpdylqlrsbamc@linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-10-02 13:22:53 [+0200], To linux-kernel@vger.kernel.org wrote: > This is a revert of commit > a4244454df129 ("percpu-refcount: use RCU-sched insted of normal RCU") > > which claims the only reason for using RCU-sched is > "rcu_read_[un]lock() … are slightly more expensive than preempt_disable/enable()" > > and > "As the RCU critical sections are extremely short, using sched-RCU > shouldn't have any latency implications." > > The problem with using RCU-sched here is that it disables preemption and > the callback must not acquire any sleeping locks like spinlock_t on > PREEMPT_RT which is the case with some of the users. > > Using rcu_read_lock() on PREEMPTION=n kernels is not any different > compared to rcu_read_lock_sched(). On PREEMPTION=y kernels there are > already performance issues due to additional preemption points. > Looking at the code, the rcu_read_lock() is just an increment and unlock > is almost just a decrement unless there is something special to do. Both > are functions while disabling preemption is inlined. > Doing a small benchmark, the minimal amount of time required was mostly > the same. The average time required was higher due to the higher MAX > value (which could be preemption). With DEBUG_PREEMPT=y it is > rcu_read_lock_sched() that takes a little longer due to the additional > debug code. > > Convert back to normal RCU. a gentle ping. > Signed-off-by: Sebastian Andrzej Siewior > --- > > Benchmark https://breakpoint.cc/percpu_test.patch Sebastian