Skip to content

Commit c39cbc5

Browse files
committed
Merge tag 'sched-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar: "Miscellaneous scheduler fixes: a reporting fix, a static symbol fix, and a kernel-doc fix" * tag 'sched-urgent-2023-09-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/core: Report correct state for TASK_IDLE | TASK_FREEZABLE sched/fair: Make update_entity_lag() static sched/core: Add kernel-doc for set_cpus_allowed_ptr()
2 parents ee40d54 + 0d6b352 commit c39cbc5

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

include/linux/sched.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,15 +1671,15 @@ static inline unsigned int __task_state_index(unsigned int tsk_state,
16711671

16721672
BUILD_BUG_ON_NOT_POWER_OF_2(TASK_REPORT_MAX);
16731673

1674-
if (tsk_state == TASK_IDLE)
1674+
if ((tsk_state & TASK_IDLE) == TASK_IDLE)
16751675
state = TASK_REPORT_IDLE;
16761676

16771677
/*
16781678
* We're lying here, but rather than expose a completely new task state
16791679
* to userspace, we can make this appear as if the task has gone through
16801680
* a regular rt_mutex_lock() call.
16811681
*/
1682-
if (tsk_state == TASK_RTLOCK_WAIT)
1682+
if (tsk_state & TASK_RTLOCK_WAIT)
16831683
state = TASK_UNINTERRUPTIBLE;
16841684

16851685
return fls(state);
@@ -1858,7 +1858,17 @@ extern int task_can_attach(struct task_struct *p);
18581858
extern int dl_bw_alloc(int cpu, u64 dl_bw);
18591859
extern void dl_bw_free(int cpu, u64 dl_bw);
18601860
#ifdef CONFIG_SMP
1861+
1862+
/* do_set_cpus_allowed() - consider using set_cpus_allowed_ptr() instead */
18611863
extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask);
1864+
1865+
/**
1866+
* set_cpus_allowed_ptr - set CPU affinity mask of a task
1867+
* @p: the task
1868+
* @new_mask: CPU affinity mask
1869+
*
1870+
* Return: zero if successful, or a negative error code
1871+
*/
18621872
extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask);
18631873
extern int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node);
18641874
extern void release_user_cpus_ptr(struct task_struct *p);

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
699699
*
700700
* XXX could add max_slice to the augmented data to track this.
701701
*/
702-
void update_entity_lag(struct cfs_rq *cfs_rq, struct sched_entity *se)
702+
static void update_entity_lag(struct cfs_rq *cfs_rq, struct sched_entity *se)
703703
{
704704
s64 lag, limit;
705705

0 commit comments

Comments
 (0)