All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: perfbook@vger.kernel.org, Balbir Singh <bsingharora@gmail.com>
Subject: Re: [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme
Date: Tue, 22 Oct 2019 08:51:37 -0700	[thread overview]
Message-ID: <20191022155137.GF2479@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <67a02888-6011-faef-985f-f2cad86a091c@gmail.com>

On Tue, Oct 22, 2019 at 11:34:48PM +0900, Akira Yokosawa wrote:
> >From 6a9e5e96a0dd94b6f20052ab741d2606e79dc80f Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Tue, 22 Oct 2019 23:23:42 +0900
> Subject: [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme
> 
> This snippet was added using the verbatimbox scheme.
> Convert it using VerbatimL.
> 
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> Hi Paul,
> 
> > With the exception of defer/rcuintro.tex, which collided with one of
> > my cleanups.  I believe that the fix is straightforward, just accounting
> > for the line I added, but I figured that I should check.
> 
> FWIW, this is the result of my rebase of the patch.

Queued and pushed, thank you!

							Thanx, Paul

>         Thanks, Akira
> > 
> > 							Thanx, Paul
> 
> --
>  defer/rcuintro.tex | 58 ++++++++++++++++++++++------------------------
>  1 file changed, 28 insertions(+), 30 deletions(-)
> 
> diff --git a/defer/rcuintro.tex b/defer/rcuintro.tex
> index ed7ff0b0..dc750326 100644
> --- a/defer/rcuintro.tex
> +++ b/defer/rcuintro.tex
> @@ -375,50 +375,48 @@ has executed a context switch, which in turn guarantees that
>  all pre-existing reader threads have completed.
>  
>  \begin{listing}[tbp]
> -{ \scriptsize
> -\begin{verbbox}[\LstLineNo]
> +\begin{linelabel}[ln:defer:Insertion and Deletion With Concurrent Readers]
> +\begin{VerbatimL}[commandchars=\\\[\]]
>  struct route *gptr;
>  
>  int access_route(int (*f)(struct route *rp))
>  {
> -  int ret = -1;
> -  struct route *rp;
> -
> -  rcu_read_lock();
> -  rp = rcu_dereference(gptr);
> -  if (rp)
> -  	ret = f(rp);
> -  rcu_read_unlock();
> -  return ret;
> +	int ret = -1;
> +	struct route *rp;
> +
> +	rcu_read_lock();
> +	rp = rcu_dereference(gptr);
> +	if (rp)
> +		ret = f(rp);
> +	rcu_read_unlock();
> +	return ret;
>  }
>  
>  struct route *ins_route(struct route *rp)
>  {
> -  struct route *old_rp;
> +	struct route *old_rp;
>  
> -  spin_lock(&route_lock);
> -  old_rp = gptr;
> -  rcu_assign_pointer(gptr, rp);
> -  spin_unlock(&route_lock);
> -  return old_rp;
> +	spin_lock(&route_lock);
> +	old_rp = gptr;
> +	rcu_assign_pointer(gptr, rp);
> +	spin_unlock(&route_lock);
> +	return old_rp;
>  }
>  
>  int del_route(void)
>  {
> -  struct route *old_rp;
> -
> -  spin_lock(&route_lock);
> -  old_rp = gptr;
> -  RCU_INIT_POINTER(gptr, NULL);
> -  spin_unlock(&route_lock);
> -  synchronize_rcu();
> -  free(old_rp);
> -  return !!old_rp;
> +	struct route *old_rp;
> +
> +	spin_lock(&route_lock);
> +	old_rp = gptr;
> +	RCU_INIT_POINTER(gptr, NULL);
> +	spin_unlock(&route_lock);
> +	synchronize_rcu();
> +	free(old_rp);
> +	return !!old_rp;
>  }
> -\end{verbbox}
> -}
> -\centering
> -\theverbbox
> +\end{VerbatimL}
> +\end{linelabel}
>  \caption{Insertion and Deletion With Concurrent Readers}
>  \label{lst:defer:Insertion and Deletion With Concurrent Readers}
>  \end{listing}
> -- 
> 2.17.1
> 
> 

      reply	other threads:[~2019-10-22 15:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fac2cbbb-492c-acde-14a8-15ee04b95ea9@gmail.com>
     [not found] ` <2d2eb3d6-d050-6f0c-aca5-b0cc76e8e0ec@gmail.com>
2019-10-19 11:43   ` [PATCH v2] Always generate perfbook.synctex.gz Akira Yokosawa
2019-10-19 15:35     ` Paul E. McKenney
2019-10-22 11:15   ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Akira Yokosawa
2019-10-22 11:17     ` [PATCH v3 1/6] treewide: Add '% mainfile:' tags in headers in sub .tex files Akira Yokosawa
2019-10-22 11:19     ` [PATCH v3 2/6] Add synctex-forward.sh Akira Yokosawa
2019-10-22 11:21     ` [PATCH v3 3/6] Add output of '% mainfile: perfbook.tex' tags in extraction scripts Akira Yokosawa
2019-10-22 11:22     ` [PATCH v3 4/6] FAQ-BUILD: Mention how to enable SyncTeX support Akira Yokosawa
2019-10-22 11:23     ` [PATCH v3 5/6] defer/rcuintro: Convert snippet to new scheme Akira Yokosawa
2019-10-22 11:24     ` [PATCH v3 6/6] defer/rcuapi: Tweak horizontal spacing of wide tables in 1c layout Akira Yokosawa
2019-10-22 12:05     ` [PATCH v3 0/6] Enable SyncTeX forward (.tex -> .pdf) search Paul E. McKenney
2019-10-22 14:34       ` [PATCH v4 5/6] defer/rcuintro: Convert snippet to new scheme Akira Yokosawa
2019-10-22 15:51         ` Paul E. McKenney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191022155137.GF2479@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=akiyks@gmail.com \
    --cc=bsingharora@gmail.com \
    --cc=perfbook@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.