public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* missing sched.h comments
@ 2003-03-27  8:31 William Lee Irwin III
  2003-03-27  8:36 ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: William Lee Irwin III @ 2003-03-27  8:31 UTC (permalink / raw)
  To: linux-kernel

Tidy up sched.h a bit.

(1) ->personality has a "???" comment sitting above it. Comment it.
(2) a comment referring to the nonexistent field ->father from before
	the pidhash merge persists. Remove the comment. The replacements
	are all already commented.
(3) ->did_exec, ->leader, ->used_math, and ->keep_capabilities are all
	boolean, and may fit into the same word. Also comment them.

 sched.h |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)


diff -urpN merge-2.5.66-9/include/linux/sched.h merge-2.5.66-10/include/linux/sched.h
--- merge-2.5.66-9/include/linux/sched.h	2003-03-24 14:00:00.000000000 -0800
+++ merge-2.5.66-10/include/linux/sched.h	2003-03-26 23:52:38.000000000 -0800
@@ -344,21 +344,16 @@ struct task_struct {
 	struct linux_binfmt *binfmt;
 	int exit_code, exit_signal;
 	int pdeath_signal;  /*  The signal sent when the parent dies  */
-	/* ??? */
-	unsigned long personality;
-	int did_exec:1;
+	unsigned long personality; /* personality, which ABI to emulate */
 	pid_t pid;
 	pid_t pgrp;
 	pid_t tty_old_pgrp;
 	pid_t session;
 	pid_t tgid;
-	/* boolean value for session group leader */
-	int leader;
-	/* 
-	 * pointers to (original) parent process, youngest child, younger sibling,
-	 * older sibling, respectively.  (p->father can be replaced with 
-	 * p->parent->pid)
-	 */
+	unsigned int leader:1,		/* the task is a session leader */
+		keep_capabilities:1,	/* keep caps after dropping uid 0 */
+		used_math:1,		/* whether the FPU was used */
+		did_exec:1;		/* has the process exec()'d */
 	struct task_struct *real_parent; /* real parent process (when being debugged) */
 	struct task_struct *parent;	/* parent process */
 	struct list_head children;	/* list of my children */
@@ -388,11 +383,9 @@ struct task_struct {
 	int ngroups;
 	gid_t	groups[NGROUPS];
 	kernel_cap_t   cap_effective, cap_inheritable, cap_permitted;
-	int keep_capabilities:1;
 	struct user_struct *user;
 /* limits */
 	struct rlimit rlim[RLIM_NLIMITS];
-	unsigned short used_math;
 	char comm[16];
 /* file system info */
 	int link_count, total_link_count;

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

* Re: missing sched.h comments
  2003-03-27  8:31 missing sched.h comments William Lee Irwin III
@ 2003-03-27  8:36 ` Russell King
  2003-03-27  8:44   ` William Lee Irwin III
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2003-03-27  8:36 UTC (permalink / raw)
  To: William Lee Irwin III, linux-kernel

On Thu, Mar 27, 2003 at 12:31:24AM -0800, William Lee Irwin III wrote:
> (3) ->did_exec, ->leader, ->used_math, and ->keep_capabilities are all
> 	boolean, and may fit into the same word. Also comment them.

Please don't combine used_math - this is set by assembly code, and you
can't pass the bit offset of this to asm.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


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

* Re: missing sched.h comments
  2003-03-27  8:36 ` Russell King
@ 2003-03-27  8:44   ` William Lee Irwin III
  0 siblings, 0 replies; 3+ messages in thread
From: William Lee Irwin III @ 2003-03-27  8:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: rmk

On Thu, Mar 27, 2003 at 12:31:24AM -0800, William Lee Irwin III wrote:
>> (3) ->did_exec, ->leader, ->used_math, and ->keep_capabilities are all
>> 	boolean, and may fit into the same word. Also comment them.

On Thu, Mar 27, 2003 at 08:36:05AM +0000, Russell King wrote:
> Please don't combine used_math - this is set by assembly code, and you
> can't pass the bit offset of this to asm.

Yuck. I'll not mess with that one, then. But it probably needs a comment:

Tidy up sched.h a bit.

(1) ->personality has a "???" comment sitting above it. Comment it.
(2) a comment referring to the nonexistent field ->father from before
	the pidhash merge persists. Remove the comment. The replacements
	are all already commented.
(3) ->did_exec, ->leader, and ->keep_capabilities are all boolean, and
	may fit into the same word. Also comment them.
(4) used_math is used by assembly, leave it alone, but comment that.

 sched.h |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)


diff -urpN merge-2.5.66-9/include/linux/sched.h merge-2.5.66-10/include/linux/sched.h
--- merge-2.5.66-9/include/linux/sched.h	2003-03-24 14:00:00.000000000 -0800
+++ merge-2.5.66-10/include/linux/sched.h	2003-03-27 00:28:39.000000000 -0800
@@ -344,21 +344,16 @@ struct task_struct {
 	struct linux_binfmt *binfmt;
 	int exit_code, exit_signal;
 	int pdeath_signal;  /*  The signal sent when the parent dies  */
-	/* ??? */
-	unsigned long personality;
-	int did_exec:1;
+	unsigned long personality; /* personality, which ABI to emulate */
 	pid_t pid;
 	pid_t pgrp;
 	pid_t tty_old_pgrp;
 	pid_t session;
 	pid_t tgid;
-	/* boolean value for session group leader */
-	int leader;
-	/* 
-	 * pointers to (original) parent process, youngest child, younger sibling,
-	 * older sibling, respectively.  (p->father can be replaced with 
-	 * p->parent->pid)
-	 */
+	unsigned int leader:1,		/* boolean value for session leader */
+		keep_capabilities:1,	/* keep caps after dropping uid 0 */
+		did_exec:1;		/* has the process exec()'d */
+	unsigned short used_math;	/* was the FPU used -- touched by asm */
 	struct task_struct *real_parent; /* real parent process (when being debugged) */
 	struct task_struct *parent;	/* parent process */
 	struct list_head children;	/* list of my children */
@@ -388,11 +383,9 @@ struct task_struct {
 	int ngroups;
 	gid_t	groups[NGROUPS];
 	kernel_cap_t   cap_effective, cap_inheritable, cap_permitted;
-	int keep_capabilities:1;
 	struct user_struct *user;
 /* limits */
 	struct rlimit rlim[RLIM_NLIMITS];
-	unsigned short used_math;
 	char comm[16];
 /* file system info */
 	int link_count, total_link_count;

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

end of thread, other threads:[~2003-03-27  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-27  8:31 missing sched.h comments William Lee Irwin III
2003-03-27  8:36 ` Russell King
2003-03-27  8:44   ` William Lee Irwin III

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