job control: rename signal->group_stop and flags to jobctl and update them
signal->group_stop currently hosts mostly group stop related flags; however, it's gonna be used for wider purposes and the GROUP_STOP_ flag prefix becomes confusing. Rename signal->group_stop to signal->jobctl and rename all GROUP_STOP_* flags to JOBCTL_*. Bit position macros JOBCTL_*_BIT are defined and JOBCTL_* flags are defined in terms of them to allow using bitops later. While at it, reassign JOBCTL_TRAPPING to bit 22 to better accomodate future additions. This doesn't cause any functional change. -v2: JOBCTL_*_BIT macros added as suggested by Linus. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
This commit is contained in:
@@ -1282,7 +1282,7 @@ struct task_struct {
|
||||
int exit_state;
|
||||
int exit_code, exit_signal;
|
||||
int pdeath_signal; /* The signal sent when the parent dies */
|
||||
unsigned int group_stop; /* GROUP_STOP_*, siglock protected */
|
||||
unsigned int jobctl; /* JOBCTL_*, siglock protected */
|
||||
/* ??? */
|
||||
unsigned int personality;
|
||||
unsigned did_exec:1;
|
||||
@@ -1803,15 +1803,21 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
|
||||
#define used_math() tsk_used_math(current)
|
||||
|
||||
/*
|
||||
* task->group_stop flags
|
||||
* task->jobctl flags
|
||||
*/
|
||||
#define GROUP_STOP_SIGMASK 0xffff /* signr of the last group stop */
|
||||
#define GROUP_STOP_PENDING (1 << 16) /* task should stop for group stop */
|
||||
#define GROUP_STOP_CONSUME (1 << 17) /* consume group stop count */
|
||||
#define GROUP_STOP_TRAPPING (1 << 18) /* switching from STOPPED to TRACED */
|
||||
#define GROUP_STOP_DEQUEUED (1 << 19) /* stop signal dequeued */
|
||||
#define JOBCTL_STOP_SIGMASK 0xffff /* signr of the last group stop */
|
||||
|
||||
extern void task_clear_group_stop_pending(struct task_struct *task);
|
||||
#define JOBCTL_STOP_DEQUEUED_BIT 16 /* stop signal dequeued */
|
||||
#define JOBCTL_STOP_PENDING_BIT 17 /* task should stop for group stop */
|
||||
#define JOBCTL_STOP_CONSUME_BIT 18 /* consume group stop count */
|
||||
#define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */
|
||||
|
||||
#define JOBCTL_STOP_DEQUEUED (1 << JOBCTL_STOP_DEQUEUED_BIT)
|
||||
#define JOBCTL_STOP_PENDING (1 << JOBCTL_STOP_PENDING_BIT)
|
||||
#define JOBCTL_STOP_CONSUME (1 << JOBCTL_STOP_CONSUME_BIT)
|
||||
#define JOBCTL_TRAPPING (1 << JOBCTL_TRAPPING_BIT)
|
||||
|
||||
extern void task_clear_jobctl_stop_pending(struct task_struct *task);
|
||||
|
||||
#ifdef CONFIG_PREEMPT_RCU
|
||||
|
||||
|
Reference in New Issue
Block a user