Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4108102imm; Tue, 25 Sep 2018 11:27:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV63vz3WlpeX4meYJdlpgJJxDsNg9rNOd4TDITNwHvAyzV1xtrFEyeZeJoc42S/8O42VoiXNK X-Received: by 2002:a63:1921:: with SMTP id z33-v6mr2223109pgl.302.1537900034841; Tue, 25 Sep 2018 11:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537900034; cv=none; d=google.com; s=arc-20160816; b=idCNtsddQtzpxFQHHi9rq4GJJaBBNHNy14jHvrfOOnstFpVwC6XrXfi56wH6/NMagH yIX2UfuBBPd4CLhntq3gxxFlOioRF+WLpBzei8Swm/Y6bjF5gds6FbY3Xyp9eSxAoyUU Qs/Wt1DBd1AbhTm0VJ27BUx5QB4H3J0OzqLYWKufQTroebOVAkNx9b6eEbpQMAAXLZiu A1oGLV4tEOm56cm4tq6AnC9z/cG1KBxHTQz2z17bYpS1smPgKaw0vNGiquGhy+/Mckja 1jeNuiDgg0tGdOBWQftAZ9C5pdcwWD26xMJh6xl4tpy4GhForu5o3om9eUIs7+Q+p23e GN+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IygWM3hka5n5utS1J0WFLLtcDdg6o71RjTbDWC5Bxyo=; b=xAER7HLdy60AOF4kFXWlKuPBxOkAyQzvFVn05BC3ppI4vdODTUMVHPHR/QEMz3KBSl WUesckbjnEXCxM1mFWxd5IJQhJhbTm8oFAwfk3CsWSAZd2SN7E+MO3H1F9OXTJJvUCSU EJeT6odCeU5ZaiGLLz/PNW4Bd68C/QDs/A7TsSGbcrEgtULl4ytOw8tr0IaTUkm6wHNr 0ZPKo+QRvT8NVTe3ZTyqPanRtvVQbUmH0A4q012d9VjsI8Sd4Essmr5yXjK4fharvwtE VyoXhmWmmQrsB2Cfk+j2ec8aUgjod9eFt5FCc9EFMJKQpZSSSFJMO+i0qmMc4aDmqUZZ 13ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=eDTqNBBU; 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 y15-v6si2989911pfg.124.2018.09.25.11.26.59; Tue, 25 Sep 2018 11:27:14 -0700 (PDT) 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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=eDTqNBBU; 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 S1727520AbeIZAfV (ORCPT + 99 others); Tue, 25 Sep 2018 20:35:21 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34174 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727500AbeIZAfU (ORCPT ); Tue, 25 Sep 2018 20:35:20 -0400 Received: by mail-pg1-f196.google.com with SMTP id d19-v6so12178580pgv.1 for ; Tue, 25 Sep 2018 11:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IygWM3hka5n5utS1J0WFLLtcDdg6o71RjTbDWC5Bxyo=; b=eDTqNBBUTZGjbhy5B3O6qv7jotrYfa2Z88CnlGoiGY/iOoT3yrI5wudyRXKU/CrX33 HUD5YCQdAB6VdRlPonb0WtJ4nrO9hIxyz0TBIKEGCicD414FpcjLdhvTPbsfrj5C3tjk yANr73du2qIZaOBcjZJIqyFAXTLX2b5pH/xiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IygWM3hka5n5utS1J0WFLLtcDdg6o71RjTbDWC5Bxyo=; b=V95TvQnGkaI3vPtU1Q+ZYhdYy9sD7stXEQ5IWNlHOffyDLFIOyGvTMeZalYdYM4VUt wgdr5TAAnpzOkwO+vKw068Hfr+4zS8b9wsyOKERy1OZhQGvyMY5ccX1W5U8NoZ5rnWGv NwbVihb1no+8c+Hpe1cIc6dPS0k5GScZKaogoPUcg3Q+ec1GOakzA32sQUwa1dmUS33c LNyquJ1emAwwIrADS9618n3u0e6ZOIUnFHCQk4kIg18UDuB5g+XE0nvvfxmaDuY3eJOC 8W2MNHoKBUe4P79HDYLzM6pBbi9eO9EkYvhsSdK60qd4pfxtqpjwPcpqRmrqa6SdKmaa +fSA== X-Gm-Message-State: ABuFfohn8zm+JlAHCFbBbiDWtMkhr4Z8ct2Uu86B8XsBYhTzaIZK6T2W IFfOSwvHIvLDlBNUHqpImzYz+LeZaD4= X-Received: by 2002:a63:1342:: with SMTP id 2-v6mr2159564pgt.19.1537899993150; Tue, 25 Sep 2018 11:26:33 -0700 (PDT) Received: from joelaf-glaptop0.roam.corp.google.com (c-98-210-118-128.hsd1.ca.comcast.net. [98.210.118.128]) by smtp.gmail.com with ESMTPSA id x70-v6sm6883626pfk.85.2018.09.25.11.26.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 11:26:32 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Jonathan Corbet , Josh Triplett , Lai Jiangshan , linux-doc@vger.kernel.org, Mathieu Desnoyers , "Paul E. McKenney" , Steven Rostedt Subject: [4/5] doc: rcu: Clarify better the rcu_segcblist len field Date: Tue, 25 Sep 2018 11:26:00 -0700 Message-Id: <20180925182601.37421-5-joel@joelfernandes.org> X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog In-Reply-To: <20180925182601.37421-1-joel@joelfernandes.org> References: <20180925182601.37421-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org An important note under the rcu_segcblist description could use a more detailed description. Especially explanation of the scenario where the ->head field may be temporarily NULL making it not wise to rely on it to determine if callbacks are associated with the rcu_segcblist. Thanks Paul for clarifying over email. Signed-off-by: Joel Fernandes (Google) --- .../RCU/Design/Data-Structures/Data-Structures.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/RCU/Design/Data-Structures/Data-Structures.html b/Documentation/RCU/Design/Data-Structures/Data-Structures.html index 3f9a8ae4287e..a45fc326d990 100644 --- a/Documentation/RCU/Design/Data-Structures/Data-Structures.html +++ b/Documentation/RCU/Design/Data-Structures/Data-Structures.html @@ -928,10 +928,16 @@ this rcu_segcblist structure, not the ->head pointer. The reason for this is that all the ready-to-invoke callbacks (that is, those in the RCU_DONE_TAIL segment) are extracted -all at once at callback-invocation time. +all at once at callback-invocation time (rcu_do_batch), due +to which ->head may be set to NULL if there are no more +callbacks on the rcu_segcblist. If callback invocation must be postponed, for example, because a high-priority process just woke up on this CPU, then the remaining -callbacks are placed back on the RCU_DONE_TAIL segment. +callbacks are placed back on the RCU_DONE_TAIL segment and +->head would point to the start of the segment. So as you +can see, the head field is briefly NULL even though not all callbacks +could be invoked, so we can't rely on it to tell us if there are no +callbacks associated with the rcu_segcb_list. Either way, the ->len and ->len_lazy counts are adjusted after the corresponding callbacks have been invoked, and so again it is the ->len count that accurately reflects whether -- 2.19.0.444.g18242da7ef-goog