Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp176391ybl; Wed, 4 Dec 2019 00:26:15 -0800 (PST) X-Google-Smtp-Source: APXvYqz6QW7cee5y5WlvomSH12iDUIjaJmWxDvK/m3KQcw6sYNhSMHNUTT2vyNnBEHWxghiIWeGH X-Received: by 2002:a9d:6f85:: with SMTP id h5mr1618560otq.19.1575447975191; Wed, 04 Dec 2019 00:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575447975; cv=none; d=google.com; s=arc-20160816; b=xSEI+5p3TiWaWupzlAPEDF3/6OEOAMqmCs/JWSSQV59tU8aoHbzPEPnYfymHD6NTKx C4W0ZAdeJ+MwwwWoLllo3/I7DkCcZ80OXUuKhVBfu0UG18rQswqETJ8ccIh4Nm79e82I pHflYG4d7c/KMlPK3LAGCZaBw0LygWuNdVq4gyiAQslm9YhDNqIdCjthFwWTbFdt+zZQ 3G2DLyLFrL2H2hBUeUxXKSCjqPqH9A/JabXEIsCGDBsV0M+Exny6O/Lfn1U9mgdPYcvd 4aLAPjib7NufeeFPuCxInv7+ywaExqc9ItfleDCdYk8CCvwgJAATSXjnC1Nwmjj4/g6A HOHA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8xvQ4KrBz1M6n1c0YpMC9j+X8HvnhtQ5BjOcRHIdsx4=; b=sfyqDPoXV6WrlDvQIT1ItQpCYoHqqvWINL5qS11KTGlXVqM+AvSdYTEwMnTGhhF/2U J+JOz2ydhGngVNZW9ZBfuVQXfL8+cIeP6Gn0A+I5IopT0MEDDjOPayLVEAUl3YwPyfMk VCwiT0gpAz/x94zJKU+VrOKvLfn6gbTcT4amB/ggxWk86e2ahIfWZBo2hLGmWqVF9c5L mkTm55O4IN2gnQaYvWL7vnZ7+JtW36JCokg04WMD+BOMBhwSYFZI9C6So8LlwMNIyZVd WEiElK8Bw27PPRht/24z5h2VSYtdjXs1k6/b5DPkCx2lj7mYd9opJCdZmm7LoxXgzFu9 3iQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=amGepPz7; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r202si2864358oie.247.2019.12.04.00.26.01; Wed, 04 Dec 2019 00:26:15 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=amGepPz7; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727261AbfLDIYW (ORCPT + 99 others); Wed, 4 Dec 2019 03:24:22 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46029 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbfLDIYV (ORCPT ); Wed, 4 Dec 2019 03:24:21 -0500 Received: by mail-pf1-f193.google.com with SMTP id 2so3242786pfg.12; Wed, 04 Dec 2019 00:24:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8xvQ4KrBz1M6n1c0YpMC9j+X8HvnhtQ5BjOcRHIdsx4=; b=amGepPz7ql+vTupsCnD6IPDipjGdbEdlKhY9cDj1Ekdy9V/2p6pYvzaA+jruVaXcuZ rO1xKldA6IhBJmcwJ/vnXGFEIYBKAHziPGeGrBZvW9m1px5SyLsyUbx3D3ydcil6qGB/ K1NZiwbGggzcQ5EoFuozvvigL+u60IS+K2+0sJw7PUREwd0Vq9rbx8I+x1RrSOT9ychp CeBXvLiBfT64rb0Ixq0cMg6+y7mOOd+UDClM+uVwM7FESrFiH1aysjLxbYJqiwg+TKX4 dl7VDEbU7KJNXdlpyx4/lY4iLWHNBLsFgMZ8ZdIyej9mA+hM03g7ymt93X70bI7zNJjo 3+fQ== 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:in-reply-to:user-agent; bh=8xvQ4KrBz1M6n1c0YpMC9j+X8HvnhtQ5BjOcRHIdsx4=; b=nvAJnrpEqFG05x4iwxcpcCIfrz9OS+bozDiZ1E97UXPINxwpPFLDUaPz7S7Pzi1Q81 QxG9/stbglf1NEw00drpqVRy6pyzeR4h9uYPq4ycYXWtxMiV96jAS8dkdeZvhYA8wWND P+cpBG0Hjk/fy5KNp/t8r6iZA7GncqW2WTT45nd7cT1DG/Yq0vFAGpEmYWYg3+sDRFCX tY+w9pWSKhWid9l2VTifFh6KGvqXMTTVjyxpstxcVeGz6eM1gPkcGCa7aG0zCjoo+Gl/ 06LW1BPsRtoXJpnBYTsNu3g3r9OI0kNt8EZtx5GVGM1Np6nHWwPiH87QMEv0mloN6NDe Jq7Q== X-Gm-Message-State: APjAAAXB5H6D5Li7COyiA3vGn+sJ6LbfjcwrK7Ysm7bQB5JqEDXMkUq6 42VoOOJhNvGomZ+fIm0pduzHYRXacJY= X-Received: by 2002:aa7:80d2:: with SMTP id a18mr2318629pfn.29.1575447860727; Wed, 04 Dec 2019 00:24:20 -0800 (PST) Received: from workstation-kernel-dev ([139.5.253.155]) by smtp.gmail.com with ESMTPSA id o19sm5926518pjr.2.2019.12.04.00.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2019 00:24:20 -0800 (PST) Date: Wed, 4 Dec 2019 13:54:12 +0530 From: Amol Grover To: Jonathan Corbet Cc: "Paul E . McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , rcu@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Shuah Khan , Madhuparna Bhowmik Subject: Re: [PATCH] doc: listRCU: Add some more listRCU patterns in the kernel Message-ID: <20191204082412.GA6959@workstation-kernel-dev> References: <20191203063941.6981-1-frextrite@gmail.com> <20191203064132.38d75348@lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191203064132.38d75348@lwn.net> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 03, 2019 at 06:41:32AM -0700, Jonathan Corbet wrote: > On Tue, 3 Dec 2019 12:09:43 +0530 > Amol Grover wrote: > > > - Add more information about listRCU patterns taking examples > > from audit subsystem in the linux kernel. > > > > - The initially written audit examples are kept, even though they are > > slightly different in the kernel. > > > > - Modify inline text for better passage quality. > > > > - Fix typo in code-blocks and improve code comments. > > > > - Add text formatting (italics, bold and code) for better emphasis. > > Thanks for improving the documentation! I'll leave the RCU stuff to the > experts, but I do have one request... > > [...] > > > +When a process exits, ``release_task()`` calls ``list_del_rcu(&p->tasks)`` under > > +``tasklist_lock`` writer lock protection, to remove the task from the list of > > +all tasks. The ``tasklist_lock`` prevents concurrent list additions/removals > > +from corrupting the list. Readers using ``for_each_process()`` are not protected > > +with the ``tasklist_lock``. To prevent readers from noticing changes in the list > > +pointers, the ``task_struct`` object is freed only after one or more grace > > +periods elapse (with the help of ``call_rcu()``). This deferring of destruction > > +ensures that any readers traversing the list will see valid ``p->tasks.next`` > > +pointers and deletion/freeing can happen in parallel with traversal of the list. > > +This pattern is also called an **existence lock**, since RCU pins the object in > > +memory until all existing readers finish. > > Please don't put function names as literal text. If you just say > call_rcu(), it will be formatted correctly and cross-linked to the > appropriate kerneldoc entry. Saying ``call_rcu()`` defeats that and > clutters the plain-text reading experience. > Hi Jon, The cross-reference of the functions should be done automatically by sphinx while generating HTML, right? But when compiled none of the functions were cross-referenced hence "``" was added around the methods (and other symbols) to distinguish them from normal text. Thanks Amol > Thanks, > > jon