Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
"Misc scheduler fixes"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/core: Reset task's lockless wake-queues on fork()
sched/core: Fix unserialized r-m-w scribbling stuff
sched/core: Check tgid in is_global_init()
sched/fair: Fix multiplication overflow on 32-bit systems

+11 -8
+9 -7
include/linux/sched.h
··· 1455 1455 /* Used for emulating ABI behavior of previous Linux versions */ 1456 1456 unsigned int personality; 1457 1457 1458 - unsigned in_execve:1; /* Tell the LSMs that the process is doing an 1459 - * execve */ 1460 - unsigned in_iowait:1; 1461 - 1462 - /* Revert to default priority/policy when forking */ 1458 + /* scheduler bits, serialized by scheduler locks */ 1463 1459 unsigned sched_reset_on_fork:1; 1464 1460 unsigned sched_contributes_to_load:1; 1465 1461 unsigned sched_migrated:1; 1462 + unsigned :0; /* force alignment to the next boundary */ 1463 + 1464 + /* unserialized, strictly 'current' */ 1465 + unsigned in_execve:1; /* bit to tell LSMs we're in execve */ 1466 + unsigned in_iowait:1; 1466 1467 #ifdef CONFIG_MEMCG 1467 1468 unsigned memcg_may_oom:1; 1468 1469 #endif ··· 2003 2002 } 2004 2003 2005 2004 /** 2006 - * is_global_init - check if a task structure is init 2005 + * is_global_init - check if a task structure is init. Since init 2006 + * is free to have sub-threads we need to check tgid. 2007 2007 * @tsk: Task structure to be checked. 2008 2008 * 2009 2009 * Check if a task structure is the first user space task the kernel created. ··· 2013 2011 */ 2014 2012 static inline int is_global_init(struct task_struct *tsk) 2015 2013 { 2016 - return tsk->pid == 1; 2014 + return task_tgid_nr(tsk) == 1; 2017 2015 } 2018 2016 2019 2017 extern struct pid *cad_pid;
+1
kernel/fork.c
··· 380 380 #endif 381 381 tsk->splice_pipe = NULL; 382 382 tsk->task_frag.page = NULL; 383 + tsk->wake_q.next = NULL; 383 384 384 385 account_kernel_stack(ti, 1); 385 386
+1 -1
kernel/sched/fair.c
··· 2689 2689 int decayed, removed = 0; 2690 2690 2691 2691 if (atomic_long_read(&cfs_rq->removed_load_avg)) { 2692 - long r = atomic_long_xchg(&cfs_rq->removed_load_avg, 0); 2692 + s64 r = atomic_long_xchg(&cfs_rq->removed_load_avg, 0); 2693 2693 sa->load_avg = max_t(long, sa->load_avg - r, 0); 2694 2694 sa->load_sum = max_t(s64, sa->load_sum - r * LOAD_AVG_MAX, 0); 2695 2695 removed = 1;