Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3480062pxu; Sun, 11 Oct 2020 11:11:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFtmZAqHnDm1VAev+ZDyAn5e/pmM8KUT+R5+C4xrEmIHtA+3Xq55oWlMOlhUXrT9Y4g1Lf X-Received: by 2002:aa7:cfcb:: with SMTP id r11mr9977365edy.211.1602439884603; Sun, 11 Oct 2020 11:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602439884; cv=none; d=google.com; s=arc-20160816; b=U46XGM83xfcyTTG/Y1jUMnl+JALSZ3Oepg0UOqVQYmQbDzaSocTXMM4maRbnu6ESer BgVoZogwO7bYfPZE6CrZ4DgQh7X1/wSglQVGPJbVwMnPrP1n8lF66Lm0p0rQS7Tfy7cZ QO/+7y/R62enI9dVNh1hgvQKIB5NG4uVSsOSLKoUec+v+fPTyIuaYWkw+Ii/5GFEcYP4 TXiqLK4JNZsEHNc+i/lIbrc2yiBkW9ei+HphGPwAM2Gcbf8Sslvgjsc8pevgLIg98Onp cQF5BytwAkoT+6nIepdARevHuk+Nx4dVxuKNJHRFbh986Tlhy0/Ld6IRj738GcuUvvce 1ZuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dnAx+CMTWtccZoKo+7pJcGq4TFecPqxUqhMCcO/A1/I=; b=Wdcy/qFSpo8KxMda63al95OOh98q7dMgdkbsR8ejQjluqhKu0PItBDXxyPG8vKjLZj FpXuPDguBvKmZPH8bI9p7Mq3+6hny/3Qqogi2idfthkm74b/W1wdC6raaCo4OyccxVja fcw3hzWhqTAQ/GSs+Mr/fbAbL88A33t0MfNLafCGpz4qlN3EHwWPcD/UiImvUAVD0zD4 8gy1FIpQaD2+k/ahgHKhS1TktJZ2FJKmzKc6PWbHtsXG7vkrfzqIeqUdDdAN1xPw2orQ QYVmskqaR06zztl6tQqS7C9zXSpoqbxnMr89aiXFxnTdJbMo/+RqSz8U6CBWpG22g0c9 9Bsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=cqEJYWuw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si10485937ejx.626.2020.10.11.11.11.01; Sun, 11 Oct 2020 11:11:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=cqEJYWuw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388206AbgJKQft (ORCPT + 99 others); Sun, 11 Oct 2020 12:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388148AbgJKQft (ORCPT ); Sun, 11 Oct 2020 12:35:49 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 089DDC0613D0 for ; Sun, 11 Oct 2020 09:35:48 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id m17so15284051ioo.1 for ; Sun, 11 Oct 2020 09:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dnAx+CMTWtccZoKo+7pJcGq4TFecPqxUqhMCcO/A1/I=; b=cqEJYWuwEM1wKqoR8MtOGNWkuTiZOeOubU7UCLM5TLYhOUrOBYY/iNWozxx7s7NZrp BYYhtvqaNJXJZmOM+6lJp+D+AftUShJPH1CDcl6kXqtJLV81D4Bcy/AAy3tY3/5TOZE6 s2/MbUgnUWulLg+qD2aaRG9sEeP3AoIHhpgq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dnAx+CMTWtccZoKo+7pJcGq4TFecPqxUqhMCcO/A1/I=; b=Tm7RhQwN2ySxitR2pzCWpu7dQ4Q/bf6gI5ZCg2p27pQBKij9TougqEOeJKFBc8lb/h IOv1bIh0rHZFXy8O+V1EVAUo2F2UOqVJ24tQpzc8lDsgYt3dHnLupapuyrFSROwpQ8Pl B73uKiJlKL5CbPI8nWQuSsS/C5lYsBQS7fhDWG56tWY2PPYZWbG6uRKwJOFgF/9cc9wT C8DBT3RR7K0xPsgIoYzl/bRgvbsMPmZ9z7Ev91/S9y7S1tF5qCYvV64uTmcjgysJsDgP mfCZDEgIBZ8D9KEVBmJzPG9ca+ZrN1s9kVidTIBF9Pf6Gs36062dQUOKKMeeW6D03oqE 2KdA== X-Gm-Message-State: AOAM532zkUHljMFGqWgdVDn2DdOE7H21iXmUweynZyHnhqsAke2LN6J0 o9bFBd9GNbTLvZkYdjyeF3bQiE+I30wThnQUmZEMMw== X-Received: by 2002:a02:110a:: with SMTP id 10mr16886097jaf.23.1602434148107; Sun, 11 Oct 2020 09:35:48 -0700 (PDT) MIME-Version: 1.0 References: <20200923152211.2403352-1-joel@joelfernandes.org> <20200923152211.2403352-2-joel@joelfernandes.org> <20201009231409.GA120772@lothringen> In-Reply-To: <20201009231409.GA120772@lothringen> From: Joel Fernandes Date: Sun, 11 Oct 2020 09:35:37 -0700 Message-ID: Subject: Re: [PATCH v6 1/4] rcu/tree: Make rcu_do_batch count how many callbacks were executed To: Frederic Weisbecker Cc: LKML , Ingo Molnar , Josh Triplett , Lai Jiangshan , Madhuparna Bhowmik , Mathieu Desnoyers , Neeraj upadhyay , "Paul E. McKenney" , rcu , Steven Rostedt , "Uladzislau Rezki (Sony)" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 9, 2020 at 4:14 PM Frederic Weisbecker wrote: > > On Wed, Sep 23, 2020 at 11:22:08AM -0400, Joel Fernandes (Google) wrote: > > Currently, rcu_do_batch() depends on the unsegmented callback list's len field > > to know how many CBs are executed. This fields counts down from 0 as CBs are > > dequeued. It is possible that all CBs could not be run because of reaching > > limits in which case the remaining unexecuted callbacks are requeued in the > > CPU's segcblist. > > > > The number of callbacks that were not requeued are then the negative count (how > > many CBs were run) stored in the rcl->len which has been counting down on every > > dequeue. This negative count is then added to the per-cpu segmented callback > > list's to correct its count. > > > > Such a design works against future efforts to track the length of each segment > > of the segmented callback list. The reason is because > > rcu_segcblist_extract_done_cbs() will be populating the unsegmented callback > > list's length field (rcl->len) during extraction. > > Also, the design of counting down from 0 is confusing and error-prone IMHO. > > Right :) :) > > This commit therefore explicitly counts have many callbacks were executed in > > s/have/how > > > rcu_do_batch() itself, and uses that to update the per-CPU segcb list's ->len > > field, without relying on the negativity of rcl->len. > > > > Signed-off-by: Joel Fernandes (Google) > > Reviewed-by: Frederic Weisbecker Thanks! Paul would be Ok to make the minor fixup s/have/how/ that Frederic pointed? - Joel (Due to COVID issues at home, I'm intermittently working so advance apologies for slow replies.)