Linux Kernel Mentees Archive on lore.kernel.org
 help / color / Atom feed
* [Linux-kernel-mentees] [PATCH] rculist.h: Add list_tail_rcu()
@ 2019-12-09  7:50 madhuparnabhowmik04
  2019-12-09 18:33 ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: madhuparnabhowmik04 @ 2019-12-09  7:50 UTC (permalink / raw)
  To: paulmck, joel; +Cc: rcu, linux-kernel-mentees, linux-kernel

From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>

This patch adds the macro list_tail_rcu() and document it.

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
---
 include/linux/rculist.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 4b7ae1bf50b3..9f21efa525ab 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -40,6 +40,16 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
  */
 #define list_next_rcu(list)	(*((struct list_head __rcu **)(&(list)->next)))
 
+/**
+ * list_tail_rcu - returns the prev pointer of the head of the list
+ * @head: the head of the list
+ *
+ * Note: This should only be used with the list header,
+ * but only if list_del() and similar primitives are not
+ * also used on the list header.
+ */
+#define list_tail_rcu(head)	(*((struct list_head __rcu **)(&(head)->prev)))
+
 /*
  * Check during list traversal that we are within an RCU reader
  */
-- 
2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Linux-kernel-mentees] [PATCH] rculist.h: Add list_tail_rcu()
  2019-12-09  7:50 [Linux-kernel-mentees] [PATCH] rculist.h: Add list_tail_rcu() madhuparnabhowmik04
@ 2019-12-09 18:33 ` Paul E. McKenney
  2019-12-09 19:30   ` Madhuparna Bhowmik
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2019-12-09 18:33 UTC (permalink / raw)
  To: madhuparnabhowmik04; +Cc: joel, rcu, linux-kernel-mentees, linux-kernel

On Mon, Dec 09, 2019 at 01:20:43PM +0530, madhuparnabhowmik04@gmail.com wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> 
> This patch adds the macro list_tail_rcu() and document it.
> 
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>

Queued with slight edits, thank you very much!

							Thanx, Paul

> ---
>  include/linux/rculist.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/linux/rculist.h b/include/linux/rculist.h
> index 4b7ae1bf50b3..9f21efa525ab 100644
> --- a/include/linux/rculist.h
> +++ b/include/linux/rculist.h
> @@ -40,6 +40,16 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
>   */
>  #define list_next_rcu(list)	(*((struct list_head __rcu **)(&(list)->next)))
>  
> +/**
> + * list_tail_rcu - returns the prev pointer of the head of the list
> + * @head: the head of the list
> + *
> + * Note: This should only be used with the list header,
> + * but only if list_del() and similar primitives are not
> + * also used on the list header.
> + */
> +#define list_tail_rcu(head)	(*((struct list_head __rcu **)(&(head)->prev)))
> +
>  /*
>   * Check during list traversal that we are within an RCU reader
>   */
> -- 
> 2.17.1
> 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Linux-kernel-mentees] [PATCH] rculist.h: Add list_tail_rcu()
  2019-12-09 18:33 ` Paul E. McKenney
@ 2019-12-09 19:30   ` Madhuparna Bhowmik
  0 siblings, 0 replies; 3+ messages in thread
From: Madhuparna Bhowmik @ 2019-12-09 19:30 UTC (permalink / raw)
  To: paulmck; +Cc: Joel Fernandes, rcu, linux-kernel-mentees, linux-kernel

[-- Attachment #1.1: Type: text/plain, Size: 1535 bytes --]

On Tue, Dec 10, 2019 at 12:03 AM Paul E. McKenney <paulmck@kernel.org>
wrote:

> On Mon, Dec 09, 2019 at 01:20:43PM +0530, madhuparnabhowmik04@gmail.com
> wrote:
> > From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
> >
> > This patch adds the macro list_tail_rcu() and document it.
> >
> > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
>
> Queued with slight edits, thank you very much!
>
> Thank you!

Regards,
Madhuparna

>                                                         Thanx, Paul
>
> > ---
> >  include/linux/rculist.h | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/include/linux/rculist.h b/include/linux/rculist.h
> > index 4b7ae1bf50b3..9f21efa525ab 100644
> > --- a/include/linux/rculist.h
> > +++ b/include/linux/rculist.h
> > @@ -40,6 +40,16 @@ static inline void INIT_LIST_HEAD_RCU(struct
> list_head *list)
> >   */
> >  #define list_next_rcu(list)  (*((struct list_head __rcu
> **)(&(list)->next)))
> >
> > +/**
> > + * list_tail_rcu - returns the prev pointer of the head of the list
> > + * @head: the head of the list
> > + *
> > + * Note: This should only be used with the list header,
> > + * but only if list_del() and similar primitives are not
> > + * also used on the list header.
> > + */
> > +#define list_tail_rcu(head)  (*((struct list_head __rcu
> **)(&(head)->prev)))
> > +
> >  /*
> >   * Check during list traversal that we are within an RCU reader
> >   */
> > --
> > 2.17.1
> >
>
[-- Attachment #1.2: Type: text/html, Size: 2761 bytes --]

<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 10, 2019 at 12:03 AM Paul E. McKenney &lt;<a href="mailto:paulmck@kernel.org">paulmck@kernel.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Dec 09, 2019 at 01:20:43PM +0530, <a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a> wrote:<br>
&gt; From: Madhuparna Bhowmik &lt;<a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a>&gt;<br>
&gt; <br>
&gt; This patch adds the macro list_tail_rcu() and document it.<br>
&gt; <br>
&gt; Signed-off-by: Madhuparna Bhowmik &lt;<a href="mailto:madhuparnabhowmik04@gmail.com" target="_blank">madhuparnabhowmik04@gmail.com</a>&gt;<br>
<br>
Queued with slight edits, thank you very much!<br>
<br></blockquote><div>Thank you!</div><div><br></div><div>Regards,</div><div>Madhuparna </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                                        Thanx, Paul<br>
<br>
&gt; ---<br>
&gt;  include/linux/rculist.h | 10 ++++++++++<br>
&gt;  1 file changed, 10 insertions(+)<br>
&gt; <br>
&gt; diff --git a/include/linux/rculist.h b/include/linux/rculist.h<br>
&gt; index 4b7ae1bf50b3..9f21efa525ab 100644<br>
&gt; --- a/include/linux/rculist.h<br>
&gt; +++ b/include/linux/rculist.h<br>
&gt; @@ -40,6 +40,16 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)<br>
&gt;   */<br>
&gt;  #define list_next_rcu(list)  (*((struct list_head __rcu **)(&amp;(list)-&gt;next)))<br>
&gt;  <br>
&gt; +/**<br>
&gt; + * list_tail_rcu - returns the prev pointer of the head of the list<br>
&gt; + * @head: the head of the list<br>
&gt; + *<br>
&gt; + * Note: This should only be used with the list header,<br>
&gt; + * but only if list_del() and similar primitives are not<br>
&gt; + * also used on the list header.<br>
&gt; + */<br>
&gt; +#define list_tail_rcu(head)  (*((struct list_head __rcu **)(&amp;(head)-&gt;prev)))<br>
&gt; +<br>
&gt;  /*<br>
&gt;   * Check during list traversal that we are within an RCU reader<br>
&gt;   */<br>
&gt; -- <br>
&gt; 2.17.1<br>
&gt; <br>
</blockquote></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=abWFkaHVwYXJuYWJob3dtaWswNEBnbWFpbC5jb20%3D&amp;type=zerocontent&amp;guid=9f376a5a-0080-4476-85b6-1a97970d40ec"><font color="#ffffff" size="1">ᐧ</font></div>

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09  7:50 [Linux-kernel-mentees] [PATCH] rculist.h: Add list_tail_rcu() madhuparnabhowmik04
2019-12-09 18:33 ` Paul E. McKenney
2019-12-09 19:30   ` Madhuparna Bhowmik

Linux Kernel Mentees Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kernel-mentees/0 linux-kernel-mentees/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kernel-mentees linux-kernel-mentees/ https://lore.kernel.org/linux-kernel-mentees \
		linux-kernel-mentees@lists.linuxfoundation.org
	public-inbox-index linux-kernel-mentees

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxfoundation.lists.linux-kernel-mentees


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git