GKI (arm64) relevant 76 out of 226 changes, affecting 86 files +761/-318aa879ef6d3HID: multitouch: Add NULL check in mt_input_configured [1 file, +4/-1]ba6ab3f04dpinctrl: pinconf-generic: Print unsigned value if a format is registered [1 file, +4/-4]36fd8f1c73HID: hid-steam: Don't use cancel_delayed_work_sync in IRQ context [1 file, +1/-1]889e6b42a4net: fib_rules: annotate data-races around rule->[io]ifindex [1 file, +13/-11]18e77fccfcndisc: ndisc_send_redirect() must use dev_get_by_index_rcu() [1 file, +1/-1]022cac1c69vrf: use RCU protection in l3mdev_l3_out() [1 file, +2/-0]e7c16028a4workqueue: Put the pwq after detaching the rescuer from the pool [1 file, +6/-6]715eb1af64arm64: cacheinfo: Avoid out-of-bounds write to cacheinfo array [1 file, +7/-5]c3e39d6acbcgroup: Remove steal time from usage_usec [1 file, +0/-1]9d32212b99io_uring/waitid: don't abuse io_tw_state [1 file, +2/-2]98d6ee3e30io_uring/uring_cmd: remove dead req_has_async_data() check [1 file, +0/-3]9e6d70a910block: cleanup and fix batch completion adding conditions [1 file, +14/-4]a7052afa9egpiolib: Fix crash on error in gpiochip_get_ngpios() [1 file, +3/-3]1b259a5df5media: uvcvideo: Implement dual stream quirk to fix loss of usb packets [2 files, +27/-1]7706d1edb9media: uvcvideo: Add new quirk definition for the Sonix Technology Co. 292a camera [1 file, +9/-0]24407a7584media: uvcvideo: Add Kurokesu C1 PRO camera [1 file, +9/-0]2290d3bd96PCI/DPC: Quirk PIO log size for Intel Raptor Lake-P [1 file, +1/-0]551df35e4fPCI: switchtec: Add Microchip PCI100X device IDs [2 files, +37/-0]88a01e9c9ascsi: ufs: bsg: Set bsg_queue to NULL after removal [1 file, +1/-0]c58e0d2d04serial: 8250_pci: Resolve WCH vendor ID ambiguity [1 file, +41/-41]14a2a8ec50kunit: platform: Resolve 'struct completion' warning [1 file, +1/-0]abb99f28b4ring-buffer: Unlock resize on mmap error [1 file, +1/-0]e8dff5f739tracing: Do not allow mmap() of persistent ring buffer [1 file, +4/-0]3ec743d558ring-buffer: Validate the persistent meta data subbuf array [1 file, +20/-2]9f837ea922ring-buffer: Update pages_touched to reflect persistent buffer content [1 file, +5/-0]a5852836e5usb: gadget: f_midi: Fixing wMaxPacketSize exceeded issue during MIDI bind retries [1 file, +9/-0]5fead36e09usb: dwc3: Fix timeout issue during controller enter/exit from halt state [1 file, +34/-0]69f27580e8usb: roles: set switch registered flag early on [1 file, +3/-2]f3b755022fusb: xhci: Restore xhci_pci support for Renesas HCs [1 file, +4/-3]9c91296e2dUSB: pci-quirks: Fix HCCPARAMS register error for LS7A EHCI [1 file, +9/-0]847fff8e20usb: core: fix pipe creation for get_bMaxPacketSize0 [1 file, +1/-2]6c4fce1b16USB: quirks: add USB_QUIRK_NO_LPM quirk for Teclast dist [1 file, +3/-0]f4e1cebbfaUSB: Add USB_QUIRK_NO_LPM quirk for sony xperia xz1 smartphone [1 file, +3/-0]6b16761a92usb: gadget: f_midi: fix MIDI Streaming descriptor lengths [1 file, +4/-4]62d8f4c545USB: hub: Ignore non-compliant devices with too many configs or interfaces [1 file, +11/-0]165fac6cebUSB: cdc-acm: Fill in Renesas R-Car D3 USB Download mode quirk [1 file, +6/-3]f64079bef6usb: cdc-acm: Check control transfer buffer size before access [1 file, +14/-3]a5b205ceefusb: cdc-acm: Fix handling of oversized fragments [1 file, +1/-1]f894448f39usb: gadget: core: flush gadget workqueue after device removal [1 file, +1/-1]ce526e1b29PCI: Avoid FLR for Mediatek MT7922 WiFi [1 file, +2/-1]3ed642e80cefi: Avoid cold plugged memory for placing the kernel [4 files, +11/-2]edd4084445cgroup: fix race between fork and cgroup.kill [3 files, +16/-11]29c04864fbserial: port: Assign ->iotype correctly when ->iobase is set [1 file, +2/-1]010eb5fe22serial: port: Always update ->iotype in __uart_read_properties() [1 file, +1/-1]eeb64f9637regmap-irq: Add missing kfree() [1 file, +2/-0]9a1c65ff5einclude: net: add static inline dst_dev_overhead() to dst.h [1 file, +9/-0]ebf0ac02e2clocksource: Use pr_info() for "Checking clocksource synchronization" message [1 file, +2/-1]cc3d79e7c8clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context [1 file, +4/-2]f7015dcac2scsi: ufs: core: Introduce ufshcd_has_pending_tasks() [1 file, +9/-4]9ece41a0d7scsi: ufs: core: Prepare to introduce a new clock_gating lock [1 file, +7/-4]f453c45152scsi: ufs: core: Introduce a new clock_gating lock [2 files, +59/-59]7d46869aa7scsi: ufs: Fix toggling of clk_gating.state when clock gating is not allowed [1 file, +1/-1]cb4d7fbc93ipv4: add RCU protection to ip4_dst_hoplimit() [1 file, +7/-2]dfe542e745ipv4: use RCU protection in ip_dst_mtu_maybe_forward() [1 file, +10/-3]ec9af76451net: add dev_net_rcu() helper [2 files, +7/-1]f4ba5e65c9ipv4: use RCU protection in ipv4_default_advmss() [1 file, +8/-3]77096420beipv4: use RCU protection in rt_is_expired() [1 file, +7/-1]ad66c7c4d8ipv4: use RCU protection in inet_select_addr() [1 file, +2/-1]7f5005457bnet: ipv4: Cache pmtu for all packet paths if multipath enabled [2 files, +108/-17]4583748b65ipv4: use RCU protection in __ip_rt_update_pmtu() [1 file, +6/-5]3c925321a5ipv4: icmp: convert to dev_net_rcu() [1 file, +17/-14]a575827791flow_dissector: use RCU protection to fetch dev_net() [1 file, +11/-10]713a40c892ipv6: use RCU protection in ip6_default_advmss() [1 file, +6/-1]653bb5225cipv6: icmp: convert to dev_net_rcu() [1 file, +23/-19]2152b417beHID: hid-steam: Make sure rumble work is canceled on removal [1 file, +1/-0]3e38cbbfa0HID: hid-steam: Move hidraw input (un)registering to work [1 file, +31/-7]bbec88e410ndisc: use RCU protection in ndisc_alloc_skb() [1 file, +4/-6]cdd5c2a12dneighbour: use RCU protection in __neigh_notify() [1 file, +6/-2]01d1b5c9abarp: use RCU protection in arp_xmit() [1 file, +3/-1]789230e5a8ndisc: extend RCU protection in ndisc_send_skb() [1 file, +8/-4]0bf8e2f376ipv6: mcast: extend RCU protection in igmp6_send() [1 file, +15/-16]25195f9d5fipv6: mcast: add RCU protection to mld_newpack() [1 file, +10/-4]13129b1fbfscsi: ufs: core: Ensure clk_gating.lock is used only after initialization [1 file, +6/-2]7d0dc28daeio_uring/kbuf: reallocate buf lists on upgrade [1 file, +11/-4]645ce25aa0vsock: Keep the binding until socket destruction [1 file, +6/-2]3a866f8376vsock: Orphan socket after transport release [1 file, +7/-1] Changes in 6.12.16 nfsd: clear acl_access/acl_default after releasing them NFSD: fix hang in nfsd4_shutdown_callback nfsd: validate the nfsd_serv pointer before calling svc_wake_up x86/cpu/kvm: SRSO: Fix possible missing IBPB on VM-Exit pinctrl: cy8c95x0: Avoid accessing reserved registers pinctrl: cy8c95x0: Enable regmap locking for debug pinctrl: cy8c95x0: Rename PWMSEL to SELPWM pinctrl: cy8c95x0: Respect IRQ trigger settings from firmware HID: winwing: Add NULL check in winwing_init_led() HID: multitouch: Add NULL check in mt_input_configured scripts/Makefile.extrawarn: Do not show clang's non-kprintf warnings at W=1 pinctrl: pinconf-generic: Print unsigned value if a format is registered HID: hid-thrustmaster: fix stack-out-of-bounds read in usb_check_int_endpoints() HID: hid-steam: Don't use cancel_delayed_work_sync in IRQ context spi: sn-f-ospi: Fix division by zero ax25: Fix refcount leak caused by setting SO_BINDTODEVICE sockopt net: fib_rules: annotate data-races around rule->[io]ifindex Documentation/networking: fix basic node example document ISO 15765-2 ndisc: ndisc_send_redirect() must use dev_get_by_index_rcu() vrf: use RCU protection in l3mdev_l3_out() idpf: fix handling rsc packet with a single segment idpf: record rx queue in skb for RSC packets idpf: call set_real_num_queues in idpf_open igc: Fix HW RX timestamp when passed by ZC XDP vxlan: check vxlan_vnigroup_init() return value LoongArch: Fix idle VS timer enqueue LoongArch: csum: Fix OoB access in IP checksum code for negative lengths LoongArch: KVM: Fix typo issue about GCFG feature detection net: ethernet: ti: am65-cpsw: fix memleak in certain XDP cases net: ethernet: ti: am65_cpsw: fix tx_cleanup for XDP case Bluetooth: btintel_pcie: Fix a potential race condition team: better TEAM_OPTION_TYPE_STRING validation workqueue: Put the pwq after detaching the rescuer from the pool sched_ext: Fix lock imbalance in dispatch_to_local_dsq() drm/tests: hdmi: Fix WW_MUTEX_SLOWPATH failures arm64: cacheinfo: Avoid out-of-bounds write to cacheinfo array gpu: host1x: Fix a use of uninitialized mutex cgroup: Remove steal time from usage_usec perf/x86/intel: Clean up PEBS-via-PT on hybrid drm/xe/client: bo->client does not need bos_lock drm/i915/selftests: avoid using uninitialized context gpio: bcm-kona: Fix GPIO lock/unlock for banks above bank 0 gpio: bcm-kona: Make sure GPIO bits are unlocked when requesting IRQ gpio: bcm-kona: Add missing newline to dev_err format string io_uring/waitid: don't abuse io_tw_state io_uring/uring_cmd: remove dead req_has_async_data() check amdkfd: properly free gang_ctx_bo when failed to init user queue drm/amdgpu: bail out when failed to load fw in psp_init_cap_microcode() drm: Fix DSC BPP increment decoding xen/swiotlb: relax alignment requirements x86/xen: allow larger contiguous memory regions in PV guests block: cleanup and fix batch completion adding conditions sched_ext: Fix the incorrect bpf_list kfunc API in common.bpf.h. sched_ext: Use SCX_CALL_OP_TASK in task_tick_scx gpiolib: Fix crash on error in gpiochip_get_ngpios() iommu/amd: Expicitly enable CNTRL.EPHEn bit in resume path tools: fix annoying "mkdir -p ..." logs when building tools in parallel RDMA/efa: Reset device on probe failure firmware: qcom: scm: smc: Handle missing SCM device fbdev: omap: use threaded IRQ for LCD DMA soc/tegra: fuse: Update Tegra234 nvmem keepout list i3c: mipi-i3c-hci: Add Intel specific quirk to ring resuming i3c: mipi-i3c-hci: Add support for MIPI I3C HCI on PCI bus media: cxd2841er: fix 64-bit division on gcc-9 media: i2c: ds90ub913: Add error handling to ub913_hw_init() media: i2c: ds90ub953: Add error handling for i2c reads/writes media: bcm2835-unicam: Disable trigger mode operation media: uvcvideo: Implement dual stream quirk to fix loss of usb packets media: uvcvideo: Add new quirk definition for the Sonix Technology Co. 292a camera media: uvcvideo: Add Kurokesu C1 PRO camera media: vidtv: Fix a null-ptr-deref in vidtv_mux_stop_thread PCI/DPC: Quirk PIO log size for Intel Raptor Lake-P PCI: switchtec: Add Microchip PCI100X device IDs scsi: ufs: bsg: Set bsg_queue to NULL after removal rtla/timerlat_hist: Abort event processing on second signal rtla/timerlat_top: Abort event processing on second signal serial: 8250_pci: Resolve WCH vendor ID ambiguity serial: 8250_pci: Share WCH IDs with parport_serial driver 8250: microchip: pci1xxxx: Add workaround for RTS bit toggle kunit: platform: Resolve 'struct completion' warning vfio/pci: Enable iowrite64 and ioread64 for vfio pci NFS: Fix potential buffer overflowin nfs_sysfs_link_rpc_client() vfio/nvgrace-gpu: Read dvsec register to determine need for uncached resmem vfio/nvgrace-gpu: Expose the blackwell device PF BAR1 to the VM fs/ntfs3: Unify inode corruption marking with _ntfs_bad_inode() Grab mm lock before grabbing pt lock selftests: gpio: gpio-sim: Fix missing chip disablements ACPI: x86: Add skip i2c clients quirk for Vexia EDU ATLA 10 tablet 5V x86/mm/tlb: Only trim the mm_cpumask once a second orangefs: fix a oob in orangefs_debug_write kbuild: suppress stdout from merge_config for silent builds ASoC: Intel: bytcr_rt5640: Add DMI quirk for Vexia Edu Atla 10 tablet 5V kbuild: Use -fzero-init-padding-bits=all batman-adv: fix panic during interface removal batman-adv: Ignore neighbor throughput metrics in error case batman-adv: Drop unmanaged ELP metric worker drm/amdgpu: avoid buffer overflow attach in smu_sys_set_pp_table() KVM: x86: Reject Hyper-V's SEND_IPI hypercalls if local APIC isn't in-kernel KVM: x86: Load DR6 with guest value only before entering .vcpu_run() loop KVM: nSVM: Enter guest mode before initializing nested NPT MMU perf/x86/intel: Fix ARCH_PERFMON_NUM_COUNTER_LEAF perf/x86/intel: Ensure LBRs are disabled when a CPU is starting ring-buffer: Unlock resize on mmap error tracing: Do not allow mmap() of persistent ring buffer ring-buffer: Validate the persistent meta data subbuf array ring-buffer: Update pages_touched to reflect persistent buffer content usb: gadget: f_midi: Fixing wMaxPacketSize exceeded issue during MIDI bind retries usb: dwc3: Fix timeout issue during controller enter/exit from halt state usb: roles: set switch registered flag early on usb: gadget: udc: renesas_usb3: Fix compiler warning usb: dwc2: gadget: remove of_node reference upon udc_stop usb: xhci: Restore xhci_pci support for Renesas HCs USB: pci-quirks: Fix HCCPARAMS register error for LS7A EHCI usb: core: fix pipe creation for get_bMaxPacketSize0 USB: quirks: add USB_QUIRK_NO_LPM quirk for Teclast dist USB: Add USB_QUIRK_NO_LPM quirk for sony xperia xz1 smartphone usb: gadget: f_midi: fix MIDI Streaming descriptor lengths USB: hub: Ignore non-compliant devices with too many configs or interfaces USB: cdc-acm: Fill in Renesas R-Car D3 USB Download mode quirk usb: cdc-acm: Check control transfer buffer size before access usb: cdc-acm: Fix handling of oversized fragments usb: gadget: core: flush gadget workqueue after device removal USB: serial: option: add MeiG Smart SLM828 USB: serial: option: add Telit Cinterion FN990B compositions USB: serial: option: fix Telit Cinterion FN990A name USB: serial: option: drop MeiG Smart defines can: ctucanfd: handle skb allocation failure can: c_can: fix unbalanced runtime PM disable in error path can: j1939: j1939_sk_send_loop(): fix unable to send messages with data length zero can: rockchip: rkcanfd_handle_rx_fifo_overflow_int(): bail out if skb cannot be allocated can: etas_es58x: fix potential NULL pointer dereference on udev->serial alpha: make stack 16-byte aligned (most cases) wifi: ath12k: fix handling of 6 GHz rules PCI: Avoid FLR for Mediatek MT7922 WiFi kbuild: userprogs: fix bitsize and target detection on clang efi: Avoid cold plugged memory for placing the kernel arm64: rust: clean Rust 1.85.0 warning using softfloat target objtool/rust: add one more `noreturn` Rust function rust: rbtree: fix overindented list item cgroup: fix race between fork and cgroup.kill serial: port: Assign ->iotype correctly when ->iobase is set serial: port: Always update ->iotype in __uart_read_properties() serial: 8250: Fix fifo underflow on flush alpha: replace hardcoded stack offsets with autogenerated ones alpha: align stack for page fault and user unaligned trap handlers s390/pci: Pull search for parent PF out of zpci_iov_setup_virtfn() s390/pci: Fix handling of isolated VFs gpiolib: acpi: Add a quirk for Acer Nitro ANV14 gpio: stmpe: Check return value of stmpe_reg_read in stmpe_gpio_irq_sync_unlock partitions: mac: fix handling of bogus partition table sched_ext: Fix incorrect autogroup migration detection regulator: qcom_smd: Add l2, l5 sub-node to mp5496 regulator iommu: Fix potential memory leak in iopf_queue_remove_device() regmap-irq: Add missing kfree() arm64: Handle .ARM.attributes section in linker scripts mmc: mtk-sd: Fix register settings for hs400(es) mode igc: Set buffer type for empty frames in igc_init_empty_frame cifs: pick channels for individual subrequests mlxsw: Add return value check for mlxsw_sp_port_get_stats_raw() btrfs: fix hole expansion when writing at an offset beyond EOF include: net: add static inline dst_dev_overhead() to dst.h net: ipv6: ioam6_iptunnel: mitigate 2-realloc issue net: ipv6: seg6_iptunnel: mitigate 2-realloc issue net: ipv6: rpl_iptunnel: mitigate 2-realloc issue net: ipv6: fix dst ref loops in rpl, seg6 and ioam6 lwtunnels clocksource: Use pr_info() for "Checking clocksource synchronization" message clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context scsi: ufs: core: Introduce ufshcd_has_pending_tasks() scsi: ufs: core: Prepare to introduce a new clock_gating lock scsi: ufs: core: Introduce a new clock_gating lock scsi: ufs: Fix toggling of clk_gating.state when clock gating is not allowed rust: kbuild: add -fzero-init-padding-bits to bindgen_skip_cflags cpufreq/amd-pstate: Call cppc_set_epp_perf in the reenable function cpufreq/amd-pstate: Align offline flow of shared memory and MSR based systems cpufreq/amd-pstate: Refactor amd_pstate_epp_reenable() and amd_pstate_epp_offline() cpufreq/amd-pstate: Remove the cppc_state check in offline/online functions cpufreq/amd-pstate: Merge amd_pstate_epp_cpu_offline() and amd_pstate_epp_offline() cpufreq/amd-pstate: convert mutex use to guard() cpufreq/amd-pstate: Fix cpufreq_policy ref counting ipv4: add RCU protection to ip4_dst_hoplimit() ipv4: use RCU protection in ip_dst_mtu_maybe_forward() net: add dev_net_rcu() helper ipv4: use RCU protection in ipv4_default_advmss() ipv4: use RCU protection in rt_is_expired() ipv4: use RCU protection in inet_select_addr() net: ipv4: Cache pmtu for all packet paths if multipath enabled ipv4: use RCU protection in __ip_rt_update_pmtu() ipv4: icmp: convert to dev_net_rcu() flow_dissector: use RCU protection to fetch dev_net() ipv6: use RCU protection in ip6_default_advmss() ipv6: icmp: convert to dev_net_rcu() HID: hid-steam: Make sure rumble work is canceled on removal HID: hid-steam: Move hidraw input (un)registering to work ndisc: use RCU protection in ndisc_alloc_skb() neighbour: use RCU protection in __neigh_notify() arp: use RCU protection in arp_xmit() openvswitch: use RCU protection in ovs_vport_cmd_fill_info() ndisc: extend RCU protection in ndisc_send_skb() ipv6: mcast: extend RCU protection in igmp6_send() btrfs: rename __get_extent_map() and pass btrfs_inode btrfs: fix stale page cache after race between readahead and direct IO write ipv6: mcast: add RCU protection to mld_newpack() drm/tidss: Fix issue in irq handling causing irq-flood issue drm/tidss: Fix race condition while handling interrupt registers drm/tidss: Clear the interrupt status for interrupts being disabled drm/msm/gem: prevent integer overflow in msm_ioctl_gem_submit() drm/rcar-du: dsi: Fix PHY lock bit check drm/msm/dpu: fix x1e80100 intf_6 underrun/vsync interrupt drm/msm/dpu1: don't choke on disabling the writeback connector drm/v3d: Stop active perfmon if it is being destroyed drm/xe/tracing: Fix a potential TP_printk UAF drm: renesas: rz-du: Increase supported resolutions netdevsim: print human readable IP address selftests: rtnetlink: update netdevsim ipsec output format x86/static-call: Remove early_boot_irqs_disabled check to fix Xen PVH dom0 bpf: handle implicit declaration of function gettid in bpf_iter.c selftests/bpf: Fix uprobe consumer test wifi: rtw89: pci: disable PCIE wake bit when PCIE deinit cpufreq/amd-pstate: Remove the goto label in amd_pstate_update_limits net: ipv6: fix dst refleaks in rpl, seg6 and ioam6 lwtunnels scsi: ufs: core: Ensure clk_gating.lock is used only after initialization io_uring/kbuf: reallocate buf lists on upgrade vsock: Keep the binding until socket destruction vsock: Orphan socket after transport release Revert "vfio/platform: check the bounds of read/write syscalls" Linux 6.12.16 Change-Id: I84e354ffa6aeb0323a95046630310c3d2185a069 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
263 lines
7.3 KiB
C
263 lines
7.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_SCHED_TASK_H
|
|
#define _LINUX_SCHED_TASK_H
|
|
|
|
/*
|
|
* Interface between the scheduler and various task lifetime (fork()/exit())
|
|
* functionality:
|
|
*/
|
|
|
|
#include <linux/rcupdate.h>
|
|
#include <linux/refcount.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/uaccess.h>
|
|
|
|
struct task_struct;
|
|
struct rusage;
|
|
union thread_union;
|
|
struct css_set;
|
|
|
|
/* All the bits taken by the old clone syscall. */
|
|
#define CLONE_LEGACY_FLAGS 0xffffffffULL
|
|
|
|
struct kernel_clone_args {
|
|
u64 flags;
|
|
int __user *pidfd;
|
|
int __user *child_tid;
|
|
int __user *parent_tid;
|
|
const char *name;
|
|
int exit_signal;
|
|
u32 kthread:1;
|
|
u32 io_thread:1;
|
|
u32 user_worker:1;
|
|
u32 no_files:1;
|
|
unsigned long stack;
|
|
unsigned long stack_size;
|
|
unsigned long tls;
|
|
pid_t *set_tid;
|
|
/* Number of elements in *set_tid */
|
|
size_t set_tid_size;
|
|
int cgroup;
|
|
int idle;
|
|
int (*fn)(void *);
|
|
void *fn_arg;
|
|
struct cgroup *cgrp;
|
|
struct css_set *cset;
|
|
unsigned int kill_seq;
|
|
};
|
|
|
|
/*
|
|
* This serializes "schedule()" and also protects
|
|
* the run-queue from deletions/modifications (but
|
|
* _adding_ to the beginning of the run-queue has
|
|
* a separate lock).
|
|
*/
|
|
extern rwlock_t tasklist_lock;
|
|
extern spinlock_t mmlist_lock;
|
|
|
|
extern union thread_union init_thread_union;
|
|
extern struct task_struct init_task;
|
|
#ifdef CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE
|
|
extern u64 vendor_data_pad[CONFIG_GKI_TASK_STRUCT_VENDOR_SIZE_MAX / sizeof(u64)];
|
|
#endif
|
|
|
|
extern int lockdep_tasklist_lock_is_held(void);
|
|
|
|
extern asmlinkage void schedule_tail(struct task_struct *prev);
|
|
extern void init_idle(struct task_struct *idle, int cpu);
|
|
|
|
extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
|
|
extern int sched_cgroup_fork(struct task_struct *p, struct kernel_clone_args *kargs);
|
|
extern void sched_cancel_fork(struct task_struct *p);
|
|
extern void sched_post_fork(struct task_struct *p);
|
|
extern void sched_dead(struct task_struct *p);
|
|
|
|
void __noreturn do_task_dead(void);
|
|
void __noreturn make_task_dead(int signr);
|
|
|
|
extern void mm_cache_init(void);
|
|
extern void proc_caches_init(void);
|
|
|
|
extern void fork_init(void);
|
|
|
|
extern void release_task(struct task_struct * p);
|
|
|
|
extern int copy_thread(struct task_struct *, const struct kernel_clone_args *);
|
|
|
|
extern void flush_thread(void);
|
|
|
|
#ifdef CONFIG_HAVE_EXIT_THREAD
|
|
extern void exit_thread(struct task_struct *tsk);
|
|
#else
|
|
static inline void exit_thread(struct task_struct *tsk)
|
|
{
|
|
}
|
|
#endif
|
|
extern __noreturn void do_group_exit(int);
|
|
|
|
extern void exit_files(struct task_struct *);
|
|
extern void exit_itimers(struct task_struct *);
|
|
|
|
extern pid_t kernel_clone(struct kernel_clone_args *kargs);
|
|
struct task_struct *copy_process(struct pid *pid, int trace, int node,
|
|
struct kernel_clone_args *args);
|
|
struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node);
|
|
struct task_struct *fork_idle(int);
|
|
extern pid_t kernel_thread(int (*fn)(void *), void *arg, const char *name,
|
|
unsigned long flags);
|
|
extern pid_t user_mode_thread(int (*fn)(void *), void *arg, unsigned long flags);
|
|
extern long kernel_wait4(pid_t, int __user *, int, struct rusage *);
|
|
int kernel_wait(pid_t pid, int *stat);
|
|
|
|
extern void free_task(struct task_struct *tsk);
|
|
|
|
/* sched_exec is called by processes performing an exec */
|
|
#ifdef CONFIG_SMP
|
|
extern void sched_exec(void);
|
|
#else
|
|
#define sched_exec() {}
|
|
#endif
|
|
|
|
static inline struct task_struct *get_task_struct(struct task_struct *t)
|
|
{
|
|
refcount_inc(&t->usage);
|
|
return t;
|
|
}
|
|
|
|
static inline struct task_struct *tryget_task_struct(struct task_struct *t)
|
|
{
|
|
return refcount_inc_not_zero(&t->usage) ? t : NULL;
|
|
}
|
|
|
|
extern void __put_task_struct(struct task_struct *t);
|
|
extern void __put_task_struct_rcu_cb(struct rcu_head *rhp);
|
|
|
|
static inline void put_task_struct(struct task_struct *t)
|
|
{
|
|
if (!refcount_dec_and_test(&t->usage))
|
|
return;
|
|
|
|
/*
|
|
* In !RT, it is always safe to call __put_task_struct().
|
|
* Under RT, we can only call it in preemptible context.
|
|
*/
|
|
if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible()) {
|
|
static DEFINE_WAIT_OVERRIDE_MAP(put_task_map, LD_WAIT_SLEEP);
|
|
|
|
lock_map_acquire_try(&put_task_map);
|
|
__put_task_struct(t);
|
|
lock_map_release(&put_task_map);
|
|
return;
|
|
}
|
|
|
|
/*
|
|
* under PREEMPT_RT, we can't call put_task_struct
|
|
* in atomic context because it will indirectly
|
|
* acquire sleeping locks.
|
|
*
|
|
* call_rcu() will schedule delayed_put_task_struct_rcu()
|
|
* to be called in process context.
|
|
*
|
|
* __put_task_struct() is called when
|
|
* refcount_dec_and_test(&t->usage) succeeds.
|
|
*
|
|
* This means that it can't "conflict" with
|
|
* put_task_struct_rcu_user() which abuses ->rcu the same
|
|
* way; rcu_users has a reference so task->usage can't be
|
|
* zero after rcu_users 1 -> 0 transition.
|
|
*
|
|
* delayed_free_task() also uses ->rcu, but it is only called
|
|
* when it fails to fork a process. Therefore, there is no
|
|
* way it can conflict with put_task_struct().
|
|
*/
|
|
call_rcu(&t->rcu, __put_task_struct_rcu_cb);
|
|
}
|
|
|
|
DEFINE_FREE(put_task, struct task_struct *, if (_T) put_task_struct(_T))
|
|
|
|
static inline void put_task_struct_many(struct task_struct *t, int nr)
|
|
{
|
|
if (refcount_sub_and_test(nr, &t->usage))
|
|
__put_task_struct(t);
|
|
}
|
|
|
|
void put_task_struct_rcu_user(struct task_struct *task);
|
|
|
|
/* Free all architecture-specific resources held by a thread. */
|
|
void release_thread(struct task_struct *dead_task);
|
|
|
|
#ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
|
|
extern int arch_task_struct_size __read_mostly;
|
|
#else
|
|
# define arch_task_struct_size (sizeof(struct task_struct))
|
|
#endif
|
|
|
|
#ifndef CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST
|
|
/*
|
|
* If an architecture has not declared a thread_struct whitelist we
|
|
* must assume something there may need to be copied to userspace.
|
|
*/
|
|
static inline void arch_thread_struct_whitelist(unsigned long *offset,
|
|
unsigned long *size)
|
|
{
|
|
*offset = 0;
|
|
/* Handle dynamically sized thread_struct. */
|
|
*size = arch_task_struct_size - offsetof(struct task_struct, thread);
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_VMAP_STACK
|
|
static inline struct vm_struct *task_stack_vm_area(const struct task_struct *t)
|
|
{
|
|
return t->stack_vm_area;
|
|
}
|
|
#else
|
|
static inline struct vm_struct *task_stack_vm_area(const struct task_struct *t)
|
|
{
|
|
return NULL;
|
|
}
|
|
#endif
|
|
|
|
/*
|
|
* Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
|
|
* subscriptions and synchronises with wait4(). Also used in procfs. Also
|
|
* pins the final release of task.io_context. Also protects ->cpuset and
|
|
* ->cgroup.subsys[]. And ->vfork_done. And ->sysvshm.shm_clist.
|
|
*
|
|
* Nests both inside and outside of read_lock(&tasklist_lock).
|
|
* It must not be nested with write_lock_irq(&tasklist_lock),
|
|
* neither inside nor outside.
|
|
*/
|
|
static inline void task_lock(struct task_struct *p)
|
|
{
|
|
spin_lock(&p->alloc_lock);
|
|
}
|
|
|
|
static inline void task_unlock(struct task_struct *p)
|
|
{
|
|
spin_unlock(&p->alloc_lock);
|
|
}
|
|
|
|
DEFINE_GUARD(task_lock, struct task_struct *, task_lock(_T), task_unlock(_T))
|
|
|
|
#ifdef CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE
|
|
static inline void *android_task_vendor_data(struct task_struct *p)
|
|
{
|
|
if (p == &init_task)
|
|
return &vendor_data_pad[0];
|
|
|
|
return p + 1;
|
|
}
|
|
|
|
static inline void android_init_dynamic_vendor_data(struct task_struct *p)
|
|
{
|
|
if (arch_task_struct_size > sizeof(struct task_struct))
|
|
memset((void *)android_task_vendor_data(p), 0x0,
|
|
arch_task_struct_size - sizeof(struct task_struct));
|
|
}
|
|
#else /* !CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE */
|
|
static inline void android_init_dynamic_vendor_data(struct task_struct *p) {}
|
|
#endif /* CONFIG_GKI_DYNAMIC_TASK_STRUCT_SIZE */
|
|
|
|
#endif /* _LINUX_SCHED_TASK_H */
|