Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1485471ybi; Sat, 25 May 2019 03:08:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCFIUDu4jFqKzsNhWHuinKQf+r+k0B7LhW3epoR690EsDIE3+HqSxFhi7Qf8CP19D/cuOI X-Received: by 2002:a17:90a:c381:: with SMTP id h1mr15387116pjt.129.1558778936546; Sat, 25 May 2019 03:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558778936; cv=none; d=google.com; s=arc-20160816; b=PssoQJxf9wHdDsy86CuvurGDAcC+uH1kD989JAffGtV/lew+0grsV0ZNifzfqB3rSE GjcR3iBSxRIS/J5IU1WdFM6UrayhXpkJQPbu62sLJstLjMKqdWMdfDMW0ydxIyAQfZVD pIBzCeHoRZJ5iq7EZVhB+cLbLVCDlhNjKZ/68AyMvWLFIKPoysx69FngWnm5OlFBYrBn RwOUBMtlLv8h9m8APZe8dJvGdi8krb4Bf/zTUQkYCpkHqY7dxDW0hHJoI0BH23WgIIq9 hcqOYBMQMTNmFvgqZqL6Nxj5xsNVYtgrPHaiIqrHmMpk7C07PeFswJC6Z2EgCpeZJjao FWcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bfhrFcakAvRPFa4ilNfgzQaeIke1aVQ4rQMw2nVHnyQ=; b=zfcUKjDt7oIpoQXjQWM8FMlm3RuEkkdhvYt5fMzZp1lOOdklEXOe/SaLYYvH01+VHh bl/ikBzqk9b18E9PuMlk5gmeMOZTEh/pzZaiZQQjnf3GTCPxHz61CJ/BPZixTt42/pii 0ecivZeF7JwqACSa3sniTeTH0FGp8/GLip79mWPX3uNDcCBFSgf/dreCx8yeLjfDeY+1 CkstaPuUm9FfTacceqFqBFhj5mWHOnHh9XN6nwSn7XcyX/MpwW9rc8sllptgIui3+j0y lIqOhGfzO5zquArlVETzRzJYEoTcfA76ETzvmZkfJqqVaTSh9CGMXrru7zjz7m02bdCk 3eTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=V+31VLVF; 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 l1si7650488pgj.504.2019.05.25.03.08.38; Sat, 25 May 2019 03:08:56 -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=V+31VLVF; 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 S1726812AbfEYKH0 (ORCPT + 99 others); Sat, 25 May 2019 06:07:26 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36991 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726732AbfEYKHZ (ORCPT ); Sat, 25 May 2019 06:07:25 -0400 Received: by mail-lj1-f194.google.com with SMTP id h19so2344891ljj.4 for ; Sat, 25 May 2019 03:07:24 -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=bfhrFcakAvRPFa4ilNfgzQaeIke1aVQ4rQMw2nVHnyQ=; b=V+31VLVFf0iRYRwGsw5tWZHAhTFLsXaICfdGZfiZo+NyQjSI9NaoGEt1cHGfAYlRGD n9Qw7h7fW41Kh4bOHZcjd0TJRtCteIx3wgfQytobyyAmdaAQGu5pZwCvAcinQRpol0Vb Se5JGOkQkhbgVqsYnDGhDQFpuwsb2tSwPJ2sY= 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=bfhrFcakAvRPFa4ilNfgzQaeIke1aVQ4rQMw2nVHnyQ=; b=YIVunI5W0Nj7KRg4Gsh7X4ch/DXzIiXOfkYsXaDm94x20et08Yms3qhOHbZaV/502x L5dN2lfANKrTibpcp/lGzLEOlHbo7jY4MO+SME84AcZWMMAnuAy/A0pvkcX2e8sONLEc VR2M62C3mqXt4TSmenNbUxvcYZEn3Z0loptLkX2+J3L3iKDrby6igEOyFBo+gBkMX19Q 8DjYFhd+/0gL/gaIOmh89BNE4fUVcx/3aTHcCQDlG9H9ZpvZXtXrJz448tqubG1p+D+g e2WnZDReFSLm8ypKX/o9AUaSot5B4kgRgSD6E4uj6lepXGvRnGVGKNCs8aiQLFvaZu7Y sENA== X-Gm-Message-State: APjAAAWdEju0Aw2owOkgosiJjpDGqKO/6dfR+SiWi1+RbkY0hJsm54Bn 4XQ3Fn2OISO6sl+z36nm+3mS7irvLPfIS6WmlcxKkglhKbqoHw== X-Received: by 2002:a2e:9bc5:: with SMTP id w5mr17423153ljj.87.1558778843232; Sat, 25 May 2019 03:07:23 -0700 (PDT) MIME-Version: 1.0 References: <20190505020328.165839-1-joel@joelfernandes.org> <20190507000453.GB3923@linux.ibm.com> <20190508162635.GD187505@google.com> <20190508181638.GY3923@linux.ibm.com> In-Reply-To: <20190508181638.GY3923@linux.ibm.com> From: Joel Fernandes Date: Sat, 25 May 2019 13:07:12 +0300 Message-ID: Subject: Re: [PATCH] doc/rcu: Correct field_count field naming in examples To: "Paul E. McKenney" Cc: LKML , rcu , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Jonathan Corbet , "open list:DOCUMENTATION" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 8, 2019 at 9:16 PM Paul E. McKenney wrote: [snip] > > > And this example code predates v2.6.12. ;-) > > > > > > So good eyes, but I believe that this really does reflect the ancient > > > code... > > > > > > On the other hand, would you have ideas for more modern replacement > > > examples? > > > > There are 3 cases I can see in listRCU.txt: > > (1) action taken outside of read_lock (can tolerate stale data), no in-place update. > > this is the best possible usage of RCU. > > (2) action taken outside of read_lock, in-place updates > > this is good as long as not too many in-place updates. > > involves copying creating new list node and replacing the > > node being updated with it. > > (3) cannot tolerate stale data: here a deleted or obsolete flag can be used > > protected by a per-entry lock. reader > > aborts if object is stale. > > > > Any replacement example must make satisfy (3) too? > > It would be OK to have a separate example for (3). It would of course > be nicer to have one example for all three, but not all -that- important. > > > The only example for (3) that I know of is sysvipc sempahores which you also > > mentioned in the paper. Looking through this code, it hasn't changed > > conceptually and it could be a fit for an example (ipc_valid_object() checks > > for whether the object is stale). > > That is indeed the classic canonical example. ;-) FWIW just want to mention, it seems to me the ptrace task list traversal could be a great example of "mark obsolete objects" and is simple so I could just use that. Neil talks about it in his article here: https://lwn.net/Articles/610972/ . In "Group 3: Transform the way the list is walked" Cheers, - Joel