Skip to contentSkip to conversation

RT: plist namespace cleanup

PATCH In review Daniel Walker 2 participants 5 messages Dec 21, 2005 – Dec 22, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 RT: plist namespace cleanup

Make the plist namespace consistent.

include/linux/plist.h +31 -31
Index: linux-2.6.14/include/linux/plist.h
===================================================================
@@ -79,64 +79,64 @@
 
 #include <linux/list.h>
 
-struct pl_head {
+struct plist_head {
 	struct list_head prio_list;
 	struct list_head node_list;
 };
 
-struct pl_node {
-	int		prio;
-	struct pl_head	plist;
+struct plist_node {
+	int			prio;
+	struct plist_head	plist;
 };
 
 /** 
- * #PL_HEAD_INIT - static struct pl_head initializer
+ * #PLIST_HEAD_INIT - static struct plist_head initializer
  *
- * @head:	struct pl_head variable name
+ * @head:	struct plist_head variable name
  */
-#define PL_HEAD_INIT(head)	\
+#define PLIST_HEAD_INIT(head)	\
 {							\
 	.prio_list = LIST_HEAD_INIT((head).prio_list),	\
 	.node_list = LIST_HEAD_INIT((head).node_list),	\
 }
 
 /** 
- * #PL_NODE_INIT - static struct pl_node initializer
+ * #PLIST_NODE_INIT - static struct plist_node initializer
  *
- * @node:	struct pl_node variable name
+ * @node:	struct plist_node variable name
  * @__prio:	initial node priority	
  */
-#define PL_NODE_INIT(node, __prio)	\
+#define PLIST_NODE_INIT(node, __prio)	\
 {							\
 	.prio  = (__prio),				\
-	.plist = PL_HEAD_INIT((node).plist),		\
+	.plist = PLIST_HEAD_INIT((node).plist),		\
 }
 
 /**
- * pl_head_init - dynamic struct pl_head initializer
+ * plist_head_init - dynamic struct plist_head initializer
  *
- * @head:	&struct pl_head pointer
+ * @head:	&struct plist_head pointer
  */ 
-static inline void pl_head_init(struct pl_head *head)
+static inline void plist_head_init(struct plist_head *head)
 {
 	INIT_LIST_HEAD(&head->prio_list);
 	INIT_LIST_HEAD(&head->node_list);
 }
 
 /**
- * pl_node_init - Dynamic struct pl_node initializer
+ * plist_node_init - Dynamic struct plist_node initializer
  *
- * @node:	&struct pl_node pointer
+ * @node:	&struct plist_node pointer
  * @prio:	initial node priority
  */
-static inline void pl_node_init(struct pl_node *node, int prio)
+static inline void plist_node_init(struct plist_node *node, int prio)
 {
 	node->prio = prio;
-	pl_head_init(&node->plist);
+	plist_head_init(&node->plist);
 }
 
-extern void plist_add(struct pl_node *node, struct pl_head *head);
-extern void plist_del(struct pl_node *node);
+extern void plist_add(struct plist_node *node, struct plist_head *head);
+extern void plist_del(struct plist_node *node);
 
 /**
  * plist_for_each - iterate over the plist
@@ -181,31 +181,31 @@ extern void plist_del(struct pl_node *no
 	 list_for_each_entry_safe(pos, n, &(head)->node_list, mem.plist.node_list)
 
 /** 
- * plist_empty - return !0 if plist is empty
+ * plist_empty_empty - return !0 if plist is empty
  *
- * @head:	&struct pl_head pointer 
+ * @head:	&struct plist_head pointer 
  */
-static inline int plist_empty(const struct pl_head *head)
+static inline int plist_empty_head(const struct plist_head *head)
 {
 	return list_empty(&head->node_list);
 }
 
 /** 
- * plist_unhashed - return !0 if plist node is not on a list
+ * plist_empty_node - return !0 if plist node is not on a list
  *
- * @node:	&struct pl_node pointer 
+ * @node:	&struct plist_node pointer 
  */
-static inline int plist_unhashed(const struct pl_node *node)
+static inline int plist_empty_node(const struct plist_node *node)
 {
 	return list_empty(&node->plist.node_list);
 }
 
-/* All functions below assume the pl_head is not empty. */
+/* All functions below assume the plist_head is not empty. */
 
 /**
  * plist_first_entry - get the struct for the first entry
  *
- * @ptr:        the &struct pl_head pointer.
+ * @ptr:        the &struct plist_head pointer.
  * @type:       the type of the struct this is embedded in.
  * @member:     the name of the list_struct within the struct.
  */
@@ -215,13 +215,13 @@ static inline int plist_unhashed(const s
 /** 
  * plist_first - return the first node (and thus, highest priority)
  *
- * @head:	the &struct pl_head pointer
+ * @head:	the &struct plist_head pointer
  *
  * Assumes the plist is _not_ empty.
  */
-static inline struct pl_node* plist_first(const struct pl_head *head)
+static inline struct plist_node* plist_first(const struct plist_head *head)
 {
-	return list_entry(head->node_list.next, struct pl_node, plist.node_list);
+	return list_entry(head->node_list.next, struct plist_node, plist.node_list);
 }
 
 #endif
include/linux/sched.h +1 -1
Index: linux-2.6.14/include/linux/sched.h
===================================================================
@@ -1026,7 +1026,7 @@ struct task_struct {
 #endif
 	/* realtime bits */
 	struct list_head delayed_put;
-	struct pl_head pi_waiters;
+	struct plist_head pi_waiters;
 
 	/* RT deadlock detection and priority inheritance handling */
 	struct rt_mutex_waiter *blocked_on;
kernel/fork.c +1 -1
Index: linux-2.6.14/kernel/fork.c
===================================================================
@@ -1027,7 +1027,7 @@ static task_t *copy_process(unsigned lon
 #endif
 	INIT_LIST_HEAD(&p->delayed_put);
 	preempt_disable();
-	pl_head_init(&p->pi_waiters);
+	plist_head_init(&p->pi_waiters);
 	preempt_enable();
 	p->blocked_on = NULL; /* not blocked yet */
 	spin_lock_init(&p->pi_lock);
lib/plist.c +7 -7
Index: linux-2.6.14/lib/plist.c
===================================================================
@@ -24,12 +24,12 @@
  * plist_add - add @node to @head returns !0 if the plist prio changed, 0
  * otherwise. XXX: Fix return code.
  *
- * @node:	&struct pl_node pointer
- * @head:	&struct pl_head pointer
+ * @node:	&struct plist_node pointer
+ * @head:	&struct plist_head pointer
  */
-void plist_add(struct pl_node *node, struct pl_head *head)
+void plist_add(struct plist_node *node, struct plist_head *head)
 {
-	struct pl_node *iter;
+	struct plist_node *iter;
 
 	INIT_LIST_HEAD(&node->plist.prio_list);
 
@@ -38,7 +38,7 @@ void plist_add(struct pl_node *node, str
 			goto lt_prio;
 		else if (node->prio == iter->prio) {
 			iter = list_entry(iter->plist.prio_list.next,
-					struct pl_node, plist.prio_list);
+					struct plist_node, plist.prio_list);
 			goto eq_prio;
 		}
 
@@ -52,9 +52,9 @@ eq_prio:
  * plist_del - Remove a @node from plist. returns !0 if the plist prio
  * changed, 0 otherwise. XXX: Fix return code.
  *
- * @node:	&struct pl_node pointer
+ * @node:	&struct plist_node pointer
  */
-void plist_del(struct pl_node *node)
+void plist_del(struct plist_node *node)
 {
 	if (!list_empty(&node->plist.prio_list)) {
 		struct pl_node *next = plist_first(&node->plist);
include/linux/init_task.h +1 -1
Index: linux-2.6.14/include/linux/init_task.h
===================================================================
@@ -121,7 +121,7 @@ extern struct group_info init_groups;
 	.alloc_lock	= SPIN_LOCK_UNLOCKED(tsk.alloc_lock),		\
 	.proc_lock	= SPIN_LOCK_UNLOCKED(tsk.proc_lock),		\
 	.delayed_put	= LIST_HEAD_INIT(tsk.delayed_put),		\
-	.pi_waiters	= PL_HEAD_INIT(tsk.pi_waiters),			\
+	.pi_waiters	= PLIST_HEAD_INIT(tsk.pi_waiters),		\
 	.pi_lock	= RAW_SPIN_LOCK_UNLOCKED,			\
 	.journal_info	= NULL,						\
 	.cpu_timers	= INIT_CPU_TIMERS(tsk.cpu_timers),		\
kernel/rt.c +28 -28

201 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Daniel Walker

Make the plist namespace consistent.

I think plist_head is much better than pl_head.

However I think plist_empty/plist_unhashed is more accurate than plist_head_empty/plist_node_empty, but I am rather agnostic to naming.

Ingo, do you have any preferences?

Daniel, it would be great if you can check that kernel/rt.o was not changed after rename (as it should be).

Oleg.

#2 lore raw
Quoted 9 lines · Oleg Nesterov
Quoted 2 lines · Daniel Walker

Make the plist namespace consistent.

I think plist_head is much better than pl_head.

However I think plist_empty/plist_unhashed is more accurate than plist_head_empty/plist_node_empty, but I am rather agnostic to naming.

unhashed seems very meaningless . We're not hashing anything.

Quoted 2 lines

Daniel, it would be great if you can check that kernel/rt.o was not changed after rename (as it should be).

I didn't check, but I made no code changes so it should be any different.

Daniel

#3 lore raw
Quoted 6 lines · Daniel Walker
Quoted 4 lines · Oleg Nesterov
Quoted 2 lines · Daniel Walker

Make the plist namespace consistent.

Quoted 7 lines
Quoted 5 lines

I think plist_head is much better than pl_head.

However I think plist_empty/plist_unhashed is more accurate than plist_head_empty/plist_node_empty, but I am rather agnostic to naming.

unhashed seems very meaningless . We're not hashing anything.

Still we already have hlist_empty/hlist_unhashed

Quoted 5 lines
Quoted 2 lines

Daniel, it would be great if you can check that kernel/rt.o was not changed after rename (as it should be).

I didn't check, but I made no code changes so it should be any different.

That is why I asked. It is very easy to make a mistake by accident while doing trivial changes, but it is not easy to notice.

Oleg.

#4 lore raw
Quoted 9 lines · Oleg Nesterov
Quoted 8 lines · Daniel Walker
Quoted 6 lines · Oleg Nesterov
Quoted 2 lines · Daniel Walker

Make the plist namespace consistent.

I think plist_head is much better than pl_head.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

However I think plist_empty/plist_unhashed is more accurate than plist_head_empty/plist_node_empty, but I am rather agnostic to naming.

unhashed seems very meaningless . We're not hashing anything.

Still we already have hlist_empty/hlist_unhashed

That's more connected with hashing , since that's were it gets used. In this case we're not hashing , or even related to hashing.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Daniel, it would be great if you can check that kernel/rt.o was not changed after rename (as it should be).

I didn't check, but I made no code changes so it should be any different.

That is why I asked. It is very easy to make a mistake by accident while doing trivial changes, but it is not easy to notice.

I reviewed it prior to submitting it .

Daniel