Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2558406pxu; Fri, 9 Oct 2020 23:02:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLfuhBtXaS6WFimaKpZjl64CVgdgdbjyuXF4/ukdAEFfcqsZ8sAM40kxi8kBR5+VAysM7A X-Received: by 2002:a17:907:7215:: with SMTP id dr21mr17461834ejc.239.1602309775048; Fri, 09 Oct 2020 23:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602309775; cv=none; d=google.com; s=arc-20160816; b=MqzEivRkngFnkJFAtMlMmhU7HFh9deC5GPTr5R3lciDPkinPd6ksBaFy8RFeSs6mCc 2FyP3ddfzheUZh7xCexhhIoS2vmz9zkB9bpRUvw+86lFqbnth5xGBNS6hu4/UtsdQrXk ZzKDVXUZBSDpMYQ0uG9C0jDEtMTIktytE1RBCv4qoyDivC29PRNqnhgy4IbOAWadMe6S Mun8rLXufsErKjCaTQPKx8/96PqcTz8XtQJ23am4+NPmnZ1An1uyMDeTMULlrCP19G8i Jd5OJkcjWZT1sGzBzneX0VxOu5U+gLvpGxyPj/4ELdGTvQBFXTH2gGodLaCS9DhcvwLQ JSnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Rspfjpvyg2ifjxCVryEkICYfk/w02g8B7BsvqDZFE6M=; b=tO2pPEzZH1DdxH5idDbgHbGE6G3OehLVtNKysqBjZ3CX6BzbhxRbWa0GNPxm8TyTIg 5S5dHrdUvFZc8lXFULqn0U62oeMG9KVqzebHOdTuup5+hmO/hTXVD2KlXCzWlKHWL2zT eKldVoyOG41dFFkwN+X6bYoJb31hNSpJa6UmPuU+8M45F/Besa76NVE7k5VtMmMuyzqP TwXknNoP2wgL4ikAXih/hfmi+tPqCZFLz4IIyVGA280Q0gtvSdP/C7sOLEThRCUxTDvz StP8auJkyuLkDutFJcGwsWsBJQQUn7YdsjDznGU/+rTLKwlrjlYcdR+kk3LuGWoQ/xwI 41Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BkWm7XSk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si7516300edj.119.2020.10.09.23.02.32; Fri, 09 Oct 2020 23:02:55 -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=@kernel.org header.s=default header.b=BkWm7XSk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726299AbgJIXOM (ORCPT + 99 others); Fri, 9 Oct 2020 19:14:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:51268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbgJIXOM (ORCPT ); Fri, 9 Oct 2020 19:14:12 -0400 Received: from localhost (unknown [176.164.200.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5EA0D222EB; Fri, 9 Oct 2020 23:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602285251; bh=l2U6CjZx9TygARxZeTvKgdT2J+ZVJfnAffaUI+8Mcl0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BkWm7XSkhPu3t6TfNTM6e+Ps02BvK52EEcJneG+zNGknefoB4ktuGpByNQ4EFzcEw KFpIq3nrbL3zaS/TXM6QQHHbTjQbNngqq/H6qUUYQguTd1hs2f4Achc/IPcK5U9wUc rTh42TGz5y4MRBLElKLZC1T2KAXVzmDP3PQzwVBs= Date: Sat, 10 Oct 2020 01:14:09 +0200 From: Frederic Weisbecker To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Josh Triplett , Lai Jiangshan , Madhuparna Bhowmik , Mathieu Desnoyers , neeraj.iitr10@gmail.com, "Paul E. McKenney" , rcu@vger.kernel.org, Steven Rostedt , "Uladzislau Rezki (Sony)" Subject: Re: [PATCH v6 1/4] rcu/tree: Make rcu_do_batch count how many callbacks were executed Message-ID: <20201009231409.GA120772@lothringen> References: <20200923152211.2403352-1-joel@joelfernandes.org> <20200923152211.2403352-2-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200923152211.2403352-2-joel@joelfernandes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.