Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1179126ybx; Thu, 7 Nov 2019 08:21:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyYp5mzCe/QFMqHt9xth6u3yx+O5xKI/6eghn2tu3FW1Y5tsLmbm6QyQhrZgL68Jnm0GjU9 X-Received: by 2002:aa7:cc95:: with SMTP id p21mr4457363edt.189.1573143661754; Thu, 07 Nov 2019 08:21:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573143661; cv=none; d=google.com; s=arc-20160816; b=nhSD8awaXrZBhbn1ZAMc2FsJUzBQz1AW/WewHaQtZymUEn1MGqw+sxlZRB+7C1W0N4 ++B6cI1aw8E3LDj6KHeEH1eiVTGCEa2RLYuflaxE4r+V7qW0kqD61vHWRlRKBE+/RzoV 0RSE+G7cVWe+phXgBHnHGysS6HwVmNiR80pEp1MZbkgUmybuXfrt6CUcDxvT1bETqDTB tJmRlR3vIVnSmq5eXuUBR4IitUnChIj1ztUTIPMYS6JqPf1XUh+zR4sdsCbJt3TM6Q/s i5hmANOhot+v5tNlbFgbgRcoI6e/0f2/40QEG3MMlqT8cpBjGUAK8vBDetCl2hxLh9I4 tmPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dYr8Ef7OO1iYcDeJZqmz3VmJ1srDKDk+GdYU413QJIM=; b=WUuYo6FPcPnc6xn0s5gX1331PacSQbFZ2S7l3qWXarrrK2ekUe76BeNjk+hkf0F+d8 gkLImmg4hjJaqBWmidEBxe1/SiplA2js9WAXpUbEGP0mzoR/Gg790KrHq7uy1DfQFIwY uk3E8i+9v6HnkrQLZ39y61g7uuGcwlkQNDUPK+bjINlvASMOHbI1SSSipG3OeiObXMhj 9k1v+d2bRGZd/oLJ9Seh5KFZ12TBqFdUC8nc3GeL/hD3FBdRW5kvYBxl+KwfEel86fIy gkyk4kkj2gqLvTKViWMbqDEOmRChJwY/+snVHxEx1pAN5SRNgukOe0EKwSKNX4G3OyaM u0+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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si1815993ejm.31.2019.11.07.08.20.37; Thu, 07 Nov 2019 08:21:01 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388911AbfKGQRx (ORCPT + 99 others); Thu, 7 Nov 2019 11:17:53 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:40682 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730057AbfKGQRx (ORCPT ); Thu, 7 Nov 2019 11:17:53 -0500 Received: by mail-qk1-f196.google.com with SMTP id z16so2475270qkg.7 for ; Thu, 07 Nov 2019 08:17:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=dYr8Ef7OO1iYcDeJZqmz3VmJ1srDKDk+GdYU413QJIM=; b=LAZfAqjyttXKDwvNjlLDkyz5fKssu6YWtD4+TSlMKp5YrXocv8Ji5kwH8zsD/oWmaX 473AujMn+heQeEseTj9E/ZqSheKbh4HXjudOaXP40dxUvxsj9OJH/MKaGts8KbZ8MNoj u0Ez15D5dFA4kcJN/7Jnhv3TLfER/qBDsVFHgJ8l5ORvgp657Dn8z0DpS6tYTX4Y1T4M Pbt/F39lC5OoW+CvVpT+9eEEwjm3vyvLbyIH5NShrSKj/AnqYVBC696IdHLrz1DyWz8x KAjxKpqIclHjsww2JZQFyzv5FQDVYQRn8urIbc8mHs9lIBuLmYE801Moc5FpiA7bRtfo kn0A== X-Gm-Message-State: APjAAAW1n2p4yqYIsxEiBb4sYXvgs2FZrz2/K6GnXZwWAivIj0w3dGfM 4oHs/l8COBxraiXtPMuXsps= X-Received: by 2002:a37:9bc2:: with SMTP id d185mr3432827qke.299.1573143472238; Thu, 07 Nov 2019 08:17:52 -0800 (PST) Received: from dennisz-mbp ([2620:10d:c091:500::3:db5f]) by smtp.gmail.com with ESMTPSA id j71sm1576484qke.90.2019.11.07.08.17.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Nov 2019 08:17:51 -0800 (PST) Date: Thu, 7 Nov 2019 11:17:49 -0500 From: Dennis Zhou To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, 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: <20191107161749.GA93945@dennisz-mbp> References: <20191002112252.ro7wpdylqlrsbamc@linutronix.de> <20191107091319.6zf5tmdi54amtann@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191107091319.6zf5tmdi54amtann@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 10:13:19AM +0100, Sebastian Andrzej Siewior wrote: > 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 Hello, I just want to clarify a little bit. Is this patch aimed at fixing an issue with RT kernels specifically? It'd also be nice to have the numbers as well as if the kernel was RT or non-RT. Thanks, Dennis