mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched: Fixed typo in comment
@ 2023-07-17  6:49 Chin Yik Ming
  2023-07-17  8:16 ` Daniel Bristot de Oliveira
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chin Yik Ming @ 2023-07-17  6:49 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot
  Cc: dietmar.eggemann, rostedt, bsegall, mgorman, bristot, vschneid,
	linux-kernel, Chin Yik Ming

task_struct's state member is prefixed by "__"

Signed-off-by: Chin Yik Ming <yikming2222@gmail.com>
---
 include/linux/sched.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 609bde814..942c61dce 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -75,14 +75,14 @@ struct user_event_mm;
  * Task state bitmask. NOTE! These bits are also
  * encoded in fs/proc/array.c: get_task_state().
  *
- * We have two separate sets of flags: task->state
+ * We have two separate sets of flags: task->__state
  * is about runnability, while task->exit_state are
  * about the task exiting. Confusing, but this way
  * modifying one set can't modify the other one by
  * mistake.
  */
 
-/* Used in tsk->state: */
+/* Used in tsk->__state: */
 #define TASK_RUNNING			0x00000000
 #define TASK_INTERRUPTIBLE		0x00000001
 #define TASK_UNINTERRUPTIBLE		0x00000002
@@ -92,7 +92,7 @@ struct user_event_mm;
 #define EXIT_DEAD			0x00000010
 #define EXIT_ZOMBIE			0x00000020
 #define EXIT_TRACE			(EXIT_ZOMBIE | EXIT_DEAD)
-/* Used in tsk->state again: */
+/* Used in tsk->__state again: */
 #define TASK_PARKED			0x00000040
 #define TASK_DEAD			0x00000080
 #define TASK_WAKEKILL			0x00000100
@@ -173,7 +173,7 @@ struct user_event_mm;
 #endif
 
 /*
- * set_current_state() includes a barrier so that the write of current->state
+ * set_current_state() includes a barrier so that the write of current->__state
  * is correctly serialised wrt the caller's subsequent test of whether to
  * actually sleep:
  *
@@ -196,9 +196,9 @@ struct user_event_mm;
  *   wake_up_state(p, TASK_UNINTERRUPTIBLE);
  *
  * where wake_up_state()/try_to_wake_up() executes a full memory barrier before
- * accessing p->state.
+ * accessing p->__state.
  *
- * Wakeup will do: if (@state & p->state) p->state = TASK_RUNNING, that is,
+ * Wakeup will do: if (@state & p->__state) p->__state = TASK_RUNNING, that is,
  * once it observes the TASK_UNINTERRUPTIBLE store the waking CPU can issue a
  * TASK_RUNNING store which can collide with __set_current_state(TASK_RUNNING).
  *
-- 
2.34.1


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

* Re: [PATCH] sched: Fixed typo in comment
  2023-07-17  6:49 [PATCH] sched: Fixed typo in comment Chin Yik Ming
@ 2023-07-17  8:16 ` Daniel Bristot de Oliveira
  2023-07-17 10:55 ` Peter Zijlstra
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Daniel Bristot de Oliveira @ 2023-07-17  8:16 UTC (permalink / raw)
  To: Chin Yik Ming, mingo, peterz, juri.lelli, vincent.guittot
  Cc: dietmar.eggemann, rostedt, bsegall, mgorman, vschneid, linux-kernel

On 7/17/23 08:49, Chin Yik Ming wrote:
> task_struct's state member is prefixed by "__"
> 
> Signed-off-by: Chin Yik Ming <yikming2222@gmail.com>

Reviewed-by: Daniel Bristot de Oliveira <bristot@kernel.org>

-- Daniel


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

* Re: [PATCH] sched: Fixed typo in comment
  2023-07-17  6:49 [PATCH] sched: Fixed typo in comment Chin Yik Ming
  2023-07-17  8:16 ` Daniel Bristot de Oliveira
@ 2023-07-17 10:55 ` Peter Zijlstra
  2023-07-17 12:56 ` [tip: sched/core] sched/headers: Rename task_struct::state to task_strate::__state in the comments too tip-bot2 for Chin Yik Ming
  2023-07-19  7:47 ` [tip: sched/core] sched/headers: Rename task_struct::state to task_struct::__state " tip-bot2 for Chin Yik Ming
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Zijlstra @ 2023-07-17 10:55 UTC (permalink / raw)
  To: Chin Yik Ming
  Cc: mingo, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
	bsegall, mgorman, bristot, vschneid, linux-kernel

On Mon, Jul 17, 2023 at 02:49:52PM +0800, Chin Yik Ming wrote:
> task_struct's state member is prefixed by "__"

This isn't a typo, the member got renamed long after these comments were
written.

Also, nobody should be accessing task->__state, so it being spelled
wrong in a comment doesn't seem like a problem to me.

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

* [tip: sched/core] sched/headers: Rename task_struct::state to task_strate::__state in the comments too
  2023-07-17  6:49 [PATCH] sched: Fixed typo in comment Chin Yik Ming
  2023-07-17  8:16 ` Daniel Bristot de Oliveira
  2023-07-17 10:55 ` Peter Zijlstra
@ 2023-07-17 12:56 ` tip-bot2 for Chin Yik Ming
  2023-07-19  7:47 ` [tip: sched/core] sched/headers: Rename task_struct::state to task_struct::__state " tip-bot2 for Chin Yik Ming
  3 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Chin Yik Ming @ 2023-07-17 12:56 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Chin Yik Ming, Ingo Molnar, Daniel Bristot de Oliveira, x86,
	linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     2ae2fb98b77339277a2c2f18dfec605dfd8dd321
Gitweb:        https://git.kernel.org/tip/2ae2fb98b77339277a2c2f18dfec605dfd8dd321
Author:        Chin Yik Ming <yikming2222@gmail.com>
AuthorDate:    Mon, 17 Jul 2023 14:49:52 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 17 Jul 2023 11:03:55 +02:00

sched/headers: Rename task_struct::state to task_strate::__state in the comments too

The rename in 2f064a59a11f ("sched: Change task_struct::state") missed the
comments.

[ mingo: Improved the changelog. ]

Signed-off-by: Chin Yik Ming <yikming2222@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Link: https://lore.kernel.org/r/20230717064952.2804-1-yikming2222@gmail.com
---
 include/linux/sched.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index efc9f4b..2aab7be 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -75,14 +75,14 @@ struct user_event_mm;
  * Task state bitmask. NOTE! These bits are also
  * encoded in fs/proc/array.c: get_task_state().
  *
- * We have two separate sets of flags: task->state
+ * We have two separate sets of flags: task->__state
  * is about runnability, while task->exit_state are
  * about the task exiting. Confusing, but this way
  * modifying one set can't modify the other one by
  * mistake.
  */
 
-/* Used in tsk->state: */
+/* Used in tsk->__state: */
 #define TASK_RUNNING			0x00000000
 #define TASK_INTERRUPTIBLE		0x00000001
 #define TASK_UNINTERRUPTIBLE		0x00000002
@@ -92,7 +92,7 @@ struct user_event_mm;
 #define EXIT_DEAD			0x00000010
 #define EXIT_ZOMBIE			0x00000020
 #define EXIT_TRACE			(EXIT_ZOMBIE | EXIT_DEAD)
-/* Used in tsk->state again: */
+/* Used in tsk->__state again: */
 #define TASK_PARKED			0x00000040
 #define TASK_DEAD			0x00000080
 #define TASK_WAKEKILL			0x00000100
@@ -173,7 +173,7 @@ struct user_event_mm;
 #endif
 
 /*
- * set_current_state() includes a barrier so that the write of current->state
+ * set_current_state() includes a barrier so that the write of current->__state
  * is correctly serialised wrt the caller's subsequent test of whether to
  * actually sleep:
  *
@@ -196,9 +196,9 @@ struct user_event_mm;
  *   wake_up_state(p, TASK_UNINTERRUPTIBLE);
  *
  * where wake_up_state()/try_to_wake_up() executes a full memory barrier before
- * accessing p->state.
+ * accessing p->__state.
  *
- * Wakeup will do: if (@state & p->state) p->state = TASK_RUNNING, that is,
+ * Wakeup will do: if (@state & p->__state) p->__state = TASK_RUNNING, that is,
  * once it observes the TASK_UNINTERRUPTIBLE store the waking CPU can issue a
  * TASK_RUNNING store which can collide with __set_current_state(TASK_RUNNING).
  *

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

* [tip: sched/core] sched/headers: Rename task_struct::state to task_struct::__state in the comments too
  2023-07-17  6:49 [PATCH] sched: Fixed typo in comment Chin Yik Ming
                   ` (2 preceding siblings ...)
  2023-07-17 12:56 ` [tip: sched/core] sched/headers: Rename task_struct::state to task_strate::__state in the comments too tip-bot2 for Chin Yik Ming
@ 2023-07-19  7:47 ` tip-bot2 for Chin Yik Ming
  3 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Chin Yik Ming @ 2023-07-19  7:47 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Chin Yik Ming, Ingo Molnar, Daniel Bristot de Oliveira, x86,
	linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     48b5583719cdfbdee238f9549a6a1a47af2b0469
Gitweb:        https://git.kernel.org/tip/48b5583719cdfbdee238f9549a6a1a47af2b0469
Author:        Chin Yik Ming <yikming2222@gmail.com>
AuthorDate:    Mon, 17 Jul 2023 14:49:52 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 19 Jul 2023 09:42:58 +02:00

sched/headers: Rename task_struct::state to task_struct::__state in the comments too

The rename in 2f064a59a11f ("sched: Change task_struct::state") missed the
comments.

[ mingo: Improved the changelog. ]

Signed-off-by: Chin Yik Ming <yikming2222@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Link: https://lore.kernel.org/r/20230717064952.2804-1-yikming2222@gmail.com
---
 include/linux/sched.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index efc9f4b..2aab7be 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -75,14 +75,14 @@ struct user_event_mm;
  * Task state bitmask. NOTE! These bits are also
  * encoded in fs/proc/array.c: get_task_state().
  *
- * We have two separate sets of flags: task->state
+ * We have two separate sets of flags: task->__state
  * is about runnability, while task->exit_state are
  * about the task exiting. Confusing, but this way
  * modifying one set can't modify the other one by
  * mistake.
  */
 
-/* Used in tsk->state: */
+/* Used in tsk->__state: */
 #define TASK_RUNNING			0x00000000
 #define TASK_INTERRUPTIBLE		0x00000001
 #define TASK_UNINTERRUPTIBLE		0x00000002
@@ -92,7 +92,7 @@ struct user_event_mm;
 #define EXIT_DEAD			0x00000010
 #define EXIT_ZOMBIE			0x00000020
 #define EXIT_TRACE			(EXIT_ZOMBIE | EXIT_DEAD)
-/* Used in tsk->state again: */
+/* Used in tsk->__state again: */
 #define TASK_PARKED			0x00000040
 #define TASK_DEAD			0x00000080
 #define TASK_WAKEKILL			0x00000100
@@ -173,7 +173,7 @@ struct user_event_mm;
 #endif
 
 /*
- * set_current_state() includes a barrier so that the write of current->state
+ * set_current_state() includes a barrier so that the write of current->__state
  * is correctly serialised wrt the caller's subsequent test of whether to
  * actually sleep:
  *
@@ -196,9 +196,9 @@ struct user_event_mm;
  *   wake_up_state(p, TASK_UNINTERRUPTIBLE);
  *
  * where wake_up_state()/try_to_wake_up() executes a full memory barrier before
- * accessing p->state.
+ * accessing p->__state.
  *
- * Wakeup will do: if (@state & p->state) p->state = TASK_RUNNING, that is,
+ * Wakeup will do: if (@state & p->__state) p->__state = TASK_RUNNING, that is,
  * once it observes the TASK_UNINTERRUPTIBLE store the waking CPU can issue a
  * TASK_RUNNING store which can collide with __set_current_state(TASK_RUNNING).
  *

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

end of thread, other threads:[~2023-07-19  7:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-17  6:49 [PATCH] sched: Fixed typo in comment Chin Yik Ming
2023-07-17  8:16 ` Daniel Bristot de Oliveira
2023-07-17 10:55 ` Peter Zijlstra
2023-07-17 12:56 ` [tip: sched/core] sched/headers: Rename task_struct::state to task_strate::__state in the comments too tip-bot2 for Chin Yik Ming
2023-07-19  7:47 ` [tip: sched/core] sched/headers: Rename task_struct::state to task_struct::__state " tip-bot2 for Chin Yik Ming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome