mirror of
https://github.com/commaai/agnos-kernel-sdm845.git
synced 2026-06-12 21:34:52 +08:00
* origin/tmp-dcb6110:
ANDROID: goldfish_sync: 32 max cmds to save stack
ANDROID: sched/walt: use div_u64 instead of do_div
Linux 4.9.9
drm/i915/execlists: Reset RING registers upon resume
fs: break out of iomap_file_buffered_write on fatal signals
iw_cxgb4: set correct FetchBurstMax for QPs
x86/irq: Make irq activate operations symmetric
irqdomain: Avoid activating interrupts more than once
iio: health: max30100: fixed parenthesis around FIFO count check
iio: dht11: Use usleep_range instead of msleep for start signal
iio: health: afe4403: retrieve a valid iio_dev in suspend/resume
iio: health: afe4404: retrieve a valid iio_dev in suspend/resume
iio: adc: palmas_gpadc: retrieve a valid iio_dev in suspend/resume
staging: greybus: timesync: validate platform state callback
USB: serial: option: add device ID for HP lt2523 (Novatel E371)
usb: gadget: f_fs: Assorted buffer overflow checks.
usb: musb: Fix host mode error -71 regression
USB: Add quirk for WORLDE easykey.25 MIDI keyboard
USB: serial: pl2303: add ATEN device ID
USB: serial: qcserial: add Dell DW5570 QDL
KVM: x86: do not save guest-unsupported XSAVE state
dmaengine: cppi41: Fix oops in cppi41_runtime_resume
dmaengine: cppi41: Fix runtime PM timeouts with USB mass storage
perf/x86/intel/uncore: Clean up hotplug conversion fallout
HID: wacom: Fix poor prox handling in 'wacom_pl_irq'
HID: hid-lg: Fix immediate disconnection of Logitech Rumblepad 2
HID: usbhid: Quirk a AMI virtual mouse and keyboard with ALWAYS_POLL
iwlwifi: mvm: avoid crash on restart w/o reserved queues
iwlwifi: fix double hyphen in MODULE_FIRMWARE for 8000
pinctrl: intel: merrifield: Add missed check in mrfld_config_set()
pinctrl: baytrail: Debounce register is one per community
Revert "vring: Force use of DMA API for ARM-based systems with legacy devices"
Revert "bcma: init serial console directly from ChipCommon code"
percpu-refcount: fix reference leak during percpu-atomic transition
regulator: axp20x: AXP806: Fix dcdcb being set instead of dcdce
vhost: fix initialization for vq->is_le
mmc: sdhci: Ignore unexpected CARD_INT interrupts
cgroup: don't online subsystems before cgroup_name/path() are operational
can: bcm: fix hrtimer/tasklet termination in bcm op removal
tracing: Fix hwlat kthread migration
mm, fs: check for fatal signals in do_generic_file_read()
base/memory, hotplug: fix a kernel oops in show_valid_zones()
mm/memory_hotplug.c: check start_pfn in test_pages_in_a_zone()
cifs: initialize file_info_lock
zswap: disable changing params if init fails
svcrpc: fix oops in absence of krb5 module
NFSD: Fix a null reference case in find_or_create_lock_stateid()
powerpc/mm: Use the correct pointer when setting a 2MB pte
powerpc: Fix build failure with clang due to BUILD_BUG_ON()
powerpc: Add missing error check to prom_find_boot_cpu()
powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()
libata: Fix ATA request sense
libata: apply MAX_SEC_1024 to all CX1-JB*-HP devices
ata: sata_mv:- Handle return value of devm_ioremap.
perf/core: Fix PERF_RECORD_MMAP2 prot/flags for anonymous memory
perf/core: Fix use-after-free bug
crypto: arm64/aes-blk - honour iv_out requirement in CBC and CTR modes
crypto: api - Clear CRYPTO_ALG_DEAD bit before registering an alg
drm/nouveau/nv1a,nv1f/disp: fix memory clock rate retrieval
drm/nouveau/disp/gt215: Fix HDA ELD handling (thus, HDMI audio) on gt215
drm/amdgpu/si: fix crash on headless asics
pinctrl: baytrail: Add missing spinlock usage in byt_gpio_irq_handler
HID: cp2112: fix gpio-callback error handling
HID: cp2112: fix sleep-while-atomic
xtensa: fix noMMU build on cores with MMU
efi/fdt: Avoid FDT manipulation after ExitBootServices()
x86/efi: Always map the first physical page into the EFI pagetables
ext4: validate s_first_meta_bg at mount time
PCI/ASPM: Handle PCI-to-PCIe bridges as roots of PCIe hierarchies
ANDROID: sched: Add Kconfig option DEFAULT_USE_ENERGY_AWARE to set ENERGY_AWARE feature flag
ANDROID: goldfish_sync: Fix sync_file_obj is NULL but dereferenced problem
ANDROID: goldfish_sync: Isolate single module to fix compilation
ANDROID: goldfish_sync: update defconfig for 4.9-compatible version
ANDROID: goldfish_sync: upgrade to new fence sync api
Linux 4.9.8
xfs: fix bmv_count confusion w/ shared extents
xfs: clear _XBF_PAGES from buffers when readahead page
xfs: extsize hints are not unlikely in xfs_bmap_btalloc
xfs: remove racy hasattr check from attr ops
xfs: verify dirblocklog correctly
xfs: fix COW writeback race
xfs: fix xfs_mode_to_ftype() prototype
xfs: don't wrap ID in xfs_dq_get_next_id
xfs: sanity check inode di_mode
xfs: sanity check inode mode when creating new dentry
xfs: replace xfs_mode_to_ftype table with switch statement
xfs: add missing include dependencies to xfs_dir2.h
xfs: sanity check directory inode di_size
xfs: make the ASSERT() condition likely
xfs: don't print warnings when xfs_log_force fails
xfs: don't rely on ->total in xfs_alloc_space_available
xfs: adjust allocation length in xfs_alloc_space_available
xfs: fix bogus minleft manipulations
xfs: bump up reserved blocks in xfs_alloc_set_aside
net: dsa: Bring back device detaching in dsa_slave_suspend()
lwtunnel: Fix oops on state free after encap module unload
net: Specify the owning module for lwtunnel ops
qmi_wwan/cdc_ether: add device ID for HP lt2523 (Novatel E371) WWAN card
af_unix: move unix_mknod() out of bindlock
r8152: don't execute runtime suspend if the tx is not empty
net: mpls: Fix multipath selection for LSR use case
bridge: netlink: call br_changelink() during br_dev_newlink()
net/mlx5e: Do not recycle pages from emergency reserve
tcp: initialize max window for a new fastopen socket
ipv6: addrconf: Avoid addrconf_disable_change() using RCU read-side lock
lwtunnel: fix autoload of lwt modules
net: phy: bcm63xx: Utilize correct config_intr function
net: fix harmonize_features() vs NETIF_F_HIGHDMA
vxlan: fix byte order of vxlan-gpe port number
virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
virtio: don't set VIRTIO_NET_HDR_F_DATA_VALID on xmit
net sched actions: fix refcnt when GETing of action after bind
ax25: Fix segfault after sock connection timeout
ip6_tunnel: Account for tunnel header in tunnel MTU
ravb: do not use zero-length alignment DMA descriptor
mlx4: do not call napi_schedule() without care
openvswitch: maintain correct checksum state in conntrack actions
tcp: fix tcp_fastopen unaligned access complaints on sparc
net: systemport: Decouple flow control from __bcm_sysport_tx_reclaim
net: ipv4: fix table id in getroute response
net: lwtunnel: Handle lwtunnel_fill_encap failure
mlxsw: pci: Fix EQE structure definition
mlxsw: switchx2: Fix memory leak at skb reallocation
mlxsw: spectrum: Fix memory leak at skb reallocation
netvsc: add rcu_read locking to netvsc callback
r8152: fix the sw rx checksum is unavailable
FROMLIST: 9p: fix a potential acl leak
ANDROID: sched/walt: use do_div instead of division operator
ANDROID: sched: fix wrong truncation of walt_avg
ANDROID: arm: Fix #if/#ifdef typo in topology.c
ANDROID: arm: Fix build error "conflicting types for 'scale_cpu_capacity'"
ANDROID: net: ipv6: remove unused variable ifindex in
ANDROID: DEBUG: cpufreq: fix cpu_capacity tracing build for non-smp systems
ANDROID: arm: topology: Define TC2 energy and provide it to the scheduler
ANDROID: binder: fix format specifier for type binder_size_t
Linux 4.9.7
drm/i915: Remove WaDisableLSQCROPERFforOCL KBL workaround.
perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race
mm, memcg: do not retry precharge charges
platform/x86: intel_mid_powerbtn: Set IRQ_ONESHOT
platform/x86: mlx-platform: free first dev on error
virtio_mmio: Set DMA masks appropriately
memory_hotplug: make zone_can_shift() return a boolean value
pinctrl: baytrail: Rectify debounce support
pinctrl: uniphier: fix Ethernet (RMII) pin-mux setting for LD20
pinctrl: broxton: Use correct PADCFGLOCK offset
s5k4ecgx: select CRC32 helper
IB/rxe: Prevent from completer to operate on non valid QP
IB/rxe: Fix rxe dev insertion to rxe_dev_list
IB/umem: Release pid in error and ODP flow
drm/i915: Check for NULL atomic state in intel_crtc_disable_noatomic()
drm/i915: Fix calculation of rotated x and y offsets for planar formats
drm/i915: Don't init hpd polling for vlv and chv from runtime_suspend()
drm/i915: Don't leak edid in intel_crt_detect_ddc()
drm/i915: prevent crash with .disable_display parameter
drm/i915: Clear ret before unbinding in i915_gem_evict_something()
v4l: tvp5150: Don't override output pinmuxing at stream on/off time
v4l: tvp5150: Fix comment regarding output pin muxing
v4l: tvp5150: Reset device at probe time, not in get/set format handlers
pctv452e: move buffer to heap, no mutex
iw_cxgb4: free EQ queue memory on last deref
SUNRPC: cleanup ida information when removing sunrpc module
NFSv4.0: always send mode in SETATTR after EXCLUSIVE4
NFSv4.1: Fix a deadlock in layoutget
nfs: Don't increment lock sequence ID after NFS4ERR_MOVED
parisc: Don't use BITS_PER_LONG in userspace-exported swab.h header
ARC: [arcompact] handle unaligned access delay slot corner case
ARC: udelay: fix inline assembler by adding LP_COUNT to clobber list
can: ti_hecc: add missing prepare and unprepare of the clock
can: c_can_pci: fix null-pointer-deref in c_can_start() - set device pointer
IB/srp: fix invalid indirect_sg_entries parameter value
IB/srp: fix mr allocation when the device supports sg gaps
IB/iser: Fix sg_tablesize calculation
IB/cxgb3: fix misspelling in header guard
s390/ptrace: Preserve previous registers for short regset write
s390/mm: Fix cmma unused transfer from pgste into pte
RDMA/cma: Fix unknown symbol when CONFIG_IPV6 is not enabled
Btrfs: remove ->{get, set}_acl() from btrfs_dir_ro_inode_operations
Btrfs: disable xattr operations on subvolume directories
Btrfs: remove old tree_root case in btrfs_read_locked_inode()
ISDN: eicon: silence misleading array-bounds warning
xfs: prevent quotacheck from overloading inode lru
sysctl: fix proc_doulongvec_ms_jiffies_minmax()
userns: Make ucounts lock irq-safe
vring: Force use of DMA API for ARM-based systems with legacy devices
mm, page_alloc: fix premature OOM when racing with cpuset mems update
mm, page_alloc: move cpuset seqcount checking to slowpath
mm, page_alloc: fix fast-path race with cpuset update or removal
mm, page_alloc: fix check for NULL preferred_zone
mm/mempolicy.c: do not put mempolicy before using its nodemask
mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for thp
drm/atomic: clear out fence when duplicating state
Revert "drm/radeon: always apply pci shutdown callbacks"
drm/vc4: fix a bounds check
drm/vc4: Return -EINVAL on the overflow checks failing.
drm/vc4: Fix an integer overflow in temporary allocation layout.
drm/vc4: Fix memory leak of the CRTC state.
drm/i915: Ignore bogus plane coordinates on SKL when the plane is not visible
drm: Fix broken VT switch with video=1366x768 option
drm: Schedule the output_poll_work with 1s delay if we have delayed event
tile/ptrace: Preserve previous registers for short regset write
fbdev: color map copying bounds checking
ANDROID: sched/walt: Drop arch-specific timer access
ANDROID: sched/walt: include missing header for arm_timer_read_counter()
ANDROID: fs: Export vfs_rmdir2
ANDROID: fs: Export free_fs_struct and set_fs_pwd
ANDROID: cpufreq: interactive: Use idle-end notifiers
FROMLIST: cpufreq: Add android's 'interactive' governor
ANDROID: cpufreq: conservative: fix duplicate 'static' error
ANDROID: sdcardfs: eliminate the offset argument to ->direct_IO
ANDROID: sdcardfs: make it use new .rename i_op
ANDROID: sdcardfs: Propagate dentry down to inode_change_ok()
ANDROID: sdcardfs: get rid of 'parent' argument of ->d_compare()
ANDROID: sdcardfs: add parent pointer into dentry name hash
ANDROID: sdcardfs: use wrappers to access i_mutex
ANDROID: mnt: remount should propagate to slaves of slaves
ANDROID: sdcardfs: Fix locking issue with permision fix up
ANDROID: sdcardfs: Switch ->d_inode to d_inode()
ANDROID: sdcardfs: Change magic value
ANDROID: sdcardfs: Use per mount permissions
ANDROID: sdcardfs: Add gid and mask to private mount data
ANDROID: sdcardfs: User new permission2 functions
ANDROID: vfs: Add permission2 for filesystems with per mount permissions
ANDROID: vfs: Add setattr2 for filesystems with per mount permissions
ANDROID: vfs: Allow filesystems to access their private mount data
ANDROID: mnt: Add filesystem private data to mount points
ANDROID: sdcardfs: Move directory unlock before touch
ANDROID: sdcardfs: fix external storage exporting incorrect uid
ANDROID: sdcardfs: Added top to sdcardfs_inode_info
ANDROID: sdcardfs: Switch package list to RCU
ANDROID: sdcardfs: Fix locking for permission fix up
ANDROID: sdcardfs: Check for other cases on path lookup
ANDROID: sdcardfs: override umask on mkdir and create
ANDROID: sched/debug: Add energy procfs interface
ANDROID: cpufreq: sched: Fix kernel crash on accessing sysfs file
ANDROID: FIXUP: sched/tune: add fixes missing from a previous patch
ANDROID: sched: tune: Fix lacking spinlock initialization
ANDROID: cgroup: Remove leftover instances of allow_attach
ANDROID: FIXUP: sched: scheduler-driven cpu frequency selection
ANDROID: sched/rt: Add Kconfig option to enable panicking for RT throttling
ANDROID: sched/rt: print RT tasks when RT throttling is activated
ANDROID: sched/fair: Favor higher cpus only for boosted tasks
ANDROID: sched/fair: call OPP update when going idle after migration
ANDROID: sched/cpufreq_sched: fix thermal capping events
ANDROID: sched/fair: Picking cpus with low OPPs for tasks that prefer idle CPUs
ANDROID: FIXUP: sched/tune: do initialization as a postcore_initicall
ANDROID: DEBUG: sched: add tracepoint for RD overutilized
ANDROID: sched/tune: Introducing a new schedtune attribute prefer_idle
ANDROID: sched: use util instead of capacity to select busy cpu
ANDROID: arch_timer: add error handling when the MPM global timer is cleared
ANDROID: FIXUP: sched: Fix double-release of spinlock in move_queued_task
ANDROID: FIXUP: sched/fair: Fix hang during suspend in sched_group_energy
ANDROID: FIXUP: sched: fix SchedFreq integration for both PELT and WALT
ANDROID: sched: EAS: Avoid causing spikes to max-freq unnecessarily
ANDROID: FIXUP: sched: fix set_cfs_cpu_capacity when WALT is in use
ANDROID: sched/walt: Accounting for number of irqs pending on each core
ANDROID: sched: Introduce Window Assisted Load Tracking (WALT)
ANDROID: sched/tune: fix PB and PC cuts indexes definition
ANDROID: sched/fair: optimize idle cpu selection for boosted tasks
ANDROID: FIXUP: sched/tune: fix accounting for runnable tasks
ANDROID: sched/tune: use a single initialisation function
ANDROID: FIXUP: sched/tune: fix payoff calculation for boost region
ANDROID: sched/tune: Add support for negative boost values
ANDROID: FIX: sched/tune: move schedtune_nornalize_energy into fair.c
ANDROID: FIX: sched/tune: update usage of boosted task utilisation on CPU selection
ANDROID: sched/fair: add tunable to set initial task load
ANDROID: sched/fair: add tunable to force selection at cpu granularity
ANDROID: sched: EAS: take cstate into account when selecting idle core
ANDROID: sched/cpufreq_sched: Consolidated update
ANDROID: FIXUP: sched: fix build for non-SMP target
ANDROID: DEBUG: sched/tune: add tracepoint on P-E space filtering
ANDROID: DEBUG: sched/tune: add tracepoint for energy_diff() values
ANDROID: DEBUG: sched/tune: add tracepoint for task boost signal
CHROMIUM: sched: update the average of nr_running
ANDROID: DEBUG: schedtune: add tracepoint for schedtune_tasks_update() values
ANDROID: DEBUG: schedtune: add tracepoint for CPU boost signal
ANDROID: DEBUG: schedtune: add tracepoint for SchedTune configuration update
ANDROID: DEBUG: sched,cpufreq: add cpu_capacity change tracepoint
ANDROID: DEBUG: sched: add tracepoint for CPU load/util signals
ANDROID: DEBUG: sched: add tracepoint for task load/util signals
ANDROID: DEBUG: sched: add tracepoint for cpu/freq scale invariance
ANDROID: sched/fair: filter energy_diff() based on energy_payoff value
ANDROID: sched/tune: add support to compute normalized energy
ANDROID: sched/fair: keep track of energy/capacity variations
ANDROID: sched/fair: add boosted task utilization
ANDROID: sched/{fair,tune}: track RUNNABLE tasks impact on per CPU boost value
ANDROID: sched/tune: compute and keep track of per CPU boost value
ANDROID: sched/tune: add initial support for CGroups based boosting
ANDROID: sched/fair: add boosted CPU usage
ANDROID: sched/fair: add function to convert boost value into "margin"
ANDROID: sched/tune: add sysctl interface to define a boost value
ANDROID: sched/tune: add detailed documentation
ANDROID: fixup! sched: scheduler-driven cpu frequency selection
ANDROID: sched: remove call of sched_avg_update from sched_rt_avg_update
ANDROID: sched/cpufreq_sched: add trace events
ANDROID: sched/fair: jump to max OPP when crossing UP threshold
ANDROID: sched/fair: cpufreq_sched triggers for load balancing
ANDROID: sched/{core,fair}: trigger OPP change request on fork()
ANDROID: sched/fair: add triggers for OPP change requests
ANDROID: sched: scheduler-driven cpu frequency selection
ANDROID: cpufreq: introduce cpufreq_driver_is_slow
ANDROID: sched: Add group_misfit_task load-balance type
ANDROID: sched: Add per-cpu max capacity to sched_group_capacity
ANDROID: sched: Do eas idle balance regardless of the rq avg idle value
ANDROID: arm64: Enable max freq invariant scheduler load-tracking and capacity support
ANDROID: arm: Enable max freq invariant scheduler load-tracking and capacity support
ANDROID: sched: Update max cpu capacity in case of max frequency constraints
ANDROID: cpufreq: Max freq invariant scheduler load-tracking and cpu capacity support
ANDROID: sched: Disable energy-unfriendly nohz kicks
ANDROID: sched: Consider a not over-utilized energy-aware system as balanced
ANDROID: sched: Energy-aware wake-up task placement
ANDROID: sched: Determine the current sched_group idle-state
ANDROID: sched, cpuidle: Track cpuidle state index in the scheduler
ANDROID: sched: Add over-utilization/tipping point indicator
ANDROID: sched: Estimate energy impact of scheduling decisions
ANDROID: sched: Extend sched_group_energy to test load-balancing decisions
ANDROID: sched: Calculate energy consumption of sched_group
ANDROID: sched: Highest energy aware balancing sched_domain level pointer
ANDROID: sched: Relocated cpu_util() and change return type
ANDROID: sched: Compute cpu capacity available at current frequency
ANDROID: sched: Support for extracting EAS energy costs from DT
ANDROID: arm64, topology: Updates to use DT bindings for EAS costing data
ANDROID: arm64: Cpu invariant scheduler load-tracking and capacity support
ANDROID: arm: Cpu invariant scheduler load-tracking and capacity support
ANDROID: sched: Introduce SD_SHARE_CAP_STATES sched_domain flag
ANDROID: sched: Initialize energy data structures
ANDROID: sched: Make energy awareness a sched feature
ANDROID: sched: Documentation for scheduler energy cost model
ANDROID: sched: Prevent unnecessary active balance of single task in sched group
ANDROID: sched: Enable idle balance to pull single task towards cpu with higher capacity
ANDROID: sched: Consider spare cpu capacity at task wake-up
ANDROID: sched: Add cpu capacity awareness to wakeup balancing
ANDROID: arm: Update arch_scale_cpu_capacity() to reflect change to define
ANDROID: arm64: Enable frequency invariant scheduler load-tracking support
ANDROID: arm: Enable frequency invariant scheduler load-tracking support
ANDROID: cpufreq: Frequency invariant scheduler load-tracking support
ANDROID: [CPUFREQ] Don't export governors for default governor
ANDROID: kernel/configs: recommended: CONFIG_ARM64_SW_TTBR0_PAN=y
ANDROID: kernel/configs: base: Enable QUOTA related configs
ANDROID: kernel/configs: recommended: Enable MEMORY_STATE_TIME
FROMLIST: config: android-base: enable hardened usercopy and kernel ASLR
FROMLIST: config: android-recommended: disable aio support
ANDROID: kernel/configs: recommended: enable fstack-protector-strong
ANDROID: kernel/configs: base: enable UID_CPUTIME
ANDROID: kernel/configs: base: restrict access to perf events
ANDROID: configs: base: enable configfs gadget functions
ANDROID: configs: merge AOSP config fragments
ANDROID: Implement memory_state_time, used by qcom,cpubw
ANDROID: dm: rebase for 4.9
ANDROID: usb: otg-wakelock: Remove wakelock.h dependencies
ANDROID: gpio_matrix: Remove wakelock.h dependencies
ANDROID: fiq_debugger: Remove wakelock.h dependencies
UPSTREAM: net: socket: don't set sk_uid to garbage value in ->setattr()
ANDROID: trace: net: use %pK for kernel pointers
UPSTREAM: net: ipv4: Don't crash if passing a null sk to ip_rt_update_pmtu.
UPSTREAM: net: inet: Support UID-based routing in IP protocols.
UPSTREAM: net: core: add UID to flows, rules, and routes
UPSTREAM: net: core: Add a UID field to struct sock.
ANDROID: fs: FS tracepoints to track IO.
ANDROID: MMC/UFS IO Latency Histograms.
CHROMIUM: fix warning when releasing active sync point
ANDROID: goldfish_pipe: fix allmodconfig build
ANDROID: goldfish: goldfish_pipe: fix locking errors
ANDROID: goldfish_pipe: fix call_kern.cocci warnings
ANDROID: goldfish_pipe: An implementation of more parallel pipe
ANDROID: goldfish_pipe: bugfixes and performance improvements.
ANDROID: goldfish: disable GOLDFISH_SYNC
ANDROID: goldfish: enable CONFIG_INET_DIAG_DESTROY
ANDROID: build: fix build config kernel_dir
ANDROID: dm verity: add minimum prefetch size
ANDROID: build: add build server configs for goldfish
UPSTREAM: trace: Update documentation for mono, mono_raw and boot clock
UPSTREAM: trace: Add an option for boot clock as trace clock
UPSTREAM: timekeeping: Add a fast and NMI safe boot clock
ANDROID: video: goldfishfb: fix platform_no_drv_owner.cocci warnings
ANDROID: arm64: rename ranchu defconfig to ranchu64
ANDROID: arch: x86: disable pic for Android toolchain
ANDROID: goldfish: Add goldfish sync driver
ANDROID: goldfish: add ranchu defconfigs
ANDROID: goldfish_audio: Clear audio read buffer status after each read
ANDROID: goldfish_events: no extra EV_SYN; register goldfish
ANDROID: goldfish_fb: Set pixclock = 0
ANDROID: goldfish: Enable ACPI-based enumeration for goldfish audio
ANDROID: goldfish: Enable ACPI-based enumeration for goldfish framebuffer
ANDROID: video: goldfishfb: add devicetree bindings
ANDROID: usb: gadget: function: cleanup: Add blank line after declaration
ANDROID: usb: gadget: f_mtp: simplify ptp NULL pointer check
ANDROID: usb: gadget: audio_source: fix comparison of distinct pointer types
ANDROID: binder: support for file-descriptor arrays.
ANDROID: binder: support for scatter-gather.
ANDROID: binder: add extra size to allocator.
ANDROID: binder: refactor binder_transact()
ANDROID: binder: support multiple /dev instances.
ANDROID: binder: deal with contexts in debugfs.
ANDROID: binder: support multiple context managers.
ANDROID: binder: split flat_binder_object.
ANDROID: [RFC]cgroup: Change from CAP_SYS_NICE to CAP_SYS_RESOURCE for cgroup migration permissions
CHROMIUM: cgroups: relax permissions on moving tasks between cgroups
ANDROID: dm: android-verity: Remove fec_header location constraint
ANDROID: fiq_debugger: Pass task parameter to unwind_frame()
ANDROID: input: keyreset: switch to orderly_reboot
ANDROID: cpuset: Make cpusets restore on hotplug
ANDROID: Don't show empty tag stats for unprivileged uids
ANDROID: dm: android-verity: Allow android-verity to be compiled as an independent module
ANDROID: dm-verity: adopt changes made to dm callbacks
ANDROID: dm verity fec: pack the fec_header structure
ANDROID: dm: android-verity: Verify header before fetching table
ANDROID: dm: allow adb disable-verity only in userdebug
ANDROID: dm: mount as linear target if eng build
ANDROID: dm: use default verity public key
ANDROID: dm: fix signature verification flag
ANDROID: dm: use name_to_dev_t
ANDROID: dm: rename dm-linear methods for dm-android-verity
ANDROID: dm: Minor cleanup
ANDROID: dm: Mounting root as linear device when verity disabled
ANDROID: dm-android-verity: Rebase on top of 4.1
ANDROID: dm: Add android verity target
ANDROID: dm: fix dm_substitute_devices()
ANDROID: dm: Rebase on top of 4.9
CHROMIUM: dm: boot time specification of dm=
ANDROID: usb: gadget: f_accessory: remove duplicate endpoint alloc
ANDROID: sdcardfs: fix itnull.cocci warnings
ANDROID: sdcardfs: Truncate packages_gid.list on overflow
ANDROID: netfilter: xt_quota2: make quota2_log work well
ANDROID: cpu: send KOBJ_ONLINE event when enabling cpus
ANDROID: dm verity fec: initialize recursion level
ANDROID: dm verity fec: add missing release from fec_ktype
ANDROID: dm verity fec: limit error correction recursion
FROMLIST: security,perf: Allow further restriction of perf_event_open
ANDROID: ARM64: Ignore Image-dtb from git point of view
ANDROID: arm64: add option to build Image-dtb
ANDROID: usb: gadget: f_midi: set fi->f to NULL when free f_midi function
ANDROID: xt_qtaguid: Fix panic caused by processing non-full socket.
ANDROID: fiq_debugger: Add fiq_debugger.disable option
FROMLIST: wlcore: Disable filtering in AP role
ANDROID: fiq_debugger: Add option to apply uart overlay by FIQ_DEBUGGER_UART_OVERLAY
ANDROID: usb: dual-role: make stub functions inline
ANDROID: quick selinux support for tracefs
ANDROID: xt_qtaguid: Fix panic caused by synack processing
ANDROID: fuse: Add support for d_canonical_path
ANDROID: vfs: change d_canonical_path to take two paths
ANDROID: netfilter: xt_qtaguid: seq_printf fixes
ANDROID: mmc: Add CONFIG_MMC_SIMULATE_MAX_SPEED
ANDROID: dm verity fec: add sysfs attribute fec/corrected
ANDROID: mm: Export do_munmap
ANDROID: sdcardfs: remove unneeded __init and __exit
ANDROID: sdcardfs: Remove unused code
ANDROID: fs: Export d_absolute_path
ANDROID: sdcardfs: remove effectless config option
ANDROID: inotify: Fix erroneous update of bit count
ANDROID: fs: sdcardfs: Declare LOOKUP_CASE_INSENSITIVE unconditionally
ANDROID: trace: cpufreq: fix typo in min/max cpufreq
ANDROID: sdcardfs: Add support for d_canonical_path
ANDROID: vfs: add d_canonical_path for stacked filesystem support
ANDROID: sdcardfs: Bring up to date with Android M permissions:
ANDROID: Changed type-casting in packagelist management
ANDROID: Port of sdcardfs to 4.4
ANDROID: Included sdcardfs source code for kernel 3.0
ANDROID: usb: gadget: Add support for MTP OS desc
CHROMIUM: usb: gadget: f_accessory: add .raw_request callback
CHROMIUM: usb: gadget: audio_source: add .free_func callback
CHROMIUM: usb: gadget: f_mtp: fix usb_ss_ep_comp_descriptor
CHROMIUM: usb: gadget: f_mtp: Add SuperSpeed support
ANDROID: dm-crypt: run in a WQ_HIGHPRI workqueue
ANDROID: power: Provide dummy log_suspend_abort_reason() if SUSPEND is disabled
ANDROID: PM / suspend: Add dependency on RTC_LIB
ANDROID: net: pppolac/pppopns: Replace msg.msg_iov with iov_iter_kvec()
ANDROID: mmc: sdio: Disable retuning in sdio_reset_comm()
ANDROID: kernel/watchdog: fix unused variable warning
ANDROID: usb: gadget: f_mtp: don't use le16 for u8 field
ANDROID: lowmemorykiller: fix declaration order warnings
ANDROID: mmc: move to a SCHED_FIFO thread
ANDROID: skip building drivers as modules
ANDROID: wakeup: Add the guard condition for len in pm_get_active_wakeup_sources
ANDROID: goldfish: pipe: fix platform_no_drv_owner.cocci warnings
ANDROID: epoll: use freezable blocking call
ANDROID: Fix for in kernel emergency remount when loop mounts are used
ANDROID: kbuild: Makefile.clean: make Kbuild and Makefile optional
ANDROID: kbuild: make it possible to specify the module output dir
ANDROID: ext4: Add support for FIDTRIM, a best-effort ioctl for deep discard trim
ANDROID: hardlockup: detect hard lockups without NMIs using secondary cpus
ANDROID: rtc-palmas: correct for bcd year
ANDROID: w1: ds2482: Manage SLPZ pin sleep state
ANDROID: fuse: Freeze client on suspend when request sent to userspace
ANDROID: serial_core: Add wake_peer uart operation
ANDROID: mm: add a field to store names for private anonymous memory
ANDROID: pstore/ram: Add ramoops_console_write_buf api
ANDROID: pstore: Update Documentation/android.txt
ANDROID: initramfs: Add skip_initramfs command line option
ANDROID: of: Fix build warnings
ANDROID: of: fix CONFIG_CMDLINE_EXTEND
ANDROID: ARM64: copy CONFIG_CMDLINE_EXTEND from ARM
ANDROID: of: Support CONFIG_CMDLINE_EXTEND config option
ANDROID: ARM: decompressor: Flush tlb before swiching domain 0 to client mode
ANDROID: ARM64: add option to build Image.gz/dtb combo
ANDROID: ARM: convert build of appended dtb zImage to list of dtbs
ANDROID: ARM: add config option to build zImage/dtb combo
ANDROID: ARM: Fix dtb list when DTB_IMAGE_NAMES is empty
ANDROID: arm64: pass return address to dma_common_contiguous_remap
ANDROID: arch: arm64: force -fno-pic
ANDROID: arm64: process: dump memory around registers when displaying regs
ANDROID: arm64: check for upper PAGE_SHIFT bits in pfn_valid()
ANDROID: ARM: fault: assume no context when IRQs are disabled during data abort.
ANDROID: ARM: Fix "Make low-level printk work" to use a separate config option
ANDROID: ARM: add option to flush console before reboot
ANDROID: ARM: Make low-level printk work
ANDROID: Optionally flush entire dcache from v6_dma_flush_range
ANDROID: process: Add display of memory around registers when displaying regs.
ANDROID: security: Add proper checks for Android specific capability checks
ANDROID: uid_cputime: skip power reporting per uid for now
ANDROID: uid_cputime: Check for the range while removing range of UIDs.
ANDROID: uid_cputime: Iterates over all the threads instead of processes.
ANDROID: uid_cputime: fix cputime overflow
ANDROID: uid_cputime: Avoids double accounting of process stime, utime and cpu_power in task exit.
ANDROID: uid_cputime: Extends the cputime functionality to report power per uid
ANDROID: proc: uid_cputime: fix show_uid_stat permission
ANDROID: proc: uid_cputime: create uids from kuids
ANDROID: proc: uid: Adds accounting for the cputimes per uid.
ANDROID: fixup! proc: make oom adjustment files user read-only
ANDROID: proc: make oom adjustment files user read-only
ANDROID: proc: smaps: Allow smaps access for CAP_SYS_RESOURCE
ANDROID: wakeup_reason: use vsnprintf instead of snsprintf for vargs.
ANDROID: power: wakeup_reason: fix suspend time reporting
ANDROID: wakeup: Add last wake up source logging for suspend abort reason.
ANDROID: Power: Report suspend times from last_suspend_time
ANDROID: Make suspend abort reason logging depend on CONFIG_PM_SLEEP
ANDROID: power: Add check_wakeup_reason() to verify wakeup source irq
ANDROID: power: Adds functionality to log the last suspend abort reason.
ANDROID: power: Avoids bogus error messages for the suspend aborts.
ANDROID: power: Add property CHARGE_COUNTER_EXT and 64-bit precision properties
ANDROID: Power: Changes the permission to read only for sysfs file /sys/kernel/wakeup_reasons/last_resume_reason
ANDROID: power: wakeup_reason: rename irq_count to irqcount
ANDROID: Power: Add guard condition for maximum wakeup reasons
ANDROID: POWER: fix compile warnings in log_wakeup_reason
ANDROID: Power: add an API to log wakeup reasons
ANDROID: PM / Suspend: Print wall time at suspend entry and exit
ANDROID: power: power_supply: add POWER_SUPPLY_PROP_CHARGE_ENABLED
ANDROID: power: power_supply: add POWER_SUPPLY_PROP_USB_OTG
ANDROID: power: power_supply: move POWER_SUPPLY_PROP_USB_HC to type 'int' order
ANDROID: power_supply: Add custom property for USB High Current mode
ANDROID: trace: power: add trace_clock_set_parent
ANDROID: trace: cpufreq: Add tracing for min/max cpufreq
ANDROID: trace: fix compilation for 4.1
ANDROID: trace/events: fix gpu event timestamp formatting
ANDROID: trace: add non-hierarchical function_graph option
ANDROID: trace: Add an option to show tgids in trace output
ANDROID: trace/events: add gpu trace events
ANDROID: sync: add Documentation/sync.txt
ANDROID: ARM: Call idle notifiers
ANDROID: Move x86_64 idle notifiers to generic
ANDROID: cpuidle: governor: menu: don't use loadavg
ANDROID: sched: add sched blocked tracepoint which dumps out context of sleep.
ANDROID: sched: Enable might_sleep before initializing drivers.
ANDROID: fiq_debugger: Build fixes for 4.1
ANDROID: fiq_debugger: Add fiq_watchdog_triggered api
ANDROID: fiq_debugger: Call fiq_debugger_printf through a function pointer from cpu specific code
ANDROID: fiq_debugger: add ARM64 support
ANDROID: fiq_debugger: split arm support into fiq_debugger_arm.c
ANDROID: fiq_debugger: use pt_regs for registers
ANDROID: fiq_debugger: allow compiling without CONFIG_FIQ_GLUE
ANDROID: fiq_debugger: rename debug->fiq_debugger
ANDROID: fiq_debugger: move into drivers/staging/android/fiq_debugger/
ANDROID: ARM: fiq_glue: Add custom fiq return handler api.
ANDROID: ARM: kgdb: ignore breakpoint instructions from user mode
ANDROID: ARM: fiq_debugger: Update tty code for 3.9
ANDROID: ARM: fiq_debugger: Use kmsg_dumper to dump kernel logs
ANDROID: ARM: fiq_debugger: Fix to compile on 3.7
ANDROID: ARM: fiq_debugger: fix uninitialised spin_lock.
ANDROID: ARM: fiq_debugger: lock between tty and console writes
ANDROID: ARM: fiq_debugger: add process context reboot command
ANDROID: ARM: fiq_debugger: fix multiple consoles and make it a preferred console
ANDROID: kdb: support new lines without carriage returns
ANDROID: ARM: fiq_debugger: add support for kgdb
ANDROID: ARM: fiq_debugger: add debug_putc
ANDROID: ARM: fiq_debugger: add support for reboot commands
ANDROID: ARM: fiq_debugger: fix compiling for v3.3
ANDROID: ARM: Add generic fiq serial debugger
ANDROID: ARM: Add fiq_glue
ANDROID: fix false disconnect due to a signal sent to the reading process
ANDROID: usb: gadget: cleanup: fix unused variable and function warnings
ANDROID: usb: gadget: build audio_source function only if SND is enabled
ANDROID: usb: gadget: configfs: handle gadget reset request for android
ANDROID: usb: gadget: create F_midi device
ANDROID: usb: gadget: Add device attribute to determine gadget state
ANDROID: usb: phy: fix dual role sysfs build if kernel modules are supported
ANDROID: usb: phy: Dual role sysfs class definition
ANDROID: usb: gadget: fix NULL ptr derefer while symlinking PTP func
ANDROID: usb:gadget:Add "state" attribute to android_device
ANDROID: usb: gadget: Do not disconnect unregistered dev
ANDROID: usb: gadget: Relocate f_accessory
ANDROID: usb: gadget: Accessory:Migrate to USB_FUNCTION API
ANDROID: usb: gadget: Move gadget functions code
ANDROID: usb:gadget:audio_source: Move to USB_FUNCTION API
ANDROID: usb: gadget: Add function devices to the parent
ANDROID: usb: gadget: f_audio_source:replace deprecated API
ANDROID: usb: gadget: check for accessory device before disconnecting HIDs
ANDROID: usb: gadget: Add Uevent to notify userspace
ANDROID: usb: gadget: configfs: Add usb_function ptr to fi struct
ANDROID: usb: gadget: mtp/ptp: Migrate functions to the USB_FUNCTION interface
Linux 4.9.6
libceph: stop allocating a new cipher on every crypto request
libceph: uninline ceph_crypto_key_destroy()
tools/virtio/ringtest: fix run-on-all.sh for offline cpus
selftest/powerpc: Wrong PMC initialized in pmc56_overflow test
soc: ti: wkup_m3_ipc: Fix error return code in wkup_m3_ipc_probe()
spi: pxa2xx: add missed break
dmaengine: pl330: Fix runtime PM support for terminated transfers
dmaengine: rcar-dmac: unmap slave resource when channel is freed
s5p-mfc: Fix clock management in s5p_mfc_release() function
s5p-cec: mark PM functions as __maybe_unused again
st-hva: fix some error handling in hva_hw_probe()
ite-cir: initialize use_demodulator before using it
gs1662: drop kfree for memory allocated with devm_kzalloc
platform: pxa_camera: add VIDEO_V4L2 dependency
blackfin: check devm_pinctrl_get() for errors
rpmsg: virtio_rpmsg_bus: fix channel creation
mtd: spi-nor: Fix some error codes in cqspi_setup_flash()
mtd: spi-nor: Off by one in cqspi_setup_flash()
PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL
PM / devfreq: exynos-bus: Fix the wrong return value
scsi: mpt3sas: fix hang on ata passthrough commands
scsi: ses: Fix SAS device detection in enclosure
swiotlb: Add swiotlb=noforce debug option
swiotlb: Convert swiotlb_force from int to enum
arm64: Fix swiotlb fallback allocation
arm64: mm: avoid name clash in __page_to_voff()
xprtrdma: Squelch "max send, max recv" messages at connect time
xprtrdma: Make FRWR send queue entry accounting more accurate
libceph: make sure ceph_aes_crypt() IV is aligned
ceph: fix endianness bug in frag_tree_split_cmp
ceph: fix endianness of getattr mask in ceph_d_revalidate
ceph: fix ceph_get_caps() interruption
ceph: fix scheduler warning due to nested blocking
ARM: 8613/1: Fix the uaccess crash on PB11MPCore
ARM: ux500: fix prcmu_is_cpu_in_wfi() calculation
ARM: dts: omap3: Fix Card Detect and Write Protect on Logic PD SOM-LV
ARM: dts: imx6qdl-nitrogen6_max: fix sgtl5000 pinctrl init
ARM: dts: omap2: Add an empty chosen node to top level DTSI
ARM: dts: omap3: Add an empty chosen node to top level DTSI
ARM: dts: am4372: Add an empty chosen node to top level DTSI
ARM: dts: omap5: Add an empty chosen node to top level DTSI
ARM: dts: omap4: Add an empty chosen node to top level DTSI
ARM: dts: am33xx: Add an empty chosen node to top level DTSI
ARM: dts: dm814x: Add an empty chosen node to top level DTSI
ARM: dts: dm816x: Add an empty chosen node to top level DTSI
ARM: dts: dra7: Add an empty chosen node to top level DTSI
libceph: remove now unused ceph_*{en,de}crypt*() functions
libceph: switch ceph_x_decrypt() to ceph_crypt()
libceph: switch ceph_x_encrypt() to ceph_crypt()
libceph: tweak calcu_signature() a little
libceph: rename and align ceph_x_authorizer::reply_buf
libceph: introduce ceph_crypt() for in-place en/decryption
libceph: introduce ceph_x_encrypt_offset()
libceph: old_key in process_one_ticket() is redundant
libceph: ceph_x_encrypt_buflen() takes in_len
Input: ALPS - fix TrackStick support for SS5 hardware
arm64/ptrace: Reject attempts to set incomplete hardware breakpoint fields
arm64/ptrace: Avoid uninitialised struct padding in fpr_set()
arm64/ptrace: Preserve previous registers for short regset write - 3
arm64/ptrace: Preserve previous registers for short regset write - 2
arm64/ptrace: Preserve previous registers for short regset write
arm64: avoid returning from bad_mode
ARM: dts: da850-evm: fix read access to SPI flash
ARM: dts: OMAP5 / DRA7: indicate that SATA port 0 is available.
ceph: fix bad endianness handling in parse_reply_info_extra
ibmvscsis: Fix max transfer length
ibmvscsis: Fix sleeping in interrupt context
ARM: 8634/1: hw_breakpoint: blacklist Scorpion CPUs
svcrdma: avoid duplicate dma unmapping during error recovery
clocksource/exynos_mct: Clear interrupt when cpu is shut down
ubifs: Fix journal replay wrt. xattr nodes
mac80211: implement multicast forwarding on fast-RX path
qla2xxx: Fix crash due to null pointer access
x86/ioapic: Restore IO-APIC irq_chip retrigger callback
powerpc: Ignore reserved field in DCSR and PVR reads and writes
powerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write
powerpc/ptrace: Preserve previous fprs/vsrs on short regset write
powerpc/perf: Fix PM_BRU_CMPL event code for power9
powerpc/icp-opal: Fix missing KVM case and harden replay
KVM: arm/arm64: vgic: Fix deadlock on error handling
KVM: s390: do not expose random data via facility bitmap
mtd: nand: xway: fix build because of module functions
mtd: nand: xway: disable module support
mtd: nand: lpc32xx: fix invalid error handling of a requested irq
ieee802154: atusb: do not use the stack for buffers to make them DMA able
mmc: mxs-mmc: Fix additional cycles after transmission stop
mmc: sdhci-acpi: Only powered up enabled acpi child devices
HID: corsair: fix control-transfer error handling
HID: corsair: fix DMA buffers on stack
PCI: Enumerate switches below PCI-to-PCIe bridges
PCI: designware: Check for iATU unroll only on platforms that use ATU
fuse: fix time_to_jiffies nsec sanity check
fuse: clear FR_PENDING flag when moving requests out of pending queue
ARC: module: Fix !CONFIG_ARC_DW2_UNWIND builds
libnvdimm, namespace: fix pmem namespace leak, delete when size set to zero
svcrpc: don't leak contexts on PROC_DESTROY
sunrpc: don't call sleeping functions from the notifier block callbacks
rcu: Narrow early boot window of illegal synchronous grace periods
rcu: Remove cond_resched() from Tiny synchronize_sched()
x86/PCI: Ignore _CRS on Supermicro X8DTH-i/6/iF/6F
tmpfs: clear S_ISGID when setting posix ACLs
ARM: dts: omap3: Add DTS for Logic PD SOM-LV 37xx Dev Kit
ARM: dts: imx31: fix AVIC base address
ARM: dts: imx31: move CCM device node to AIPS2 bus devices
ARM: dts: imx31: fix clock control module interrupts description
ARM: dts: imx6q-cm-fx6: fix fec pinctrl
ARM: dts: r8a7794: remove Z clock
ARM: dts: r8a7794: Use SYSC "always-on" PM Domain for sound
ARM: dts: bcm283x: fix typo in mailbox address
perf jit: Enable jitdump support without dwarf
perf scripting: Avoid leaking the scripting_context variable
perf callchain: Fixup help/config for no-unwinding
perf diff: Do not overwrite valid build id
perf trace: Check if MAP_32BIT is defined (again)
perf mem: Fix --all-user/--all-kernel options
perf trace: Use the syscall raw_syscalls:sys_enter timestamp
IB/IPoIB: Remove can't use GFP_NOIO warning
IB/mlx4: Check if GRH is available before using it
IB/mlx4: When no DMFS for IPoIB, don't allow NET_IF QPs
IB/mlx4: Fix port query for 56Gb Ethernet links
IB/mlx4: Handle well-known-gid in mad_demux processing
IB/mlx4: Fix out-of-range array index in destroy qp flow
IB/mlx4: Set traffic class in AH
IB/mlx5: Wait for all async command completions to complete
IB/mlx5: Assign SRQ type earlier
IB/mlx5: Fix reported max SGE calculation
IB/mlx5: Avoid system crash when enabling many VFs
IB/rxe: avoid putting a large struct rxe_qp on stack
IB/rxe: Increase max number of completions to 32k
IB/core: Release allocated memory in cache setup failure
Linux 4.9.5
ANDROID: usb: gadget: f_audio_source: Fixed USB Audio Class Interface Descriptor
ANDROID: usb: gadget: f_audio_source: change max ISO packet size
ANDROID: usb: gadget: f_accessory: Enabled Zero Length Packet (ZLP) for acc_write
ANDROID: drivers: usb: gadget: 64-bit related type fixes
ANDROID: usb: gadget: f_accessory: move userspace interface to uapi
ANDROID: usb: gadget: f_mtp: move userspace interface to uapi
ANDROID: USB: remove duplicate out endpoint creation in MTP mode
ANDROID: usb: gadget: Fix android gadget driver build
ANDROID: usb: gadget: Fixes and hacks to make android usb gadget compile on 3.8
ANDROID: usb: otg: otg-wakelock: Fix build for 3.7
ANDROID: usb: gadget: accessory: Fix section mismatch (again)
ANDROID: USB: gadget: f_audio_source: New gadget driver for audio output
ANDROID: USB: gadget: f_accessory: Add support for HID input devices
ANDROID: USB: gadget: Add ACCESSORY_SET_AUDIO_MODE control request and ioctl
ANDROID: usb: gadget: accessory: Fix section mismatch
ANDROID: usb: otg: otg-wakelock: Fix build for 3.4
ANDROID: usb: gadget: adb: Only enable the gadget when adbd is ready
ANDROID: usb: gadget: adb: do not set error flag when dequeuing req
ANDROID: usb: gadget: adb: allow freezing in adb_read
ANDROID: usb: gadget: accessory: Add Android Accessory function
ANDROID: usb: gadget: adb: Add ADB function
ANDROID: usb: gadget: mtp: Add MTP/PTP function
ANDROID: usb: otg: otg-wakelock: fix build for 3.3
ANDROID: usb: otg: Temporarily grab wakelock on charger and disconnect events
ANDROID: USB: OTG: Take wakelock when VBUS present
ANDROID: wlan: Add get_wake_irq functionality
ANDROID: Add flags parameter to get_country_code template
ANDROID: net: wireless: Add get_country_code functionality to platform
ANDROID: network: wireless: Add get_mac_addr functionality to platform
ANDROID: wlan: Create generic wlan platform data header
ANDROID: net: wireless: Decrease scan entry expiration to avoid stall results
ANDROID: bridge: Have tx_bytes count headers like rx_bytes.
ANDROID: rfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power down
ANDROID: net: ipv6: fix virtual tunneling build
ANDROID: tcp: fix tcp_default_init_rwnd() for 4.1
ANDROID: net: support marking accepting TCP sockets
ANDROID: tcp: add a sysctl to config the tcp_default_init_rwnd
ANDROID: xt_qtaguid: fix a race condition in if_tag_stat_update
ANDROID: netfilter: xt_qtaguid/socket: build fixes for 4.4
ANDROID: netfilter: xt_qtaguid: xt_socket: build fixes
ANDROID: net: xt_qtaguid/xt_socket: fix refcount underflow and crash
ANDROID: xt_qtaguid: use sock_gen_put() instead of xt_socket_put_sk()
ANDROID: xt_qtaguid: Use sk_callback_lock read locks before reading sk->sk_socket
ANDROID: xt_qtaguid: fix broken uid/gid range check
ANDROID: netfilter: Build fixups - kuid/kguid changes & xt_socket_get/put_sk
ANDROID: net: ipv6: autoconf routes into per-device tables
ANDROID: nf: IDLETIMER: Fix broken uid field in the msg
ANDROID: nf: IDLETIMER: Adds the uid field in the msg
ANDROID: netfilter: fix seq_printf type mismatch warning
ANDROID: nf: Remove compilation error caused by e8430cbed3ef15fdb1ac26cfd020e010aa5f1c35
ANDROID: nf: IDLETIMER: time-stamp and suspend/resume handling.
ANDROID: xt_qtaguid: Fix boot panic
ANDROID: net: kuid/kguid build fixes
ANDROID: netfilter: ipv6: fix crash caused by ipv6_find_hdr()
ANDROID: netfilter: xt_qtaguid: 64-bit warning fixes
ANDROID: netfilter: xt_qtaguid: fix memory leak in seq_file handlers
ANDROID: netfilter: xt_qtaguid: fix bad tcp_time_wait sock handling
ANDROID: netfilter: xt_qtaguid: 3.10 fixes
ANDROID: netfilter: xt_quota2: 3.10 fixes.
ANDROID: netfilter: qtaguid: rate limit some of the printks
ANDROID: netfilter: xt_qtaguid: Allow tracking loopback
ANDROID: netfilter: xt_qtaguid: extend iface stat to report protocols
ANDROID: netfilter: xt_qtaguid: remove AID_* dependency for access control
ANDROID: netfilter: qtaguid: Don't BUG_ON if create_if_tag_stat fails
ANDROID: netfilter: xt_qtaguid: fix error exit that would keep a spinlock.
ANDROID: netfilter: xt_qtaguid: report only uid tags to non-privileged processes
ANDROID: netfilter: xt_qtaguid: start tracking iface rx/tx at low level
ANDROID: netfilter: xt_IDLETIMER: Add new netlink msg type
ANDROID: netfilter: xt_qtaguid: fix ipv6 protocol lookup
ANDROID: netfilter: qtaguid: initialize a local var to keep compiler happy.
ANDROID: netfilter: fixup the quota2, and enable.
ANDROID: netfilter: adding the original quota2 from xtables-addons
ANDROID: netfilter: add xt_qtaguid matching module
ANDROID: net: PPPoPNS and PPPoLAC build fixes for 4.4
ANDROID: Hack: net: PPPoPNS and PPPoLAC build fixes for 4.1
ANDROID: net: pppopns: pppolac: fix sendmsg function calls
ANDROID: net: PPPoPNS: Remove length argument from data_ready
ANDROID: net: move PPPoLAC and PPPoPNS headers to uapi
ANDROID: Include if_pppolac.h and if_pppopns.h into header-y target
ANDROID: net: PPPoPNS and PPPoLAC update to use PPP_MRU instead of PPP_MRU
ANDROID: net: Reorder incoming packets in PPPoLAC and PPPoPNS.
ANDROID: net: PPPoPNS and PPPoLAC fixes.
ANDROID: net: add PPP on PPTP Network Server (PPPoPNS) driver.
ANDROID: net: add PPP on L2TP Access Concentrator (PPPoLAC) driver.
ANDROID: sysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size
ANDROID: net: Only NET_ADMIN is allowed to fully control TUN interfaces.
ANDROID: net: Replace AID_NET_RAW checks with capable(CAP_NET_RAW).
ANDROID: security: Add AID_NET_RAW and AID_NET_ADMIN capability check in cap_capable().
ANDROID: Paranoid network.
ANDROID: Add android_aid.h
ANDROID: fs: block_dump: Don't display inode changes if block_dump < 2
ANDROID: mmc: core: Remove stray CONFIG_EXPERIMENTAL dependencies
ANDROID: mmc: Add "ignore mmc pm notify" functionality
ANDROID: mmc: sdio: Fix sdio_reset_comm for sync
ANDROID: mmc: sdio: fix sdio_reset_comm() voltage selection
ANDROID: mmc: sdio: Fix enable_hs and enable_wide in sdio_reset_comm()
ANDROID: mmc: sdio: Add high speed support to sdio_reset_comm()
ANDROID: mmc: sdio: Claim host in sdio_reset_comm()
ANDROID: mmc: Add new API call 'sdio_reset_comm' for resetting communication with an SDIO device
ANDROID: mmc: Add sdio_readb_ext() function
ANDROID: mmc: Add concept of an 'embedded' SDIO device.
ANDROID: mmc: sd: Add retries in re-detection
ANDROID: mmc: sd: When resuming, try a little harder to init the card
ANDROID: mmc: sd: Add new CONFIG_MMC_PARANOID_SD_INIT for enabling retries during SD detection
ANDROID: mtd: nand: Allow NAND chip ids to be included standalone.
ANDROID: gpio_input: convert from wakelocks to wakeup sources
ANDROID: input: Made keyreset more robust
ANDROID: input: Changed keyreset to act as a wrapper for keycombo.
ANDROID: input: add keycombo, a general key combo driver.
ANDROID: input: misc: keychord: move header to uapi
ANDROID: input: misc: keychord: log when keychord triggered
ANDROID: input: keychord: Add keychord driver
ANDROID: input: Add keyreset driver.
ANDROID: input: misc: gpio_event: remove early suspend
ANDROID: Input: Generic GPIO Input device.
ANDROID: lowmemorykiller: use module_param_cb instead of __module_param_call
ANDROID: lowmemorykiller: trace kill events.
ANDROID: staging: lowmemorykiller: Add config option to support oom_adj values
pinctrl: sh-pfc: Do not unconditionally support PIN_CONFIG_BIAS_DISABLE
arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
arm64: hugetlb: remove the wrong pmd check in find_num_contig()
arm64: hugetlb: fix the wrong address for several functions
powerpc/powernv: Don't warn on PE init if unfreeze is unsupported
powerpc/ibmebus: Fix device reference leaks in sysfs interface
powerpc/ibmebus: Fix further device reference leaks
powerpc/mm: Correct process and partition table max size
bus: vexpress-config: fix device reference leak
blk-mq: Always schedule hctx->next_cpu
power: supply: bq27xxx_battery: Fix register map for BQ27510 and BQ27520
bq24190_charger: Fix PM runtime use for bq24190_battery_set_property
iw_cxgb4: Fix error return code in c4iw_rdev_open()
powercap/intel_rapl: fix and tidy up error handling
ACPI / APEI: Fix NMI notification handling
block: cfq_cpd_alloc() should use @gfp
block: Change extern inline to static inline
ACPI / CPPC: set an error code on probe error path
regulators: helpers: Fix handling of bypass_val_on in get_bypass_regmap
cpufreq: powernv: Disable preemption while checking CPU throttling state
powerpc/64: Simplify adaptation to new ISA v3.00 HPTE format
remoteproc: st: Fix error return code in st_rproc_probe()
remoteproc: qcom_wcnss: Fix circular module dependency
drm: Initialise drm_mm.head_node.allocated
drm/i915: Move the min_pixclk[] handling to the end of readout
drm/panel: simple: Check against num_timings when setting preferred for timing
drm: avoid uninitialized timestamp use in wait_vblank
drm/i915/gen9: Fix PCODE polling during SAGV disabling
i2c: mux: pca954x: fix i2c mux selection caching
NFSv4.1: nfs4_fl_prepare_ds must be careful about reporting success.
NFS: Fix a performance regression in readdir
pNFS: Fix race in pnfs_wait_on_layoutreturn
NFS: fix typo in parameter description
pinctrl: meson: fix gpio request disabling other modes
btrfs: fix error handling when run_delayed_extent_op fails
btrfs: fix locking when we put back a delayed ref that's too new
nvme: apply DELAY_BEFORE_CHK_RDY quirk at probe time too
x86/cpu: Fix bootup crashes by sanitizing the argument of the 'clearcpuid=' command-line option
i2c: piix4: Avoid race conditions with IMC
net/mlx5: Only cancel recovery work when cleaning up device
USB: serial: ch341: fix modem-control and B0 handling
drm/amdgpu: drop verde dpm quirks
drm/amdgpu: update si kicker smc firmware
drm/radeon: drop verde dpm quirks
drm/radeon: update smc firmware selection for SI
drm: Clean up planes in atomic commit helper failure path
drm/i915/gen9: Fix PCODE polling timeout in stable backport
net/af_iucv: don't use paged skbs for TX on HiperSockets
sysctl: Drop reference added by grab_header in proc_sys_readdir
Clearing FIFOs in RS485 emulation mode causes subsequent transmits to break
extcon: return error code on failure
sysrq: attach sysrq handler correctly for 32-bit kernel
orinoco: Use shash instead of ahash for MIC calculations
ibmvscsis: Fix srp_transfer_data fail return code
tty/serial: atmel_serial: BUG: stop DMA from transmitting in stop_tx
tty/serial: atmel: RS485 half duplex w/DMA: enable RX after TX is done
virtio_blk: avoid DMA to stack for the sense buffer
dmaengine: omap-dma: Fix dynamic lch_map allocation
drivers: char: mem: Fix thinkos in kmem address checks
mnt: Protect the mountpoint hashtable with mount_lock
pid: fix lockdep deadlock warning due to ucount_lock
vme: Fix wrong pointer utilization in ca91cx42_slave_get
Revert "tty: serial: 8250: add CON_CONSDEV to flags"
ASoC: hdmi-codec: use unsigned type to structure members with bit-field
btrfs: fix crash when tracepoint arguments are freed by wq callbacks
xhci: fix deadlock at host remove by running watchdog correctly
fix a fencepost error in pipe_advance()
i2c: fix kernel memory disclosure in dev interface
i2c: print correct device invalid address
Input: elants_i2c - avoid divide by 0 errors on bad touchscreen data
USB: serial: ch341: fix open and resume after B0
USB: serial: ch341: fix control-message error handling
USB: serial: ch341: fix open error handling
USB: serial: ch341: fix resume after reset
USB: serial: ch341: fix initial modem-control state
USB: serial: kl5kusb105: fix line-state error handling
usb: musb: fix runtime PM in debugfs
wusbcore: Fix one more crypto-on-the-stack bug
x86/CPU/AMD: Fix Bulldozer topology
x86/bugs: Separate AMD E400 erratum and C1E bug
x86/cpu/AMD: Clean up cpu_llc_id assignment per topology feature
bridge: netfilter: Fix dropping packets that moving through bridge interface
xfs: Timely free truncated dirty pages
gpio: Move freeing of GPIO hogs before numbing of the device
nl80211: fix sched scan netlink socket owner destruction
x86/efi: Don't allocate memmap through memblock after mm_init()
efi/x86: Prune invalid memory map entries and fix boot regression
efi/libstub/arm*: Pass latest memory map to the kernel
KVM: x86: Introduce segmented_write_std
KVM: x86: emulate FXSAVE and FXRSTOR
KVM: x86: add asm_safe wrapper
KVM: x86: add Align16 instruction flag
KVM: x86: fix NULL deref in vcpu_scan_ioapic
KVM: x86: flush pending lapic jump label updates on module unload
jump_labels: API for flushing deferred jump label updates
KVM: eventfd: fix NULL deref irqbypass consumer
KVM: x86: fix emulation of "MOV SS, null selector"
mm/hugetlb.c: fix reservation race when freeing surplus pages
mm/slab.c: fix SLAB freelist randomization duplicate entries
mm: support anonymous stable page
mm, memcg: fix the active list aging for lowmem requests when memcg is enabled
ocfs2: fix crash caused by stale lvb with fsdlm plugin
mm: fix devm_memremap_pages crash, use mem_hotplug_{begin, done}
mm: pmd dirty emulation in page fault handler
dax: fix deadlock with DAX 4k holes
zram: support BDI_CAP_STABLE_WRITES
zram: revalidate disk under init_lock
selftests: do not require bash for the generated test
selftests: do not require bash to run netsocktests testcase
drm/savage: dereferencing an error pointer
drm/vc4: Fix a couple error codes in vc4_cl_lookup_bos()
drm/tegra: dpaux: Fix error handling
regulator: axp20x: Fix axp809 ldo_io registration error on cold boot
regulator: tps65086: Fix 25mV ranges for BUCK regulators
pinctrl: sh-pfc: Add helper to handle bias lookup table
pinctrl: sh-pfc: r8a7795: Use lookup function for bias data
pinctrl: imx: fix imx_pinctrl_desc initialization
Input: i8042 - add Pegatron touchpad to noloop table
Input: xpad - use correct product id for x360w controllers
Linux 4.9.4
rtlwifi: rtl_usb: Fix missing entry in USB driver's private data
rtlwifi: Fix enter/exit power_save
drm/i915/gen9: Fix PCODE polling during CDCLK change notification
ALSA: usb-audio: Add a quirk for Plantronics BT600
spi: mvebu: fix baudrate calculation for armada variant
ARM: omap2+: am437x: rollback to use omap3_gptimer_timer_init()
ARM: 8631/1: clkdev: Detect errors in clk_hw_register_clkdev() for mass registration
ARM: OMAP4+: Fix bad fallthrough for cpuidle
ARM: OMAP5: Fix build for PM code
ARM: OMAP5: Fix mpuss_early_init
bus: arm-ccn: Prevent hotplug callback leak
svcrdma: Clear xpt_bc_xps in xprt_setup_rdma_bc() error exit arm
ARM: qcom_defconfig: Fix MDM9515 LCC and GCC config
ARM: zynq: Reserve correct amount of non-DMA RAM
ARM: pxa: fix pxa25x interrupt init
ARM64: dts: bcm2835: Fix bcm2837 compatible string
ARM64: dts: bcm2837-rpi-3-b: remove incorrect pwr LED
arm64: dts: mt8173: Fix auxadc node
tools/virtio: fix READ_ONCE()
powerpc: Fix build warning on 32-bit PPC
ALSA: firewire-tascam: Fix to handle error from initialization of stream data
HID: hid-cypress: validate length of report
net: vrf: do not allow table id 0
net: ipv4: Fix multipath selection with vrf
net/mlx5e: Remove WARN_ONCE from adaptive moderation code
gro: Disable frag0 optimization on IPv6 ext headers
gro: use min_t() in skb_gro_reset_offset()
gro: Enter slow-path if there is no tailroom
net: add the AF_QIPCRTR entries to family name tables
net: dsa: Ensure validity of dst->ds[0]
r8152: fix rx issue for runtime suspend
r8152: split rtl8152_suspend function
net: dsa: bcm_sf2: Utilize nested MDIO read/write
net: dsa: bcm_sf2: Do not clobber b53_switch_ops
bpf: change back to orig prog on too many passes
net: vrf: Add missing Rx counters
ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules
igmp: Make igmp group member RFC 3376 compliant
flow_dissector: Update pptp handling to avoid null pointer deref.
drop_monitor: consider inserted data in genlmsg_end
drop_monitor: add missing call to genlmsg_end
net: ipv4: dst for local input routes should use l3mdev if relevant
net: fix incorrect original ingress device index in PKTINFO
rtnl: stats - add missing netlink message size checks
net/mlx5e: Disable netdev after close
net/mlx5e: Don't sync netdev state when not registered
net/mlx5: Prevent setting multicast macs for VFs
net/mlx5: Mask destination mac value in ethtool steering rules
net/mlx5: Avoid shadowing numa_node
net/mlx5: Cancel recovery work in remove flow
net/mlx5: Check FW limitations on log_max_qp before setting it
net/sched: cls_flower: Fix missing addr_type in classify
net: stmmac: Fix race between stmmac_drv_probe and stmmac_open
net, sched: fix soft lockup in tc_classify
ipv6: handle -EFAULT from skb_copy_bits
inet: fix IP(V6)_RECVORIGDSTADDR for udp sockets
sctp: sctp_transport_lookup_process should rcu_read_unlock when transport is null
net: vrf: Drop conntrack data after pass through VRF device on Tx
net: vrf: Fix NAT within a VRF
Linux 4.9.3
usb: gadget: composite: always set ep->mult to a sensible value
Revert "usb: gadget: composite: always set ep->mult to a sensible value"
Revert "rtlwifi: Fix enter/exit power_save"
tick/broadcast: Prevent NULL pointer dereference
clocksource/dummy_timer: Move hotplug callback after the real timers
xfs: fix max_retries _show and _store functions
xfs: fix crash and data corruption due to removal of busy COW extents
xfs: use the actual AG length when reserving blocks
xfs: fix double-cleanup when CUI recovery fails
xfs: use GPF_NOFS when allocating btree cursors
xfs: ignore leaf attr ichdr.count in verifier during log replay
xfs: don't cap maximum dedupe request length
xfs: don't allow di_size with high bit set
xfs: error out if trying to add attrs and anextents > 0
xfs: don't crash if reading a directory results in an unexpected hole
xfs: complain if we don't get nextents bmap records
xfs: check for bogus values in btree block headers
xfs: forbid AG btrees with level == 0
xfs: handle cow fork in xfs_bmap_trace_exlist
xfs: pass state not whichfork to trace_xfs_extlist
xfs: Move AGI buffer type setting to xfs_read_agi
xfs: pass post-eof speculative prealloc blocks to bmapi
xfs: use new extent lookup helpers xfs_file_iomap_begin_delay
xfs: clean up cow fork reservation and tag inodes correctly
xfs: use new extent lookup helpers in __xfs_reflink_reserve_cow
xfs: track preallocation separately in xfs_bmapi_reserve_delalloc()
xfs: remove prev argument to xfs_bmapi_reserve_delalloc
xfs: always succeed when deduping zero bytes
xfs: factor rmap btree size into the indlen calculations
xfs: new inode extent list lookup helpers
xfs: fix unbalanced inode reclaim flush locking
xfs: check minimum block size for CRC filesystems
xfs: provide helper for counting extents from if_bytes
xfs: don't BUG() on mixed direct and mapped I/O
xfs: don't skip cow forks w/ delalloc blocks in cowblocks scan
xfs: check return value of _trans_reserve_quota_nblks
xfs: don't call xfs_sb_quota_from_disk twice
tpm_tis: Check return values from get_burstcount.
drm/i915/gen9: fix the WM memory bandwidth WA for Y tiling cases
drm/i915/gen9: unconditionally apply the memory bandwidth WA
drm/i915: disable PSR by default on HSW/BDW
drm/radeon: Always store CRTC relative radeon_crtc->cursor_x/y values
s390/pci: fix dma address calculation in map_sg
s390/topology: always use s390 specific sched_domain_topology_level
powerpc/pci/rpadlpar: Fix device reference leaks
PCI: Enable access to non-standard VPD for Chelsio devices (cxgb3)
PCI: Support INTx masking on ConnectX-4 with firmware x.14.1100+
PCI: Convert Mellanox broken INTx quirks to be for listed devices only
PCI: Convert broken INTx masking quirks from HEADER to FINAL
PCI: Add Mellanox device IDs
PCI: rockchip: Correct the use of FTS mask
PCI: rockchip: Fix negotiated lanes calculation
staging: media: davinci_vpfe: unlock on error in vpfe_reqbufs()
f2fs: hide a maybe-uninitialized warning
f2fs: remove percpu_count due to performance regression
md: fix refcount problem on mddev when stopping array.
md: MD_RECOVERY_NEEDED is set for mddev->recovery
crypto: arm64/aes-ce - fix for big endian
crypto: arm64/aes-xts-ce: fix for big endian
crypto: arm64/sha1-ce - fix for big endian
crypto: arm64/aes-neon - fix for big endian
crypto: arm64/aes-ccm-ce: fix for big endian
crypto: arm/aes-ce - fix for big endian
crypto: arm64/ghash-ce - fix for big endian
crypto: arm64/sha2-ce - fix for big endian
s390/crypto: unlock on error in prng_tdes_read()
mm, compaction: fix NR_ISOLATED_* stats for pfn based migration
mm: khugepaged: fix radix tree node leak in shmem collapse error path
mm: khugepaged: close use-after-free race during shmem collapsing
docs-rst: fix LaTeX \DURole renewcommand with Sphinx 1.3+
mm/hugetlb.c: use the right pte val for compare in hugetlb_cow
rpmsg: qcom_smd: Correct return value for O_NONBLOCK
mmc: mmc_test: Uninitialized return value
genirq/affinity: Fix node generation from cpumask
PM / wakeirq: Fix dedicated wakeirq for drivers not using autosuspend
irqchip/bcm7038-l1: Implement irq_cpu_offline() callback
PCI/MSI: Check for NULL affinity mask in pci_irq_get_affinity()
ima: fix memory leak in ima_release_policy
relay: check array offset before using it
sbp-target: Fix second argument of percpu_ida_alloc()
target/iscsi: Fix double free in lio_target_tiqn_addtpg()
scsi: mvsas: fix command_active typo
scsi: g_NCR5380: Fix release_region in error handling
ASoC: samsung: i2s: Fixup last IRQ unsafe spin lock call
ASoC: Intel: Skylake: Fix a shift wrapping bug
ASoC: cht_bsw_rt5645: Fix leftover kmalloc
ASoC: lpass-platform: initialize dma channel number
iommu/vt-d: Flush old iommu caches for kdump when the device gets context mapped
iommu/vt-d: Fix pasid table size encoding
iommu/amd: Fix the left value check of cmd buffer
iommu/amd: Missing error code in amd_iommu_init_device()
clk: renesas: mstp: Support 8-bit registers for r7s72100
clk: imx31: fix rewritten input argument of mx31_clocks_init()
clk: sunxi-ng: sun8i-h3: Set CLK_SET_RATE_PARENT for audio module clocks
clk: sunxi-ng: sun8i-a23: Set CLK_SET_RATE_PARENT for audio module clocks
clk: ti: dra7: fix "failed to lookup clock node gmac_gmii_ref_clk_div" boot message
clk: clk-wm831x: fix a logic error
clk: qcom: ipq806x: Fix board clk rates
Input: synaptics-rmi4 - unlock on error
hwmon: (lm90) fix temp1_max_alarm attribute
hwmon: (g762) Fix overflows and crash seen when writing limit attributes
hwmon: (nct7802) Fix overflows seen when writing into limit attributes
hwmon: (ds620) Fix overflows seen when writing temperature limits
hwmon: (amc6821) sign extension temperature
hwmon: (scpi) Fix module autoload
platform/x86: fujitsu-laptop: use brightness_set_blocking for LED-setting callbacks
x86/cpu: Probe CPUID leaf 6 even when cpuid_level == 6
x86/prctl/uapi: Remove #ifdef for CHECKPOINT_RESTORE
debugfs: improve DEFINE_DEBUGFS_ATTRIBUTE for !CONFIG_DEBUG_FS
clk: renesas: cpg-mssr: Fix inverted debug check
efi/efivar_ssdt_load: Don't return success on allocation failure
cris: Only build flash rescue image if CONFIG_ETRAX_AXISFLASHMAP is selected
ath10k: use the right length of "background"
mfd: tps65217: Fix page fault on unloading modules
ath10k: fix failure to send NULL func frame for 10.4
nl80211: Use different attrs for BSSID and random MAC addr in scan req
mac80211: fix tid_agg_rx NULL dereference
drm/i915: tune down the fast link training vs boot fail
drm/i915/dp: add lane_count check in intel_dp_check_link_status
usb: dwc3: gadget: always unmap EP0 requests
usb: dwc3: ep0: explicitly call dwc3_ep0_prepare_one_trb()
usb: dwc3: ep0: add dwc3_ep0_prepare_one_trb()
iio: accel: st_accel: fix LIS3LV02 reading and scaling
staging: iio: ad7606: fix improper setting of oversampling pins
mei: move write cb to completion on credentials failures
mei: bus: fix mei_cldev_enable KDoc
mei: fix parameter rename KDoc
USB: serial: io_ti: bind to interface after fw download
dibusb: fix possible memory leak in dibusb_rc_query()
ARM: dts: sun7i: bananapi-m1-plus: Enable USB PHY for USB host support
arm64: dts: hip06: Correct hardware pin number of usb node
USB: phy: am335x-control: fix device and of_node leaks
ARM: dts: r8a7794: Correct hsusb parent clock
usb: gadget: fix request length error for isoc transfer
usb: gadget: Fix second argument of percpu_ida_alloc()
USB: serial: kl5kusb105: abort on open exception path
ALSA: usb-audio: Fix bogus error return in snd_usb_create_stream()
usb: musb: blackfin: add bfin_fifo_offset in bfin_ops
usb: gadget: udc: core: fix return code of usb_gadget_probe_driver()
usb: hub: Move hub_port_disable() to fix warning if PM is disabled
usb: musb: Fix trying to free already-free IRQ 4
usb: dwc3: gadget: Fix full speed mode
usb: dwc3: pci: Fix dr_mode misspelling
usb: dwc3: pci: add Intel Gemini Lake PCI ID
xhci: Fix race related to abort operation
xhci: Use delayed_work instead of timer for command timeout
usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL
USB: serial: mos7720: fix parallel probe
USB: serial: mos7720: fix parport use-after-free on probe errors
USB: serial: mos7720: fix use-after-free on probe errors
USB: serial: mos7720: fix NULL-deref at open
USB: serial: mos7840: fix NULL-deref at open
USB: serial: kobil_sct: fix NULL-deref in write
USB: serial: cyberjack: fix NULL-deref at open
USB: serial: oti6858: fix NULL-deref at open
USB: serial: io_edgeport: fix NULL-deref at open
USB: serial: ti_usb_3410_5052: fix NULL-deref at open
USB: serial: garmin_gps: fix memory leak on failed URB submit
USB: serial: iuu_phoenix: fix NULL-deref at open
USB: serial: io_ti: fix I/O after disconnect
USB: serial: io_ti: fix another NULL-deref at open
USB: serial: io_ti: fix NULL-deref at open
USB: serial: spcp8x5: fix NULL-deref at open
USB: serial: keyspan_pda: verify endpoints at probe
USB: serial: pl2303: fix NULL-deref at open
USB: serial: quatech2: fix sleep-while-atomic in close
USB: serial: omninet: fix NULL-derefs at open and disconnect
usb: return error code when platform_get_irq fails
usb: xhci: hold lock over xhci_abort_cmd_ring()
xhci: Handle command completion and timeout race
usb: host: xhci: Fix possible wild pointer when handling abort command
usb: xhci: fix return value of xhci_setup_device()
xhci: free xhci virtual devices with leaf nodes first
usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Apollo Lake
usb: xhci: fix possible wild pointer
usb: dwc3: core: avoid Overflow events
usb: gadget: composite: Test get_alt() presence instead of set_alt()
USB: dummy-hcd: fix bug in stop_activity (handle ep0)
USB: fix problems with duplicate endpoint addresses
USB: gadgetfs: fix checks of wTotalLength in config descriptors
USB: gadgetfs: fix use-after-free bug
USB: gadgetfs: fix unbounded memory allocation bug
usb: gadgetfs: restrict upper bound on device configuration size
usb: storage: unusual_uas: Add JMicron JMS56x to unusual device
usb: musb: dsps: implement clear_ep_rxintr() callback
usb: musb: core: add clear_ep_rxintr() to musb_platform_ops
KVM: MIPS: Flush KVM entry code from icache globally
KVM: MIPS: Don't clobber CP0_Status.UX
KVM: x86: reset MMU on KVM_SET_VCPU_EVENTS
drm/i915: Initialize overlay->last_flip properly
drm/i915: Force VDD off on the new power seqeuencer before starting to use it
drm/i915: Fix oops in overlay due to frontbuffer tracking
drm/i915: Fix oopses in the overlay code due to i915_gem_active stuff
gcc-plugins: update gcc-common.h for gcc-7
asm-prototypes: Clear any CPP defines before declaring the functions
mac80211: initialize fast-xmit 'info' later
pinctrl/amd: Set the level based on ACPI tables
ARM: davinci: da850: don't add emac clock to lookup table twice
HID: sensor-hub: Move the memset to sensor_hub_get_feature()
parisc: Mark cr16 clocksource unstable on SMP systems
parisc: Add line-break when printing segfault info
fscrypt: fix renaming and linking special files
ALSA: usb-audio: Fix irq/process data synchronization
ALSA: hda - Apply asus-mode8 fixup to ASUS X71SL
ALSA: hda - Fix up GPIO for ASUS ROG Ranger
staging: octeon: Call SET_NETDEV_DEV()
iio: bmi160: Fix time needed to sleep after command execution
iio: max44000: correct value in illuminance_integration_time_available
iio: common: st_sensors: fix channel data parsing
Linux 4.9.2
drm/i915: Fix setting of boost freq tunable
drm/i915: skip the first 4k of stolen memory on everything >= gen8
drm/i915: Initialize dev_priv->atomic_cdclk_freq at init time
drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things
drm/i915/dsi: Do not clear DPOUNIT_CLOCK_GATE_DISABLE from vlv_init_display_clock_gating
drm/i915/dsi: Fix chv_exec_gpio disabling the GPIOs it is setting
net: mvpp2: fix dma unmapping of TX buffers for fragments
sg_write()/bsg_write() is not fit to be called under KERNEL_DS
kconfig/nconf: Fix hang when editing symbol with a long prompt
target/user: Fix use-after-free of tcmu_cmds if they are expired
libnvdimm, pfn: fix align attribute
of, numa: Return NUMA_NO_NODE from disable of_node_to_nid() if nid not possible.
powerpc/boot: Request no dynamic linker for boot wrapper
powerpc/ps3: Fix system hang with GCC 5 builds
powerpc/64e: Convert cmpi to cmpwi in head_64.S
SUNRPC: fix refcounting problems with auth_gss messages.
pNFS: Fix a deadlock between read resends and layoutreturn
pNFS: Clear NFS_LAYOUT_RETURN_REQUESTED when invalidating the layout stateid
pNFS: Don't clear the layout stateid if a layout return is outstanding
pNFS: On error, do not send LAYOUTGET until the LAYOUTRETURN has completed
nfs_write_end(): fix handling of short copies
libceph: verify authorize reply on connect
PCI: Check for PME in targeted sleep state
i40iw: Use correct src address in memcpy to rdma stats counters
bad_inode: add missing i_op initializers
Input: drv260x - fix input device's parent assignment
v4l: tvp5150: Add missing break in set control handler
media: solo6x10: fix lockup by avoiding delayed register write
s5p-mfc: fix failure path of s5p_mfc_alloc_memdev()
mn88473: fix chip id check on probe
mn88472: fix chip id check on probe
IB/cma: Fix a race condition in iboe_addr_get_sgid()
IB/rxe: Fix a memory leak in rxe_qp_cleanup()
IB/multicast: Check ib_find_pkey() return value
IPoIB: Avoid reading an uninitialized member variable
IB/mad: Fix an array index check
fgraph: Handle a case where a tracer ignores set_graph_notrace
x86/smpboot: Make logical package management more robust
platform/x86: asus-nb-wmi.c: Add X45U quirk
ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it
vsock/virtio: fix src/dst cid format
fsnotify: Fix possible use-after-free in inode iteration on umount
kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
KVM: PPC: Book3S HV: Don't lose hardware R/C bit updates in H_PROTECT
KVM: PPC: Book3S HV: Save/restore XER in checkpointed register state
scsi: aacraid: remove wildcard for series 9 controllers
md/raid5: limit request size according to implementation limits
sc16is7xx: Drop bogus use of IRQF_ONESHOT
latent_entropy: fix ARM build error on earlier gcc
arm64: KVM: pmu: Reset PMSELR_EL0.SEL to a sane value before entering the guest
s390/kexec: use node 0 when re-adding crash kernel memory
s390/vmlogrdr: fix IUCV buffer allocation
firmware: fix usermode helper fallback loading
ARC: mm: arc700: Don't assume 2 colours for aliasing VIPT dcache
scsi: avoid a permanent stop of the scsi device's request queue
scsi: zfcp: fix rport unblock race with LUN recovery
scsi: zfcp: do not trace pure benign residual HBA responses at default level
scsi: zfcp: fix use-after-"free" in FC ingress path after TMF
iscsi-target: Return error if unable to add network portal
scsi: megaraid_sas: Do not set MPI2_TYPE_CUDA for JBOD FP path for FW which does not support JBOD sequence map
scsi: megaraid_sas: For SRIOV enabled firmware, ensure VF driver waits for 30secs before reset
stm class: Fix device leak in open error path
vt: fix Scroll Lock LED trigger name
block: protect iterate_bdevs() against concurrent close
mei: me: add lewisburg device ids
mei: request async autosuspend at the end of enumeration
drivers/gpu/drm/ast: Fix infinite loop if read fails
drm/amdgpu: fix init save/restore list in gfx_v8.0
drm/amdgpu: fix enable_cp_power_gating in gfx_v8.0.
drm/amd/powerplay: bypass fan table setup if no fan connected
drm/gma500: Add compat ioctl
drm/radeon/si: load the proper firmware on 0x87 oland boards
drm/radeon: add additional pci revision to dpm workaround
drm/radeon: Hide the HW cursor while it's out of bounds
drm/radeon: Also call cursor_move_locked when the cursor size changes
drm/nouveau/fifo/gf100-: protect channel preempt with subdev mutex
drm/nouveau/i2c/gk110b,gm10x: use the correct implementation
drm/nouveau/ttm: wait for bo fence to signal before unmapping vmas
drm/nouveau/ltc: protect clearing of comptags with mutex
drm/nouveau/bios: require checksum to match for fast acpi shadow method
drm/nouveau/kms: lvds panel strap moved again on maxwell
drm/nouveau/gr: fallback to legacy paths during firmware lookup
drm/amd/amdgpu: enable GUI idle INT after enabling CGCG
drm/amdgpu: Also call cursor_move_locked when the cursor size changes
drm/amdgpu: Store CRTC relative amdgpu_crtc->cursor_x/y values
drm/amdgpu: add additional pci revision to dpm workaround
drm/amdgpu/si: load the proper firmware on 0x87 oland boards
ACPI / video: Add force_native quirk for HP Pavilion dv6
ACPI / video: Add force_native quirk for Dell XPS 17 L702X
staging: comedi: ni_mio_common: fix E series ni_ai_insn_read() data
staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask
staging: lustre: ldlm: pl_recalc time handling is wrong
staging/lustre/osc: Revert erroneous list_for_each_entry_safe use
hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels()
docs: sphinx-extensions: make rstFlatTable work with docutils 0.13
thermal: hwmon: Properly report critical temperature in sysfs
clk: bcm2835: Avoid overwriting the div info when disabling a pll_div clk
arm64: tegra: Add VDD_GPU regulator to Jetson TX1
gpio: chardev: Return error for seek operations
gpio: stmpe: fix interrupt handling bug
timekeeping_Force_unsigned_clocksource_to_nanoseconds_conversion
mmc: sd: Meet alignment requirements for raw_ssr DMA
regulator: stw481x-vmmc: fix ages old enable error
mmc: sdhci: Fix recovery from tuning timeout
Revert "mmc: sdhci: Reset cmd and data circuits after tuning failure"
ath9k: do not return early to fix rcu unlocking
ath9k: Really fix LED polarity for some Mini PCI AR9220 MB92 cards.
ath9k: fix ath9k_hw_gpio_get() to return 0 or 1 on success
cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts
rtl8xxxu: Work around issue with 8192eu and 8723bu devices not reconnecting
perf/x86/intel/cstate: Prevent hotplug callback leak
perf annotate: Don't throw error for zero length symbols
perf/x86: Fix exclusion of BTS and LBR for Goldmont
rtlwifi: Fix enter/exit power_save
ath10k: fix soft lockup during firmware crash/hw-restart
ssb: Fix error routine when fallback SPROM fails
Linux 4.9.1
x86/kbuild: enable modversions for symbols exported from asm
builddeb: fix cross-building to arm64 producing host-arch debs
xfs: set AGI buffer type in xlog_recover_clear_agi_bucket
xfs: fix up xfs_swap_extent_forks inline extent handling
arm/xen: Use alloc_percpu rather than __alloc_percpu
xen/gntdev: Use VM_MIXEDMAP instead of VM_IO to avoid NUMA balancing
tpm xen: Remove bogus tpm_chip_unregister
kernel/debug/debug_core.c: more properly delay for secondary CPUs
watchdog: qcom: fix kernel panic due to external abort on non-linefetch
watchdog: mei_wdt: request stop on reboot to prevent false positive event
kernel/watchdog: use nmi registers snapshot in hardlockup handler
CIFS: Fix a possible memory corruption in push locks
CIFS: Decrease verbosity of ioctl call
CIFS: Fix a possible double locking of mutex during reconnect
CIFS: Fix missing nls unload in smb2_reconnect()
CIFS: Fix a possible memory corruption during reconnect
cifs: Fix smbencrypt() to stop pointing a scatterlist at the stack
ASoC: intel: Fix crash at suspend/resume without card registration
dm space map metadata: fix 'struct sm_metadata' leak on failed create
dm raid: fix discard support regression
dm rq: fix a race condition in rq_completed()
dm crypt: mark key as invalid until properly loaded
dm flakey: return -EINVAL on interval bounds error in flakey_ctr()
dm table: an 'all_blk_mq' table must be loaded for a blk-mq DM device
dm table: fix 'all_blk_mq' inconsistency when an empty table is loaded
blk-mq: Do not invoke .queue_rq() for a stopped queue
PM / OPP: Don't use OPP structure outside of rcu protected section
PM / OPP: Pass opp_table to dev_pm_opp_put_regulator()
usb: gadget: composite: always set ep->mult to a sensible value
mm, page_alloc: keep pcp count and list contents in sync if struct page is corrupted
mm/vmscan.c: set correct defer count for shrinker
nvmet: Fix possible infinite loop triggered on hot namespace removal
loop: return proper error from loop_queue_rq()
f2fs: fix to determine start_cp_addr by sbi->cur_cp_pack
f2fs: fix overflow due to condition check order
f2fs: set ->owner for debugfs status file's file_operations
Revert "f2fs: use percpu_counter for # of dirty pages in inode"
ext4: do not perform data journaling when data is encrypted
ext4: return -ENOMEM instead of success
ext4: reject inodes with negative size
ext4: add sanity checking to count_overhead()
ext4: fix in-superblock mount options processing
ext4: use more strict checks for inodes_per_block on mount
ext4: fix stack memory corruption with 64k block size
ext4: fix mballoc breakage with 64k block size
ext4: don't lock buffer in ext4_commit_super if holding spinlock
crypto: caam - fix AEAD givenc descriptors
ptrace: Don't allow accessing an undumpable mm
ptrace: Capture the ptracer's creds not PT_PTRACE_CAP
vfs,mm: fix return value of read() at s_maxbytes
mm: Add a user_ns owner to mm_struct and fix ptrace permission checks
block_dev: don't test bdev->bd_contains when it is not stable
splice: reinstate SIGPIPE/EPIPE handling
fs: exec: apply CLOEXEC before changing dumpable task flags
exec: Ensure mm->user_ns contains the execed files
clk: ti: omap36xx: Work around sprz319 advisory 2.1
ALSA: hda: when comparing pin configurations, ignore assoc in addition to seq
ALSA: hda - Gate the mic jack on HP Z1 Gen3 AiO
ALSA: hda - fix headset-mic problem on a Dell laptop
ALSA: hda - ignore the assoc and seq when comparing pin configurations
ALSA: hda/ca0132 - Add quirk for Alienware 15 R2 2016
ALSA: hiface: Fix M2Tech hiFace driver sampling rate change
ALSA: usb-audio: Add QuickCam Communicate Deluxe/S7500 to volume_control_quirks
usbip: vudc: fix: Clear already_seen flag also for ep0
USB: UHCI: report non-PME wakeup signalling for Intel hardware
usb: gadget: composite: correctly initialize ep->maxpacket
usb: gadget: f_uac2: fix error handling at afunc_bind
usb: core: usbport: Use proper LED API to fix potential crash
usb: hub: Fix auto-remount of safely removed or ejected USB-3 devices
usb: dwc3: gadget: set PCM1 field of isochronous-first TRBs
USB: cdc-acm: add device id for GW Instek AFG-125
USB: serial: kl5kusb105: fix open error path
USB: serial: option: add dlink dwm-158
USB: serial: option: add support for Telit LE922A PIDs 0x1040, 0x1041
Btrfs: fix qgroup rescan worker initialization
Btrfs: fix emptiness check for dirtied extent buffers at check_leaf()
btrfs: store and load values of stripes_min/stripes_max in balance status item
Btrfs: fix relocation incorrectly dropping data references
Btrfs: fix tree search logic when replaying directory entry deletes
Btrfs: fix deadlock caused by fsync when logging directory entries
Btrfs: fix BUG_ON in btrfs_mark_buffer_dirty
btrfs: limit async_work allocation and worker func duration
hotplug: Make register and unregister notifier API symmetric
ANDROID: Shrink ashmem directly through shmem_fallocate
ANDROID: ashmem: Add shmem_set_file to mm/shmem.c
ANDROID: Add android config documentation to boot framework.
Conflicts:
Documentation/android.txt
Documentation/cpu-freq/governors.txt
Documentation/networking/ip-sysctl.txt
arch/arm64/boot/Makefile
arch/arm64/kernel/process.c
arch/arm64/kernel/topology.c
arch/arm64/mm/dma-mapping.c
drivers/cpufreq/cpufreq_interactive.c
drivers/input/misc/gpio_matrix.c
drivers/md/Kconfig
drivers/md/dm-android-verity.c
drivers/md/dm-android-verity.h
drivers/md/dm-linear.c
drivers/md/dm-verity-fec.h
drivers/mmc/core/host.c
drivers/platform/goldfish/goldfish_pipe.c
drivers/power/supply/power_supply_sysfs.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h
drivers/staging/android/fiq_debugger/fiq_debugger.c
drivers/staging/android/lowmemorykiller.c
drivers/usb/dwc3/core.h
drivers/usb/gadget/Kconfig
drivers/usb/gadget/configfs.c
drivers/usb/gadget/function/Makefile
drivers/usb/gadget/function/f_accessory.c
drivers/usb/gadget/function/f_audio_source.c
drivers/usb/gadget/function/f_fs.c
drivers/usb/gadget/function/f_mtp.c
drivers/usb/phy/Kconfig
drivers/usb/phy/otg-wakelock.c
fs/ext4/inode.c
fs/ext4/ioctl.c
fs/f2fs/data.c
fs/proc/task_mmu.c
fs/sdcardfs/derived_perm.c
fs/sdcardfs/file.c
fs/sdcardfs/inode.c
fs/sdcardfs/lookup.c
fs/sdcardfs/main.c
fs/sdcardfs/packagelist.c
fs/sdcardfs/sdcardfs.h
fs/sdcardfs/super.c
include/linux/mmc/core.h
include/linux/power_supply.h
include/linux/sched.h
include/linux/usb/f_mtp.h
include/net/fib_rules.h
include/net/route.h
include/trace/events/cpufreq_interactive.h
include/trace/events/power.h
include/trace/events/sched.h
include/uapi/linux/magic.h
include/uapi/linux/prctl.h
init/Kconfig
kernel/cgroup.c
kernel/configs/android-base.config
kernel/power/process.c
kernel/sched/Makefile
kernel/sched/core.c
kernel/sched/cputime.c
kernel/sched/fair.c
kernel/sched/rt.c
kernel/sched/sched.h
kernel/sched/stop_task.c
kernel/sched/tune.c
lib/Kconfig.debug
net/core/fib_rules.c
net/ipv4/inet_connection_sock.c
net/ipv4/ping.c
net/ipv4/raw.c
net/ipv4/route.c
net/ipv4/syncookies.c
net/ipv4/udp.c
net/ipv6/af_inet6.c
net/ipv6/ah6.c
net/ipv6/datagram.c
net/ipv6/esp6.c
net/ipv6/icmp.c
net/ipv6/inet6_connection_sock.c
net/ipv6/ip6_vti.c
net/ipv6/ipcomp6.c
net/ipv6/ping.c
net/ipv6/raw.c
net/ipv6/route.c
net/ipv6/syncookies.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
Change-Id: I82455dc7b564fc5d3ad2b784a0eb8f96c6b05d4c
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
3895 lines
110 KiB
C
3895 lines
110 KiB
C
#ifndef _LINUX_SCHED_H
|
|
#define _LINUX_SCHED_H
|
|
|
|
#include <uapi/linux/sched.h>
|
|
|
|
#include <linux/sched/prio.h>
|
|
|
|
|
|
struct sched_param {
|
|
int sched_priority;
|
|
};
|
|
|
|
#include <asm/param.h> /* for HZ */
|
|
|
|
#include <linux/capability.h>
|
|
#include <linux/threads.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/types.h>
|
|
#include <linux/timex.h>
|
|
#include <linux/jiffies.h>
|
|
#include <linux/plist.h>
|
|
#include <linux/rbtree.h>
|
|
#include <linux/thread_info.h>
|
|
#include <linux/cpumask.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/nodemask.h>
|
|
#include <linux/mm_types.h>
|
|
#include <linux/preempt.h>
|
|
|
|
#include <asm/page.h>
|
|
#include <asm/ptrace.h>
|
|
#include <linux/cputime.h>
|
|
|
|
#include <linux/smp.h>
|
|
#include <linux/sem.h>
|
|
#include <linux/shm.h>
|
|
#include <linux/signal.h>
|
|
#include <linux/compiler.h>
|
|
#include <linux/completion.h>
|
|
#include <linux/pid.h>
|
|
#include <linux/percpu.h>
|
|
#include <linux/topology.h>
|
|
#include <linux/seccomp.h>
|
|
#include <linux/rcupdate.h>
|
|
#include <linux/rculist.h>
|
|
#include <linux/rtmutex.h>
|
|
|
|
#include <linux/time.h>
|
|
#include <linux/param.h>
|
|
#include <linux/resource.h>
|
|
#include <linux/timer.h>
|
|
#include <linux/hrtimer.h>
|
|
#include <linux/kcov.h>
|
|
#include <linux/task_io_accounting.h>
|
|
#include <linux/latencytop.h>
|
|
#include <linux/cred.h>
|
|
#include <linux/llist.h>
|
|
#include <linux/uidgid.h>
|
|
#include <linux/gfp.h>
|
|
#include <linux/magic.h>
|
|
#include <linux/cgroup-defs.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
#define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */
|
|
|
|
/*
|
|
* Extended scheduling parameters data structure.
|
|
*
|
|
* This is needed because the original struct sched_param can not be
|
|
* altered without introducing ABI issues with legacy applications
|
|
* (e.g., in sched_getparam()).
|
|
*
|
|
* However, the possibility of specifying more than just a priority for
|
|
* the tasks may be useful for a wide variety of application fields, e.g.,
|
|
* multimedia, streaming, automation and control, and many others.
|
|
*
|
|
* This variant (sched_attr) is meant at describing a so-called
|
|
* sporadic time-constrained task. In such model a task is specified by:
|
|
* - the activation period or minimum instance inter-arrival time;
|
|
* - the maximum (or average, depending on the actual scheduling
|
|
* discipline) computation time of all instances, a.k.a. runtime;
|
|
* - the deadline (relative to the actual activation time) of each
|
|
* instance.
|
|
* Very briefly, a periodic (sporadic) task asks for the execution of
|
|
* some specific computation --which is typically called an instance--
|
|
* (at most) every period. Moreover, each instance typically lasts no more
|
|
* than the runtime and must be completed by time instant t equal to
|
|
* the instance activation time + the deadline.
|
|
*
|
|
* This is reflected by the actual fields of the sched_attr structure:
|
|
*
|
|
* @size size of the structure, for fwd/bwd compat.
|
|
*
|
|
* @sched_policy task's scheduling policy
|
|
* @sched_flags for customizing the scheduler behaviour
|
|
* @sched_nice task's nice value (SCHED_NORMAL/BATCH)
|
|
* @sched_priority task's static priority (SCHED_FIFO/RR)
|
|
* @sched_deadline representative of the task's deadline
|
|
* @sched_runtime representative of the task's runtime
|
|
* @sched_period representative of the task's period
|
|
*
|
|
* Given this task model, there are a multiplicity of scheduling algorithms
|
|
* and policies, that can be used to ensure all the tasks will make their
|
|
* timing constraints.
|
|
*
|
|
* As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the
|
|
* only user of this new interface. More information about the algorithm
|
|
* available in the scheduling class file or in Documentation/.
|
|
*/
|
|
struct sched_attr {
|
|
u32 size;
|
|
|
|
u32 sched_policy;
|
|
u64 sched_flags;
|
|
|
|
/* SCHED_NORMAL, SCHED_BATCH */
|
|
s32 sched_nice;
|
|
|
|
/* SCHED_FIFO, SCHED_RR */
|
|
u32 sched_priority;
|
|
|
|
/* SCHED_DEADLINE */
|
|
u64 sched_runtime;
|
|
u64 sched_deadline;
|
|
u64 sched_period;
|
|
};
|
|
|
|
struct futex_pi_state;
|
|
struct robust_list_head;
|
|
struct bio_list;
|
|
struct fs_struct;
|
|
struct perf_event_context;
|
|
struct blk_plug;
|
|
struct filename;
|
|
struct nameidata;
|
|
|
|
#define VMACACHE_BITS 2
|
|
#define VMACACHE_SIZE (1U << VMACACHE_BITS)
|
|
#define VMACACHE_MASK (VMACACHE_SIZE - 1)
|
|
|
|
/*
|
|
* These are the constant used to fake the fixed-point load-average
|
|
* counting. Some notes:
|
|
* - 11 bit fractions expand to 22 bits by the multiplies: this gives
|
|
* a load-average precision of 10 bits integer + 11 bits fractional
|
|
* - if you want to count load-averages more often, you need more
|
|
* precision, or rounding will get you. With 2-second counting freq,
|
|
* the EXP_n values would be 1981, 2034 and 2043 if still using only
|
|
* 11 bit fractions.
|
|
*/
|
|
extern unsigned long avenrun[]; /* Load averages */
|
|
extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
|
|
|
|
#define FSHIFT 11 /* nr of bits of precision */
|
|
#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
|
|
#define LOAD_FREQ (5*HZ+1) /* 5 sec intervals */
|
|
#define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */
|
|
#define EXP_5 2014 /* 1/exp(5sec/5min) */
|
|
#define EXP_15 2037 /* 1/exp(5sec/15min) */
|
|
|
|
#define CALC_LOAD(load,exp,n) \
|
|
load *= exp; \
|
|
load += n*(FIXED_1-exp); \
|
|
load >>= FSHIFT;
|
|
|
|
extern unsigned long total_forks;
|
|
extern int nr_threads;
|
|
DECLARE_PER_CPU(unsigned long, process_counts);
|
|
extern int nr_processes(void);
|
|
extern unsigned long nr_running(void);
|
|
extern bool single_task_running(void);
|
|
extern unsigned long nr_iowait(void);
|
|
extern unsigned long nr_iowait_cpu(int cpu);
|
|
extern void get_iowait_load(unsigned long *nr_waiters, unsigned long *load);
|
|
#ifdef CONFIG_CPU_QUIET
|
|
extern u64 nr_running_integral(unsigned int cpu);
|
|
#endif
|
|
|
|
extern void sched_update_nr_prod(int cpu, long delta, bool inc);
|
|
extern void sched_get_nr_running_avg(int *avg, int *iowait_avg, int *big_avg);
|
|
|
|
extern void calc_global_load(unsigned long ticks);
|
|
|
|
#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
|
|
extern void cpu_load_update_nohz_start(void);
|
|
extern void cpu_load_update_nohz_stop(void);
|
|
#else
|
|
static inline void cpu_load_update_nohz_start(void) { }
|
|
static inline void cpu_load_update_nohz_stop(void) { }
|
|
#endif
|
|
|
|
extern void dump_cpu_task(int cpu);
|
|
|
|
struct seq_file;
|
|
struct cfs_rq;
|
|
struct task_group;
|
|
#ifdef CONFIG_SCHED_DEBUG
|
|
extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m);
|
|
extern void proc_sched_set_task(struct task_struct *p);
|
|
#endif
|
|
|
|
/*
|
|
* Task state bitmask. NOTE! These bits are also
|
|
* encoded in fs/proc/array.c: get_task_state().
|
|
*
|
|
* We have two separate sets of flags: task->state
|
|
* is about runnability, while task->exit_state are
|
|
* about the task exiting. Confusing, but this way
|
|
* modifying one set can't modify the other one by
|
|
* mistake.
|
|
*/
|
|
#define TASK_RUNNING 0
|
|
#define TASK_INTERRUPTIBLE 1
|
|
#define TASK_UNINTERRUPTIBLE 2
|
|
#define __TASK_STOPPED 4
|
|
#define __TASK_TRACED 8
|
|
/* in tsk->exit_state */
|
|
#define EXIT_DEAD 16
|
|
#define EXIT_ZOMBIE 32
|
|
#define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD)
|
|
/* in tsk->state again */
|
|
#define TASK_DEAD 64
|
|
#define TASK_WAKEKILL 128
|
|
#define TASK_WAKING 256
|
|
#define TASK_PARKED 512
|
|
#define TASK_NOLOAD 1024
|
|
#define TASK_NEW 2048
|
|
#define TASK_STATE_MAX 4096
|
|
|
|
#define TASK_STATE_TO_CHAR_STR "RSDTtXZxKWPNn"
|
|
|
|
extern char ___assert_task_state[1 - 2*!!(
|
|
sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)];
|
|
|
|
/* Convenience macros for the sake of set_task_state */
|
|
#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
|
|
#define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED)
|
|
#define TASK_TRACED (TASK_WAKEKILL | __TASK_TRACED)
|
|
|
|
#define TASK_IDLE (TASK_UNINTERRUPTIBLE | TASK_NOLOAD)
|
|
|
|
/* Convenience macros for the sake of wake_up */
|
|
#define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
|
|
#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED)
|
|
|
|
/* get_task_state() */
|
|
#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \
|
|
TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
|
|
__TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD)
|
|
|
|
#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0)
|
|
#define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0)
|
|
#define task_is_stopped_or_traced(task) \
|
|
((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
|
|
#define task_contributes_to_load(task) \
|
|
((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
|
|
(task->flags & PF_FROZEN) == 0 && \
|
|
(task->state & TASK_NOLOAD) == 0)
|
|
|
|
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
|
|
|
|
#define __set_task_state(tsk, state_value) \
|
|
do { \
|
|
(tsk)->task_state_change = _THIS_IP_; \
|
|
(tsk)->state = (state_value); \
|
|
} while (0)
|
|
#define set_task_state(tsk, state_value) \
|
|
do { \
|
|
(tsk)->task_state_change = _THIS_IP_; \
|
|
smp_store_mb((tsk)->state, (state_value)); \
|
|
} while (0)
|
|
|
|
/*
|
|
* set_current_state() includes a barrier so that the write of current->state
|
|
* is correctly serialised wrt the caller's subsequent test of whether to
|
|
* actually sleep:
|
|
*
|
|
* set_current_state(TASK_UNINTERRUPTIBLE);
|
|
* if (do_i_need_to_sleep())
|
|
* schedule();
|
|
*
|
|
* If the caller does not need such serialisation then use __set_current_state()
|
|
*/
|
|
#define __set_current_state(state_value) \
|
|
do { \
|
|
current->task_state_change = _THIS_IP_; \
|
|
current->state = (state_value); \
|
|
} while (0)
|
|
#define set_current_state(state_value) \
|
|
do { \
|
|
current->task_state_change = _THIS_IP_; \
|
|
smp_store_mb(current->state, (state_value)); \
|
|
} while (0)
|
|
|
|
#else
|
|
|
|
#define __set_task_state(tsk, state_value) \
|
|
do { (tsk)->state = (state_value); } while (0)
|
|
#define set_task_state(tsk, state_value) \
|
|
smp_store_mb((tsk)->state, (state_value))
|
|
|
|
/*
|
|
* set_current_state() includes a barrier so that the write of current->state
|
|
* is correctly serialised wrt the caller's subsequent test of whether to
|
|
* actually sleep:
|
|
*
|
|
* set_current_state(TASK_UNINTERRUPTIBLE);
|
|
* if (do_i_need_to_sleep())
|
|
* schedule();
|
|
*
|
|
* If the caller does not need such serialisation then use __set_current_state()
|
|
*/
|
|
#define __set_current_state(state_value) \
|
|
do { current->state = (state_value); } while (0)
|
|
#define set_current_state(state_value) \
|
|
smp_store_mb(current->state, (state_value))
|
|
|
|
#endif
|
|
|
|
/* Task command name length */
|
|
#define TASK_COMM_LEN 16
|
|
|
|
extern const char *sched_window_reset_reasons[];
|
|
|
|
enum task_event {
|
|
PUT_PREV_TASK = 0,
|
|
PICK_NEXT_TASK = 1,
|
|
TASK_WAKE = 2,
|
|
TASK_MIGRATE = 3,
|
|
TASK_UPDATE = 4,
|
|
IRQ_UPDATE = 5,
|
|
};
|
|
|
|
/* Note: this need to be in sync with migrate_type_names array */
|
|
enum migrate_types {
|
|
GROUP_TO_RQ,
|
|
RQ_TO_GROUP,
|
|
};
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
/*
|
|
* 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;
|
|
|
|
struct task_struct;
|
|
|
|
#ifdef CONFIG_PROVE_RCU
|
|
extern int lockdep_tasklist_lock_is_held(void);
|
|
#endif /* #ifdef CONFIG_PROVE_RCU */
|
|
|
|
extern void sched_init(void);
|
|
extern void sched_init_smp(void);
|
|
extern asmlinkage void schedule_tail(struct task_struct *prev);
|
|
extern void init_idle(struct task_struct *idle, int cpu, bool hotplug);
|
|
extern void init_idle_bootup_task(struct task_struct *idle);
|
|
|
|
extern cpumask_var_t cpu_isolated_map;
|
|
|
|
extern int runqueue_is_locked(int cpu);
|
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
extern int sched_isolate_count(const cpumask_t *mask, bool include_offline);
|
|
extern int sched_isolate_cpu(int cpu);
|
|
extern int sched_unisolate_cpu(int cpu);
|
|
extern int sched_unisolate_cpu_unlocked(int cpu);
|
|
#else
|
|
static inline int sched_isolate_count(const cpumask_t *mask,
|
|
bool include_offline)
|
|
{
|
|
cpumask_t count_mask;
|
|
|
|
if (include_offline)
|
|
cpumask_andnot(&count_mask, mask, cpu_online_mask);
|
|
else
|
|
return 0;
|
|
|
|
return cpumask_weight(&count_mask);
|
|
}
|
|
|
|
static inline int sched_isolate_cpu(int cpu)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int sched_unisolate_cpu(int cpu)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int sched_unisolate_cpu_unlocked(int cpu)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
|
|
extern void nohz_balance_enter_idle(int cpu);
|
|
extern void set_cpu_sd_state_idle(void);
|
|
extern int get_nohz_timer_target(void);
|
|
#else
|
|
static inline void nohz_balance_enter_idle(int cpu) { }
|
|
static inline void set_cpu_sd_state_idle(void) { }
|
|
#endif
|
|
|
|
/*
|
|
* Only dump TASK_* tasks. (0 for all tasks)
|
|
*/
|
|
extern void show_state_filter(unsigned long state_filter);
|
|
|
|
static inline void show_state(void)
|
|
{
|
|
show_state_filter(0);
|
|
}
|
|
|
|
extern void show_regs(struct pt_regs *);
|
|
|
|
/*
|
|
* TASK is a pointer to the task whose backtrace we want to see (or NULL for current
|
|
* task), SP is the stack pointer of the first frame that should be shown in the back
|
|
* trace (or NULL if the entire call-chain of the task should be shown).
|
|
*/
|
|
extern void show_stack(struct task_struct *task, unsigned long *sp);
|
|
|
|
extern void cpu_init (void);
|
|
extern void trap_init(void);
|
|
extern void update_process_times(int user);
|
|
extern void scheduler_tick(void);
|
|
extern int sched_cpu_starting(unsigned int cpu);
|
|
extern int sched_cpu_activate(unsigned int cpu);
|
|
extern int sched_cpu_deactivate(unsigned int cpu);
|
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
extern int sched_cpu_dying(unsigned int cpu);
|
|
#else
|
|
# define sched_cpu_dying NULL
|
|
#endif
|
|
|
|
extern void sched_show_task(struct task_struct *p);
|
|
|
|
#ifdef CONFIG_LOCKUP_DETECTOR
|
|
extern void touch_softlockup_watchdog_sched(void);
|
|
extern void touch_softlockup_watchdog(void);
|
|
extern void touch_softlockup_watchdog_sync(void);
|
|
extern void touch_all_softlockup_watchdogs(void);
|
|
extern int proc_dowatchdog_thresh(struct ctl_table *table, int write,
|
|
void __user *buffer,
|
|
size_t *lenp, loff_t *ppos);
|
|
extern unsigned int softlockup_panic;
|
|
extern unsigned int hardlockup_panic;
|
|
void lockup_detector_init(void);
|
|
extern void watchdog_enable(unsigned int cpu);
|
|
extern void watchdog_disable(unsigned int cpu);
|
|
extern bool watchdog_configured(unsigned int cpu);
|
|
#else
|
|
static inline void touch_softlockup_watchdog_sched(void)
|
|
{
|
|
}
|
|
static inline void touch_softlockup_watchdog(void)
|
|
{
|
|
}
|
|
static inline void touch_softlockup_watchdog_sync(void)
|
|
{
|
|
}
|
|
static inline void touch_all_softlockup_watchdogs(void)
|
|
{
|
|
}
|
|
static inline void lockup_detector_init(void)
|
|
{
|
|
}
|
|
static inline void watchdog_enable(unsigned int cpu)
|
|
{
|
|
}
|
|
static inline void watchdog_disable(unsigned int cpu)
|
|
{
|
|
}
|
|
static inline bool watchdog_configured(unsigned int cpu)
|
|
{
|
|
/*
|
|
* Predend the watchdog is always configured.
|
|
* We will be waiting for the watchdog to be enabled in core isolation
|
|
*/
|
|
return true;
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_DETECT_HUNG_TASK
|
|
void reset_hung_task_detector(void);
|
|
#else
|
|
static inline void reset_hung_task_detector(void)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
/* Attach to any functions which should be ignored in wchan output. */
|
|
#define __sched __attribute__((__section__(".sched.text")))
|
|
|
|
/* Linker adds these: start and end of __sched functions */
|
|
extern char __sched_text_start[], __sched_text_end[];
|
|
|
|
/* Is this address in the __sched functions? */
|
|
extern int in_sched_functions(unsigned long addr);
|
|
|
|
#define MAX_SCHEDULE_TIMEOUT LONG_MAX
|
|
extern signed long schedule_timeout(signed long timeout);
|
|
extern signed long schedule_timeout_interruptible(signed long timeout);
|
|
extern signed long schedule_timeout_killable(signed long timeout);
|
|
extern signed long schedule_timeout_uninterruptible(signed long timeout);
|
|
extern signed long schedule_timeout_idle(signed long timeout);
|
|
asmlinkage void schedule(void);
|
|
extern void schedule_preempt_disabled(void);
|
|
|
|
extern long io_schedule_timeout(long timeout);
|
|
|
|
static inline void io_schedule(void)
|
|
{
|
|
io_schedule_timeout(MAX_SCHEDULE_TIMEOUT);
|
|
}
|
|
|
|
void __noreturn do_task_dead(void);
|
|
|
|
struct nsproxy;
|
|
struct user_namespace;
|
|
|
|
#ifdef CONFIG_MMU
|
|
extern void arch_pick_mmap_layout(struct mm_struct *mm);
|
|
extern unsigned long
|
|
arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
|
|
unsigned long, unsigned long);
|
|
extern unsigned long
|
|
arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
|
|
unsigned long len, unsigned long pgoff,
|
|
unsigned long flags);
|
|
#else
|
|
static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
|
|
#endif
|
|
|
|
#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
|
|
#define SUID_DUMP_USER 1 /* Dump as user of process */
|
|
#define SUID_DUMP_ROOT 2 /* Dump as root */
|
|
|
|
/* mm flags */
|
|
|
|
/* for SUID_DUMP_* above */
|
|
#define MMF_DUMPABLE_BITS 2
|
|
#define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1)
|
|
|
|
extern void set_dumpable(struct mm_struct *mm, int value);
|
|
/*
|
|
* This returns the actual value of the suid_dumpable flag. For things
|
|
* that are using this for checking for privilege transitions, it must
|
|
* test against SUID_DUMP_USER rather than treating it as a boolean
|
|
* value.
|
|
*/
|
|
static inline int __get_dumpable(unsigned long mm_flags)
|
|
{
|
|
return mm_flags & MMF_DUMPABLE_MASK;
|
|
}
|
|
|
|
static inline int get_dumpable(struct mm_struct *mm)
|
|
{
|
|
return __get_dumpable(mm->flags);
|
|
}
|
|
|
|
/* coredump filter bits */
|
|
#define MMF_DUMP_ANON_PRIVATE 2
|
|
#define MMF_DUMP_ANON_SHARED 3
|
|
#define MMF_DUMP_MAPPED_PRIVATE 4
|
|
#define MMF_DUMP_MAPPED_SHARED 5
|
|
#define MMF_DUMP_ELF_HEADERS 6
|
|
#define MMF_DUMP_HUGETLB_PRIVATE 7
|
|
#define MMF_DUMP_HUGETLB_SHARED 8
|
|
#define MMF_DUMP_DAX_PRIVATE 9
|
|
#define MMF_DUMP_DAX_SHARED 10
|
|
|
|
#define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS
|
|
#define MMF_DUMP_FILTER_BITS 9
|
|
#define MMF_DUMP_FILTER_MASK \
|
|
(((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
|
|
#define MMF_DUMP_FILTER_DEFAULT \
|
|
((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED) |\
|
|
(1 << MMF_DUMP_HUGETLB_PRIVATE) | MMF_DUMP_MASK_DEFAULT_ELF)
|
|
|
|
#ifdef CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS
|
|
# define MMF_DUMP_MASK_DEFAULT_ELF (1 << MMF_DUMP_ELF_HEADERS)
|
|
#else
|
|
# define MMF_DUMP_MASK_DEFAULT_ELF 0
|
|
#endif
|
|
/* leave room for more dump flags */
|
|
#define MMF_VM_MERGEABLE 16 /* KSM may merge identical pages */
|
|
#define MMF_VM_HUGEPAGE 17 /* set when VM_HUGEPAGE is set on vma */
|
|
#define MMF_EXE_FILE_CHANGED 18 /* see prctl_set_mm_exe_file() */
|
|
|
|
#define MMF_HAS_UPROBES 19 /* has uprobes */
|
|
#define MMF_RECALC_UPROBES 20 /* MMF_HAS_UPROBES can be wrong */
|
|
#define MMF_OOM_SKIP 21 /* mm is of no interest for the OOM killer */
|
|
#define MMF_UNSTABLE 22 /* mm is unstable for copy_from_user */
|
|
#define MMF_HUGE_ZERO_PAGE 23 /* mm has ever used the global huge zero page */
|
|
|
|
#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK)
|
|
|
|
struct sighand_struct {
|
|
atomic_t count;
|
|
struct k_sigaction action[_NSIG];
|
|
spinlock_t siglock;
|
|
wait_queue_head_t signalfd_wqh;
|
|
};
|
|
|
|
struct pacct_struct {
|
|
int ac_flag;
|
|
long ac_exitcode;
|
|
unsigned long ac_mem;
|
|
cputime_t ac_utime, ac_stime;
|
|
unsigned long ac_minflt, ac_majflt;
|
|
};
|
|
|
|
struct cpu_itimer {
|
|
cputime_t expires;
|
|
cputime_t incr;
|
|
u32 error;
|
|
u32 incr_error;
|
|
};
|
|
|
|
/**
|
|
* struct prev_cputime - snaphsot of system and user cputime
|
|
* @utime: time spent in user mode
|
|
* @stime: time spent in system mode
|
|
* @lock: protects the above two fields
|
|
*
|
|
* Stores previous user/system time values such that we can guarantee
|
|
* monotonicity.
|
|
*/
|
|
struct prev_cputime {
|
|
#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
|
|
cputime_t utime;
|
|
cputime_t stime;
|
|
raw_spinlock_t lock;
|
|
#endif
|
|
};
|
|
|
|
static inline void prev_cputime_init(struct prev_cputime *prev)
|
|
{
|
|
#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
|
|
prev->utime = prev->stime = 0;
|
|
raw_spin_lock_init(&prev->lock);
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* struct task_cputime - collected CPU time counts
|
|
* @utime: time spent in user mode, in &cputime_t units
|
|
* @stime: time spent in kernel mode, in &cputime_t units
|
|
* @sum_exec_runtime: total time spent on the CPU, in nanoseconds
|
|
*
|
|
* This structure groups together three kinds of CPU time that are tracked for
|
|
* threads and thread groups. Most things considering CPU time want to group
|
|
* these counts together and treat all three of them in parallel.
|
|
*/
|
|
struct task_cputime {
|
|
cputime_t utime;
|
|
cputime_t stime;
|
|
unsigned long long sum_exec_runtime;
|
|
};
|
|
|
|
/* Alternate field names when used to cache expirations. */
|
|
#define virt_exp utime
|
|
#define prof_exp stime
|
|
#define sched_exp sum_exec_runtime
|
|
|
|
#define INIT_CPUTIME \
|
|
(struct task_cputime) { \
|
|
.utime = 0, \
|
|
.stime = 0, \
|
|
.sum_exec_runtime = 0, \
|
|
}
|
|
|
|
/*
|
|
* This is the atomic variant of task_cputime, which can be used for
|
|
* storing and updating task_cputime statistics without locking.
|
|
*/
|
|
struct task_cputime_atomic {
|
|
atomic64_t utime;
|
|
atomic64_t stime;
|
|
atomic64_t sum_exec_runtime;
|
|
};
|
|
|
|
#define INIT_CPUTIME_ATOMIC \
|
|
(struct task_cputime_atomic) { \
|
|
.utime = ATOMIC64_INIT(0), \
|
|
.stime = ATOMIC64_INIT(0), \
|
|
.sum_exec_runtime = ATOMIC64_INIT(0), \
|
|
}
|
|
|
|
#define PREEMPT_DISABLED (PREEMPT_DISABLE_OFFSET + PREEMPT_ENABLED)
|
|
|
|
/*
|
|
* Disable preemption until the scheduler is running -- use an unconditional
|
|
* value so that it also works on !PREEMPT_COUNT kernels.
|
|
*
|
|
* Reset by start_kernel()->sched_init()->init_idle()->init_idle_preempt_count().
|
|
*/
|
|
#define INIT_PREEMPT_COUNT PREEMPT_OFFSET
|
|
|
|
/*
|
|
* Initial preempt_count value; reflects the preempt_count schedule invariant
|
|
* which states that during context switches:
|
|
*
|
|
* preempt_count() == 2*PREEMPT_DISABLE_OFFSET
|
|
*
|
|
* Note: PREEMPT_DISABLE_OFFSET is 0 for !PREEMPT_COUNT kernels.
|
|
* Note: See finish_task_switch().
|
|
*/
|
|
#define FORK_PREEMPT_COUNT (2*PREEMPT_DISABLE_OFFSET + PREEMPT_ENABLED)
|
|
|
|
/**
|
|
* struct thread_group_cputimer - thread group interval timer counts
|
|
* @cputime_atomic: atomic thread group interval timers.
|
|
* @running: true when there are timers running and
|
|
* @cputime_atomic receives updates.
|
|
* @checking_timer: true when a thread in the group is in the
|
|
* process of checking for thread group timers.
|
|
*
|
|
* This structure contains the version of task_cputime, above, that is
|
|
* used for thread group CPU timer calculations.
|
|
*/
|
|
struct thread_group_cputimer {
|
|
struct task_cputime_atomic cputime_atomic;
|
|
bool running;
|
|
bool checking_timer;
|
|
};
|
|
|
|
#include <linux/rwsem.h>
|
|
struct autogroup;
|
|
|
|
/*
|
|
* NOTE! "signal_struct" does not have its own
|
|
* locking, because a shared signal_struct always
|
|
* implies a shared sighand_struct, so locking
|
|
* sighand_struct is always a proper superset of
|
|
* the locking of signal_struct.
|
|
*/
|
|
struct signal_struct {
|
|
atomic_t sigcnt;
|
|
atomic_t live;
|
|
int nr_threads;
|
|
struct list_head thread_head;
|
|
|
|
wait_queue_head_t wait_chldexit; /* for wait4() */
|
|
|
|
/* current thread group signal load-balancing target: */
|
|
struct task_struct *curr_target;
|
|
|
|
/* shared signal handling: */
|
|
struct sigpending shared_pending;
|
|
|
|
/* thread group exit support */
|
|
int group_exit_code;
|
|
/* overloaded:
|
|
* - notify group_exit_task when ->count is equal to notify_count
|
|
* - everyone except group_exit_task is stopped during signal delivery
|
|
* of fatal signals, group_exit_task processes the signal.
|
|
*/
|
|
int notify_count;
|
|
struct task_struct *group_exit_task;
|
|
|
|
/* thread group stop support, overloads group_exit_code too */
|
|
int group_stop_count;
|
|
unsigned int flags; /* see SIGNAL_* flags below */
|
|
|
|
/*
|
|
* PR_SET_CHILD_SUBREAPER marks a process, like a service
|
|
* manager, to re-parent orphan (double-forking) child processes
|
|
* to this process instead of 'init'. The service manager is
|
|
* able to receive SIGCHLD signals and is able to investigate
|
|
* the process until it calls wait(). All children of this
|
|
* process will inherit a flag if they should look for a
|
|
* child_subreaper process at exit.
|
|
*/
|
|
unsigned int is_child_subreaper:1;
|
|
unsigned int has_child_subreaper:1;
|
|
|
|
/* POSIX.1b Interval Timers */
|
|
int posix_timer_id;
|
|
struct list_head posix_timers;
|
|
|
|
/* ITIMER_REAL timer for the process */
|
|
struct hrtimer real_timer;
|
|
struct pid *leader_pid;
|
|
ktime_t it_real_incr;
|
|
|
|
/*
|
|
* ITIMER_PROF and ITIMER_VIRTUAL timers for the process, we use
|
|
* CPUCLOCK_PROF and CPUCLOCK_VIRT for indexing array as these
|
|
* values are defined to 0 and 1 respectively
|
|
*/
|
|
struct cpu_itimer it[2];
|
|
|
|
/*
|
|
* Thread group totals for process CPU timers.
|
|
* See thread_group_cputimer(), et al, for details.
|
|
*/
|
|
struct thread_group_cputimer cputimer;
|
|
|
|
/* Earliest-expiration cache. */
|
|
struct task_cputime cputime_expires;
|
|
|
|
#ifdef CONFIG_NO_HZ_FULL
|
|
atomic_t tick_dep_mask;
|
|
#endif
|
|
|
|
struct list_head cpu_timers[3];
|
|
|
|
struct pid *tty_old_pgrp;
|
|
|
|
/* boolean value for session group leader */
|
|
int leader;
|
|
|
|
struct tty_struct *tty; /* NULL if no tty */
|
|
|
|
#ifdef CONFIG_SCHED_AUTOGROUP
|
|
struct autogroup *autogroup;
|
|
#endif
|
|
/*
|
|
* Cumulative resource counters for dead threads in the group,
|
|
* and for reaped dead child processes forked by this group.
|
|
* Live threads maintain their own counters and add to these
|
|
* in __exit_signal, except for the group leader.
|
|
*/
|
|
seqlock_t stats_lock;
|
|
cputime_t utime, stime, cutime, cstime;
|
|
cputime_t gtime;
|
|
cputime_t cgtime;
|
|
struct prev_cputime prev_cputime;
|
|
unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
|
|
unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
|
|
unsigned long inblock, oublock, cinblock, coublock;
|
|
unsigned long maxrss, cmaxrss;
|
|
struct task_io_accounting ioac;
|
|
|
|
/*
|
|
* Cumulative ns of schedule CPU time fo dead threads in the
|
|
* group, not including a zombie group leader, (This only differs
|
|
* from jiffies_to_ns(utime + stime) if sched_clock uses something
|
|
* other than jiffies.)
|
|
*/
|
|
unsigned long long sum_sched_runtime;
|
|
|
|
/*
|
|
* We don't bother to synchronize most readers of this at all,
|
|
* because there is no reader checking a limit that actually needs
|
|
* to get both rlim_cur and rlim_max atomically, and either one
|
|
* alone is a single word that can safely be read normally.
|
|
* getrlimit/setrlimit use task_lock(current->group_leader) to
|
|
* protect this instead of the siglock, because they really
|
|
* have no need to disable irqs.
|
|
*/
|
|
struct rlimit rlim[RLIM_NLIMITS];
|
|
|
|
#ifdef CONFIG_BSD_PROCESS_ACCT
|
|
struct pacct_struct pacct; /* per-process accounting information */
|
|
#endif
|
|
#ifdef CONFIG_TASKSTATS
|
|
struct taskstats *stats;
|
|
#endif
|
|
#ifdef CONFIG_AUDIT
|
|
unsigned audit_tty;
|
|
struct tty_audit_buf *tty_audit_buf;
|
|
#endif
|
|
|
|
/*
|
|
* Thread is the potential origin of an oom condition; kill first on
|
|
* oom
|
|
*/
|
|
bool oom_flag_origin;
|
|
short oom_score_adj; /* OOM kill score adjustment */
|
|
short oom_score_adj_min; /* OOM kill score adjustment min value.
|
|
* Only settable by CAP_SYS_RESOURCE. */
|
|
struct mm_struct *oom_mm; /* recorded mm when the thread group got
|
|
* killed by the oom killer */
|
|
|
|
struct mutex cred_guard_mutex; /* guard against foreign influences on
|
|
* credential calculations
|
|
* (notably. ptrace) */
|
|
};
|
|
|
|
/*
|
|
* Bits in flags field of signal_struct.
|
|
*/
|
|
#define SIGNAL_STOP_STOPPED 0x00000001 /* job control stop in effect */
|
|
#define SIGNAL_STOP_CONTINUED 0x00000002 /* SIGCONT since WCONTINUED reap */
|
|
#define SIGNAL_GROUP_EXIT 0x00000004 /* group exit in progress */
|
|
#define SIGNAL_GROUP_COREDUMP 0x00000008 /* coredump in progress */
|
|
/*
|
|
* Pending notifications to parent.
|
|
*/
|
|
#define SIGNAL_CLD_STOPPED 0x00000010
|
|
#define SIGNAL_CLD_CONTINUED 0x00000020
|
|
#define SIGNAL_CLD_MASK (SIGNAL_CLD_STOPPED|SIGNAL_CLD_CONTINUED)
|
|
|
|
#define SIGNAL_UNKILLABLE 0x00000040 /* for init: ignore fatal signals */
|
|
|
|
/* If true, all threads except ->group_exit_task have pending SIGKILL */
|
|
static inline int signal_group_exit(const struct signal_struct *sig)
|
|
{
|
|
return (sig->flags & SIGNAL_GROUP_EXIT) ||
|
|
(sig->group_exit_task != NULL);
|
|
}
|
|
|
|
/*
|
|
* Some day this will be a full-fledged user tracking system..
|
|
*/
|
|
struct user_struct {
|
|
atomic_t __count; /* reference count */
|
|
atomic_t processes; /* How many processes does this user have? */
|
|
atomic_t sigpending; /* How many pending signals does this user have? */
|
|
#ifdef CONFIG_INOTIFY_USER
|
|
atomic_t inotify_watches; /* How many inotify watches does this user have? */
|
|
atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
|
|
#endif
|
|
#ifdef CONFIG_FANOTIFY
|
|
atomic_t fanotify_listeners;
|
|
#endif
|
|
#ifdef CONFIG_EPOLL
|
|
atomic_long_t epoll_watches; /* The number of file descriptors currently watched */
|
|
#endif
|
|
#ifdef CONFIG_POSIX_MQUEUE
|
|
/* protected by mq_lock */
|
|
unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */
|
|
#endif
|
|
unsigned long locked_shm; /* How many pages of mlocked shm ? */
|
|
unsigned long unix_inflight; /* How many files in flight in unix sockets */
|
|
atomic_long_t pipe_bufs; /* how many pages are allocated in pipe buffers */
|
|
|
|
#ifdef CONFIG_KEYS
|
|
struct key *uid_keyring; /* UID specific keyring */
|
|
struct key *session_keyring; /* UID's default session keyring */
|
|
#endif
|
|
|
|
/* Hash table maintenance information */
|
|
struct hlist_node uidhash_node;
|
|
kuid_t uid;
|
|
|
|
#if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL)
|
|
atomic_long_t locked_vm;
|
|
#endif
|
|
};
|
|
|
|
extern int uids_sysfs_init(void);
|
|
|
|
extern struct user_struct *find_user(kuid_t);
|
|
|
|
extern struct user_struct root_user;
|
|
#define INIT_USER (&root_user)
|
|
|
|
|
|
struct backing_dev_info;
|
|
struct reclaim_state;
|
|
|
|
#ifdef CONFIG_SCHED_INFO
|
|
struct sched_info {
|
|
/* cumulative counters */
|
|
unsigned long pcount; /* # of times run on this cpu */
|
|
unsigned long long run_delay; /* time spent waiting on a runqueue */
|
|
|
|
/* timestamps */
|
|
unsigned long long last_arrival,/* when we last ran on a cpu */
|
|
last_queued; /* when we were last queued to run */
|
|
};
|
|
#endif /* CONFIG_SCHED_INFO */
|
|
|
|
#ifdef CONFIG_TASK_DELAY_ACCT
|
|
struct task_delay_info {
|
|
spinlock_t lock;
|
|
unsigned int flags; /* Private per-task flags */
|
|
|
|
/* For each stat XXX, add following, aligned appropriately
|
|
*
|
|
* struct timespec XXX_start, XXX_end;
|
|
* u64 XXX_delay;
|
|
* u32 XXX_count;
|
|
*
|
|
* Atomicity of updates to XXX_delay, XXX_count protected by
|
|
* single lock above (split into XXX_lock if contention is an issue).
|
|
*/
|
|
|
|
/*
|
|
* XXX_count is incremented on every XXX operation, the delay
|
|
* associated with the operation is added to XXX_delay.
|
|
* XXX_delay contains the accumulated delay time in nanoseconds.
|
|
*/
|
|
u64 blkio_start; /* Shared by blkio, swapin */
|
|
u64 blkio_delay; /* wait for sync block io completion */
|
|
u64 swapin_delay; /* wait for swapin block io completion */
|
|
u32 blkio_count; /* total count of the number of sync block */
|
|
/* io operations performed */
|
|
u32 swapin_count; /* total count of the number of swapin block */
|
|
/* io operations performed */
|
|
|
|
u64 freepages_start;
|
|
u64 freepages_delay; /* wait for memory reclaim */
|
|
u32 freepages_count; /* total count of memory reclaim */
|
|
};
|
|
#endif /* CONFIG_TASK_DELAY_ACCT */
|
|
|
|
static inline int sched_info_on(void)
|
|
{
|
|
#ifdef CONFIG_SCHEDSTATS
|
|
return 1;
|
|
#elif defined(CONFIG_TASK_DELAY_ACCT)
|
|
extern int delayacct_on;
|
|
return delayacct_on;
|
|
#else
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
#ifdef CONFIG_SCHEDSTATS
|
|
void force_schedstat_enabled(void);
|
|
#endif
|
|
|
|
enum cpu_idle_type {
|
|
CPU_IDLE,
|
|
CPU_NOT_IDLE,
|
|
CPU_NEWLY_IDLE,
|
|
CPU_MAX_IDLE_TYPES
|
|
};
|
|
|
|
/*
|
|
* Integer metrics need fixed point arithmetic, e.g., sched/fair
|
|
* has a few: load, load_avg, util_avg, freq, and capacity.
|
|
*
|
|
* We define a basic fixed point arithmetic range, and then formalize
|
|
* all these metrics based on that basic range.
|
|
*/
|
|
# define SCHED_FIXEDPOINT_SHIFT 10
|
|
# define SCHED_FIXEDPOINT_SCALE (1L << SCHED_FIXEDPOINT_SHIFT)
|
|
|
|
/*
|
|
* Increase resolution of cpu_capacity calculations
|
|
*/
|
|
#define SCHED_CAPACITY_SHIFT SCHED_FIXEDPOINT_SHIFT
|
|
#define SCHED_CAPACITY_SCALE (1L << SCHED_CAPACITY_SHIFT)
|
|
|
|
struct sched_capacity_reqs {
|
|
unsigned long cfs;
|
|
unsigned long rt;
|
|
unsigned long dl;
|
|
|
|
unsigned long total;
|
|
};
|
|
|
|
/*
|
|
* Wake-queues are lists of tasks with a pending wakeup, whose
|
|
* callers have already marked the task as woken internally,
|
|
* and can thus carry on. A common use case is being able to
|
|
* do the wakeups once the corresponding user lock as been
|
|
* released.
|
|
*
|
|
* We hold reference to each task in the list across the wakeup,
|
|
* thus guaranteeing that the memory is still valid by the time
|
|
* the actual wakeups are performed in wake_up_q().
|
|
*
|
|
* One per task suffices, because there's never a need for a task to be
|
|
* in two wake queues simultaneously; it is forbidden to abandon a task
|
|
* in a wake queue (a call to wake_up_q() _must_ follow), so if a task is
|
|
* already in a wake queue, the wakeup will happen soon and the second
|
|
* waker can just skip it.
|
|
*
|
|
* The WAKE_Q macro declares and initializes the list head.
|
|
* wake_up_q() does NOT reinitialize the list; it's expected to be
|
|
* called near the end of a function, where the fact that the queue is
|
|
* not used again will be easy to see by inspection.
|
|
*
|
|
* Note that this can cause spurious wakeups. schedule() callers
|
|
* must ensure the call is done inside a loop, confirming that the
|
|
* wakeup condition has in fact occurred.
|
|
*/
|
|
struct wake_q_node {
|
|
struct wake_q_node *next;
|
|
};
|
|
|
|
struct wake_q_head {
|
|
struct wake_q_node *first;
|
|
struct wake_q_node **lastp;
|
|
};
|
|
|
|
#define WAKE_Q_TAIL ((struct wake_q_node *) 0x01)
|
|
|
|
#define WAKE_Q(name) \
|
|
struct wake_q_head name = { WAKE_Q_TAIL, &name.first }
|
|
|
|
extern void wake_q_add(struct wake_q_head *head,
|
|
struct task_struct *task);
|
|
extern void wake_up_q(struct wake_q_head *head);
|
|
|
|
/*
|
|
* sched-domains (multiprocessor balancing) declarations:
|
|
*/
|
|
#ifdef CONFIG_SMP
|
|
#define SD_LOAD_BALANCE 0x0001 /* Do load balancing on this domain. */
|
|
#define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */
|
|
#define SD_BALANCE_EXEC 0x0004 /* Balance on exec */
|
|
#define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */
|
|
#define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */
|
|
#define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */
|
|
#define SD_ASYM_CPUCAPACITY 0x0040 /* Groups have different max cpu capacities */
|
|
#define SD_SHARE_CPUCAPACITY 0x0080 /* Domain members share cpu capacity */
|
|
#define SD_SHARE_POWERDOMAIN 0x0100 /* Domain members share power domain */
|
|
#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */
|
|
#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
|
|
#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */
|
|
#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */
|
|
#define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */
|
|
#define SD_NUMA 0x4000 /* cross-node balancing */
|
|
#define SD_SHARE_CAP_STATES 0x8000 /* Domain members share capacity state */
|
|
|
|
#ifdef CONFIG_SCHED_SMT
|
|
static inline int cpu_smt_flags(void)
|
|
{
|
|
return SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES;
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_SCHED_MC
|
|
static inline int cpu_core_flags(void)
|
|
{
|
|
return SD_SHARE_PKG_RESOURCES;
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_NUMA
|
|
static inline int cpu_numa_flags(void)
|
|
{
|
|
return SD_NUMA;
|
|
}
|
|
#endif
|
|
|
|
struct sched_domain_attr {
|
|
int relax_domain_level;
|
|
};
|
|
|
|
#define SD_ATTR_INIT (struct sched_domain_attr) { \
|
|
.relax_domain_level = -1, \
|
|
}
|
|
|
|
extern int sched_domain_level_max;
|
|
|
|
struct capacity_state {
|
|
unsigned long cap; /* compute capacity */
|
|
unsigned long power; /* power consumption at this compute capacity */
|
|
};
|
|
|
|
struct idle_state {
|
|
unsigned long power; /* power consumption in this idle state */
|
|
};
|
|
|
|
struct sched_group_energy {
|
|
unsigned int nr_idle_states; /* number of idle states */
|
|
struct idle_state *idle_states; /* ptr to idle state array */
|
|
unsigned int nr_cap_states; /* number of capacity states */
|
|
struct capacity_state *cap_states; /* ptr to capacity state array */
|
|
};
|
|
|
|
unsigned long capacity_curr_of(int cpu);
|
|
|
|
struct sched_group;
|
|
|
|
struct sched_domain_shared {
|
|
atomic_t ref;
|
|
atomic_t nr_busy_cpus;
|
|
int has_idle_cores;
|
|
};
|
|
|
|
struct sched_domain {
|
|
/* These fields must be setup */
|
|
struct sched_domain *parent; /* top domain must be null terminated */
|
|
struct sched_domain *child; /* bottom domain must be null terminated */
|
|
struct sched_group *groups; /* the balancing groups of the domain */
|
|
unsigned long min_interval; /* Minimum balance interval ms */
|
|
unsigned long max_interval; /* Maximum balance interval ms */
|
|
unsigned int busy_factor; /* less balancing by factor if busy */
|
|
unsigned int imbalance_pct; /* No balance until over watermark */
|
|
unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */
|
|
unsigned int busy_idx;
|
|
unsigned int idle_idx;
|
|
unsigned int newidle_idx;
|
|
unsigned int wake_idx;
|
|
unsigned int forkexec_idx;
|
|
unsigned int smt_gain;
|
|
|
|
int nohz_idle; /* NOHZ IDLE status */
|
|
int flags; /* See SD_* */
|
|
int level;
|
|
|
|
/* Runtime fields. */
|
|
unsigned long last_balance; /* init to jiffies. units in jiffies */
|
|
unsigned int balance_interval; /* initialise to 1. units in ms. */
|
|
unsigned int nr_balance_failed; /* initialise to 0 */
|
|
|
|
/* idle_balance() stats */
|
|
u64 max_newidle_lb_cost;
|
|
unsigned long next_decay_max_lb_cost;
|
|
|
|
u64 avg_scan_cost; /* select_idle_sibling */
|
|
|
|
#ifdef CONFIG_SCHEDSTATS
|
|
/* load_balance() stats */
|
|
unsigned int lb_count[CPU_MAX_IDLE_TYPES];
|
|
unsigned int lb_failed[CPU_MAX_IDLE_TYPES];
|
|
unsigned int lb_balanced[CPU_MAX_IDLE_TYPES];
|
|
unsigned int lb_imbalance[CPU_MAX_IDLE_TYPES];
|
|
unsigned int lb_gained[CPU_MAX_IDLE_TYPES];
|
|
unsigned int lb_hot_gained[CPU_MAX_IDLE_TYPES];
|
|
unsigned int lb_nobusyg[CPU_MAX_IDLE_TYPES];
|
|
unsigned int lb_nobusyq[CPU_MAX_IDLE_TYPES];
|
|
|
|
/* Active load balancing */
|
|
unsigned int alb_count;
|
|
unsigned int alb_failed;
|
|
unsigned int alb_pushed;
|
|
|
|
/* SD_BALANCE_EXEC stats */
|
|
unsigned int sbe_count;
|
|
unsigned int sbe_balanced;
|
|
unsigned int sbe_pushed;
|
|
|
|
/* SD_BALANCE_FORK stats */
|
|
unsigned int sbf_count;
|
|
unsigned int sbf_balanced;
|
|
unsigned int sbf_pushed;
|
|
|
|
/* try_to_wake_up() stats */
|
|
unsigned int ttwu_wake_remote;
|
|
unsigned int ttwu_move_affine;
|
|
unsigned int ttwu_move_balance;
|
|
#endif
|
|
#ifdef CONFIG_SCHED_DEBUG
|
|
char *name;
|
|
#endif
|
|
union {
|
|
void *private; /* used during construction */
|
|
struct rcu_head rcu; /* used during destruction */
|
|
};
|
|
struct sched_domain_shared *shared;
|
|
|
|
unsigned int span_weight;
|
|
/*
|
|
* Span of all CPUs in this domain.
|
|
*
|
|
* NOTE: this field is variable length. (Allocated dynamically
|
|
* by attaching extra space to the end of the structure,
|
|
* depending on how many CPUs the kernel has booted up with)
|
|
*/
|
|
unsigned long span[0];
|
|
};
|
|
|
|
static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
|
|
{
|
|
return to_cpumask(sd->span);
|
|
}
|
|
|
|
extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
|
|
struct sched_domain_attr *dattr_new);
|
|
|
|
/* Allocate an array of sched domains, for partition_sched_domains(). */
|
|
cpumask_var_t *alloc_sched_domains(unsigned int ndoms);
|
|
void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms);
|
|
|
|
bool cpus_share_cache(int this_cpu, int that_cpu);
|
|
|
|
typedef const struct cpumask *(*sched_domain_mask_f)(int cpu);
|
|
typedef int (*sched_domain_flags_f)(void);
|
|
typedef
|
|
const struct sched_group_energy * const(*sched_domain_energy_f)(int cpu);
|
|
|
|
#define SDTL_OVERLAP 0x01
|
|
|
|
struct sd_data {
|
|
struct sched_domain **__percpu sd;
|
|
struct sched_domain_shared **__percpu sds;
|
|
struct sched_group **__percpu sg;
|
|
struct sched_group_capacity **__percpu sgc;
|
|
};
|
|
|
|
struct sched_domain_topology_level {
|
|
sched_domain_mask_f mask;
|
|
sched_domain_flags_f sd_flags;
|
|
sched_domain_energy_f energy;
|
|
int flags;
|
|
int numa_level;
|
|
struct sd_data data;
|
|
#ifdef CONFIG_SCHED_DEBUG
|
|
char *name;
|
|
#endif
|
|
};
|
|
|
|
extern void set_sched_topology(struct sched_domain_topology_level *tl);
|
|
extern void wake_up_if_idle(int cpu);
|
|
|
|
#ifdef CONFIG_SCHED_DEBUG
|
|
# define SD_INIT_NAME(type) .name = #type
|
|
#else
|
|
# define SD_INIT_NAME(type)
|
|
#endif
|
|
|
|
#else /* CONFIG_SMP */
|
|
|
|
struct sched_domain_attr;
|
|
|
|
static inline void
|
|
partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
|
|
struct sched_domain_attr *dattr_new)
|
|
{
|
|
}
|
|
|
|
static inline bool cpus_share_cache(int this_cpu, int that_cpu)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
#endif /* !CONFIG_SMP */
|
|
|
|
|
|
struct io_context; /* See blkdev.h */
|
|
|
|
|
|
#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK
|
|
extern void prefetch_stack(struct task_struct *t);
|
|
#else
|
|
static inline void prefetch_stack(struct task_struct *t) { }
|
|
#endif
|
|
|
|
struct audit_context; /* See audit.c */
|
|
struct mempolicy;
|
|
struct pipe_inode_info;
|
|
struct uts_namespace;
|
|
|
|
struct load_weight {
|
|
unsigned long weight;
|
|
u32 inv_weight;
|
|
};
|
|
|
|
/*
|
|
* The load_avg/util_avg accumulates an infinite geometric series
|
|
* (see __update_load_avg() in kernel/sched/fair.c).
|
|
*
|
|
* [load_avg definition]
|
|
*
|
|
* load_avg = runnable% * scale_load_down(load)
|
|
*
|
|
* where runnable% is the time ratio that a sched_entity is runnable.
|
|
* For cfs_rq, it is the aggregated load_avg of all runnable and
|
|
* blocked sched_entities.
|
|
*
|
|
* load_avg may also take frequency scaling into account:
|
|
*
|
|
* load_avg = runnable% * scale_load_down(load) * freq%
|
|
*
|
|
* where freq% is the CPU frequency normalized to the highest frequency.
|
|
*
|
|
* [util_avg definition]
|
|
*
|
|
* util_avg = running% * SCHED_CAPACITY_SCALE
|
|
*
|
|
* where running% is the time ratio that a sched_entity is running on
|
|
* a CPU. For cfs_rq, it is the aggregated util_avg of all runnable
|
|
* and blocked sched_entities.
|
|
*
|
|
* util_avg may also factor frequency scaling and CPU capacity scaling:
|
|
*
|
|
* util_avg = running% * SCHED_CAPACITY_SCALE * freq% * capacity%
|
|
*
|
|
* where freq% is the same as above, and capacity% is the CPU capacity
|
|
* normalized to the greatest capacity (due to uarch differences, etc).
|
|
*
|
|
* N.B., the above ratios (runnable%, running%, freq%, and capacity%)
|
|
* themselves are in the range of [0, 1]. To do fixed point arithmetics,
|
|
* we therefore scale them to as large a range as necessary. This is for
|
|
* example reflected by util_avg's SCHED_CAPACITY_SCALE.
|
|
*
|
|
* [Overflow issue]
|
|
*
|
|
* The 64-bit load_sum can have 4353082796 (=2^64/47742/88761) entities
|
|
* with the highest load (=88761), always runnable on a single cfs_rq,
|
|
* and should not overflow as the number already hits PID_MAX_LIMIT.
|
|
*
|
|
* For all other cases (including 32-bit kernels), struct load_weight's
|
|
* weight will overflow first before we do, because:
|
|
*
|
|
* Max(load_avg) <= Max(load.weight)
|
|
*
|
|
* Then it is the load_weight's responsibility to consider overflow
|
|
* issues.
|
|
*/
|
|
struct sched_avg {
|
|
u64 last_update_time, load_sum;
|
|
u32 util_sum, period_contrib;
|
|
unsigned long load_avg, util_avg;
|
|
};
|
|
|
|
#ifdef CONFIG_SCHEDSTATS
|
|
struct sched_statistics {
|
|
u64 wait_start;
|
|
u64 wait_max;
|
|
u64 wait_count;
|
|
u64 wait_sum;
|
|
u64 iowait_count;
|
|
u64 iowait_sum;
|
|
|
|
u64 sleep_start;
|
|
u64 sleep_max;
|
|
s64 sum_sleep_runtime;
|
|
|
|
u64 block_start;
|
|
u64 block_max;
|
|
u64 exec_max;
|
|
u64 slice_max;
|
|
|
|
u64 nr_migrations_cold;
|
|
u64 nr_failed_migrations_affine;
|
|
u64 nr_failed_migrations_running;
|
|
u64 nr_failed_migrations_hot;
|
|
u64 nr_forced_migrations;
|
|
|
|
u64 nr_wakeups;
|
|
u64 nr_wakeups_sync;
|
|
u64 nr_wakeups_migrate;
|
|
u64 nr_wakeups_local;
|
|
u64 nr_wakeups_remote;
|
|
u64 nr_wakeups_affine;
|
|
u64 nr_wakeups_affine_attempts;
|
|
u64 nr_wakeups_passive;
|
|
u64 nr_wakeups_idle;
|
|
};
|
|
#endif
|
|
|
|
#define RAVG_HIST_SIZE_MAX 5
|
|
#define NUM_BUSY_BUCKETS 10
|
|
|
|
/* ravg represents frequency scaled cpu-demand of tasks */
|
|
struct ravg {
|
|
/*
|
|
* 'mark_start' marks the beginning of an event (task waking up, task
|
|
* starting to execute, task being preempted) within a window
|
|
*
|
|
* 'sum' represents how runnable a task has been within current
|
|
* window. It incorporates both running time and wait time and is
|
|
* frequency scaled.
|
|
*
|
|
* 'sum_history' keeps track of history of 'sum' seen over previous
|
|
* RAVG_HIST_SIZE windows. Windows where task was entirely sleeping are
|
|
* ignored.
|
|
*
|
|
* 'demand' represents maximum sum seen over previous
|
|
* sysctl_sched_ravg_hist_size windows. 'demand' could drive frequency
|
|
* demand for tasks.
|
|
*
|
|
* 'curr_window_cpu' represents task's contribution to cpu busy time on
|
|
* various CPUs in the current window
|
|
*
|
|
* 'prev_window_cpu' represents task's contribution to cpu busy time on
|
|
* various CPUs in the previous window
|
|
*
|
|
* 'curr_window' represents the sum of all entries in curr_window_cpu
|
|
*
|
|
* 'prev_window' represents the sum of all entries in prev_window_cpu
|
|
*
|
|
* 'pred_demand' represents task's current predicted cpu busy time
|
|
*
|
|
* 'busy_buckets' groups historical busy time into different buckets
|
|
* used for prediction
|
|
*/
|
|
u64 mark_start;
|
|
u32 sum, demand;
|
|
u32 sum_history[RAVG_HIST_SIZE_MAX];
|
|
u32 *curr_window_cpu, *prev_window_cpu;
|
|
u32 curr_window, prev_window;
|
|
u64 curr_burst, avg_burst, avg_sleep_time;
|
|
u16 active_windows;
|
|
u32 pred_demand;
|
|
u8 busy_buckets[NUM_BUSY_BUCKETS];
|
|
};
|
|
|
|
struct sched_entity {
|
|
struct load_weight load; /* for load-balancing */
|
|
struct rb_node run_node;
|
|
struct list_head group_node;
|
|
unsigned int on_rq;
|
|
|
|
u64 exec_start;
|
|
u64 sum_exec_runtime;
|
|
u64 vruntime;
|
|
u64 prev_sum_exec_runtime;
|
|
|
|
u64 nr_migrations;
|
|
|
|
#ifdef CONFIG_SCHEDSTATS
|
|
struct sched_statistics statistics;
|
|
#endif
|
|
|
|
#ifdef CONFIG_FAIR_GROUP_SCHED
|
|
int depth;
|
|
struct sched_entity *parent;
|
|
/* rq on which this entity is (to be) queued: */
|
|
struct cfs_rq *cfs_rq;
|
|
/* rq "owned" by this entity/group: */
|
|
struct cfs_rq *my_q;
|
|
#endif
|
|
|
|
#ifdef CONFIG_SMP
|
|
/*
|
|
* Per entity load average tracking.
|
|
*
|
|
* Put into separate cache line so it does not
|
|
* collide with read-mostly values above.
|
|
*/
|
|
struct sched_avg avg ____cacheline_aligned_in_smp;
|
|
#endif
|
|
};
|
|
|
|
struct sched_rt_entity {
|
|
struct list_head run_list;
|
|
unsigned long timeout;
|
|
unsigned long watchdog_stamp;
|
|
unsigned int time_slice;
|
|
unsigned short on_rq;
|
|
unsigned short on_list;
|
|
|
|
struct sched_rt_entity *back;
|
|
#ifdef CONFIG_RT_GROUP_SCHED
|
|
struct sched_rt_entity *parent;
|
|
/* rq on which this entity is (to be) queued: */
|
|
struct rt_rq *rt_rq;
|
|
/* rq "owned" by this entity/group: */
|
|
struct rt_rq *my_q;
|
|
#endif
|
|
};
|
|
|
|
struct sched_dl_entity {
|
|
struct rb_node rb_node;
|
|
|
|
/*
|
|
* Original scheduling parameters. Copied here from sched_attr
|
|
* during sched_setattr(), they will remain the same until
|
|
* the next sched_setattr().
|
|
*/
|
|
u64 dl_runtime; /* maximum runtime for each instance */
|
|
u64 dl_deadline; /* relative deadline of each instance */
|
|
u64 dl_period; /* separation of two instances (period) */
|
|
u64 dl_bw; /* dl_runtime / dl_deadline */
|
|
|
|
/*
|
|
* Actual scheduling parameters. Initialized with the values above,
|
|
* they are continously updated during task execution. Note that
|
|
* the remaining runtime could be < 0 in case we are in overrun.
|
|
*/
|
|
s64 runtime; /* remaining runtime for this instance */
|
|
u64 deadline; /* absolute deadline for this instance */
|
|
unsigned int flags; /* specifying the scheduler behaviour */
|
|
|
|
/*
|
|
* Some bool flags:
|
|
*
|
|
* @dl_throttled tells if we exhausted the runtime. If so, the
|
|
* task has to wait for a replenishment to be performed at the
|
|
* next firing of dl_timer.
|
|
*
|
|
* @dl_boosted tells if we are boosted due to DI. If so we are
|
|
* outside bandwidth enforcement mechanism (but only until we
|
|
* exit the critical section);
|
|
*
|
|
* @dl_yielded tells if task gave up the cpu before consuming
|
|
* all its available runtime during the last job.
|
|
*/
|
|
int dl_throttled, dl_boosted, dl_yielded;
|
|
|
|
/*
|
|
* Bandwidth enforcement timer. Each -deadline task has its
|
|
* own bandwidth to be enforced, thus we need one timer per task.
|
|
*/
|
|
struct hrtimer dl_timer;
|
|
};
|
|
|
|
union rcu_special {
|
|
struct {
|
|
u8 blocked;
|
|
u8 need_qs;
|
|
u8 exp_need_qs;
|
|
u8 pad; /* Otherwise the compiler can store garbage here. */
|
|
} b; /* Bits. */
|
|
u32 s; /* Set of bits. */
|
|
};
|
|
struct rcu_node;
|
|
|
|
enum perf_event_task_context {
|
|
perf_invalid_context = -1,
|
|
perf_hw_context = 0,
|
|
perf_sw_context,
|
|
perf_nr_task_contexts,
|
|
};
|
|
|
|
/* Track pages that require TLB flushes */
|
|
struct tlbflush_unmap_batch {
|
|
/*
|
|
* Each bit set is a CPU that potentially has a TLB entry for one of
|
|
* the PFNs being flushed. See set_tlb_ubc_flush_pending().
|
|
*/
|
|
struct cpumask cpumask;
|
|
|
|
/* True if any bit in cpumask is set */
|
|
bool flush_required;
|
|
|
|
/*
|
|
* If true then the PTE was dirty when unmapped. The entry must be
|
|
* flushed before IO is initiated or a stale TLB entry potentially
|
|
* allows an update without redirtying the page.
|
|
*/
|
|
bool writable;
|
|
};
|
|
|
|
struct task_struct {
|
|
#ifdef CONFIG_THREAD_INFO_IN_TASK
|
|
/*
|
|
* For reasons of header soup (see current_thread_info()), this
|
|
* must be the first element of task_struct.
|
|
*/
|
|
struct thread_info thread_info;
|
|
#endif
|
|
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
|
|
void *stack;
|
|
atomic_t usage;
|
|
unsigned int flags; /* per process flags, defined below */
|
|
unsigned int ptrace;
|
|
|
|
#ifdef CONFIG_SMP
|
|
struct llist_node wake_entry;
|
|
int on_cpu;
|
|
#ifdef CONFIG_THREAD_INFO_IN_TASK
|
|
unsigned int cpu; /* current CPU */
|
|
#endif
|
|
unsigned int wakee_flips;
|
|
unsigned long wakee_flip_decay_ts;
|
|
struct task_struct *last_wakee;
|
|
|
|
int wake_cpu;
|
|
#endif
|
|
int on_rq;
|
|
|
|
int prio, static_prio, normal_prio;
|
|
unsigned int rt_priority;
|
|
const struct sched_class *sched_class;
|
|
struct sched_entity se;
|
|
struct sched_rt_entity rt;
|
|
#ifdef CONFIG_SCHED_HMP
|
|
struct ravg ravg;
|
|
/*
|
|
* 'init_load_pct' represents the initial task load assigned to children
|
|
* of this task
|
|
*/
|
|
u32 init_load_pct;
|
|
u64 last_wake_ts;
|
|
u64 last_switch_out_ts;
|
|
u64 last_cpu_selected_ts;
|
|
struct related_thread_group *grp;
|
|
struct list_head grp_list;
|
|
u64 cpu_cycles;
|
|
#endif
|
|
|
|
#ifdef CONFIG_CGROUP_SCHED
|
|
struct task_group *sched_task_group;
|
|
#endif
|
|
struct sched_dl_entity dl;
|
|
|
|
#ifdef CONFIG_PREEMPT_NOTIFIERS
|
|
/* list of struct preempt_notifier: */
|
|
struct hlist_head preempt_notifiers;
|
|
#endif
|
|
|
|
#ifdef CONFIG_BLK_DEV_IO_TRACE
|
|
unsigned int btrace_seq;
|
|
#endif
|
|
|
|
unsigned int policy;
|
|
int nr_cpus_allowed;
|
|
cpumask_t cpus_allowed;
|
|
|
|
#ifdef CONFIG_PREEMPT_RCU
|
|
int rcu_read_lock_nesting;
|
|
union rcu_special rcu_read_unlock_special;
|
|
struct list_head rcu_node_entry;
|
|
struct rcu_node *rcu_blocked_node;
|
|
#endif /* #ifdef CONFIG_PREEMPT_RCU */
|
|
#ifdef CONFIG_TASKS_RCU
|
|
unsigned long rcu_tasks_nvcsw;
|
|
bool rcu_tasks_holdout;
|
|
struct list_head rcu_tasks_holdout_list;
|
|
int rcu_tasks_idle_cpu;
|
|
#endif /* #ifdef CONFIG_TASKS_RCU */
|
|
|
|
#ifdef CONFIG_SCHED_INFO
|
|
struct sched_info sched_info;
|
|
#endif
|
|
|
|
struct list_head tasks;
|
|
#ifdef CONFIG_SMP
|
|
struct plist_node pushable_tasks;
|
|
struct rb_node pushable_dl_tasks;
|
|
#endif
|
|
|
|
struct mm_struct *mm, *active_mm;
|
|
/* per-thread vma caching */
|
|
u32 vmacache_seqnum;
|
|
struct vm_area_struct *vmacache[VMACACHE_SIZE];
|
|
#if defined(SPLIT_RSS_COUNTING)
|
|
struct task_rss_stat rss_stat;
|
|
#endif
|
|
/* task state */
|
|
int exit_state;
|
|
int exit_code, exit_signal;
|
|
int pdeath_signal; /* The signal sent when the parent dies */
|
|
unsigned long jobctl; /* JOBCTL_*, siglock protected */
|
|
|
|
/* Used for emulating ABI behavior of previous Linux versions */
|
|
unsigned int personality;
|
|
|
|
/* scheduler bits, serialized by scheduler locks */
|
|
unsigned sched_reset_on_fork:1;
|
|
unsigned sched_contributes_to_load:1;
|
|
unsigned sched_migrated:1;
|
|
unsigned sched_remote_wakeup:1;
|
|
unsigned :0; /* force alignment to the next boundary */
|
|
|
|
/* unserialized, strictly 'current' */
|
|
unsigned in_execve:1; /* bit to tell LSMs we're in execve */
|
|
unsigned in_iowait:1;
|
|
#if !defined(TIF_RESTORE_SIGMASK)
|
|
unsigned restore_sigmask:1;
|
|
#endif
|
|
#ifdef CONFIG_MEMCG
|
|
unsigned memcg_may_oom:1;
|
|
#ifndef CONFIG_SLOB
|
|
unsigned memcg_kmem_skip_account:1;
|
|
#endif
|
|
#endif
|
|
#ifdef CONFIG_COMPAT_BRK
|
|
unsigned brk_randomized:1;
|
|
#endif
|
|
|
|
unsigned long atomic_flags; /* Flags needing atomic access. */
|
|
|
|
struct restart_block restart_block;
|
|
|
|
pid_t pid;
|
|
pid_t tgid;
|
|
|
|
#ifdef CONFIG_CC_STACKPROTECTOR
|
|
/* Canary value for the -fstack-protector gcc feature */
|
|
unsigned long stack_canary;
|
|
#endif
|
|
/*
|
|
* pointers to (original) parent process, youngest child, younger sibling,
|
|
* older sibling, respectively. (p->father can be replaced with
|
|
* p->real_parent->pid)
|
|
*/
|
|
struct task_struct __rcu *real_parent; /* real parent process */
|
|
struct task_struct __rcu *parent; /* recipient of SIGCHLD, wait4() reports */
|
|
/*
|
|
* children/sibling forms the list of my natural children
|
|
*/
|
|
struct list_head children; /* list of my children */
|
|
struct list_head sibling; /* linkage in my parent's children list */
|
|
struct task_struct *group_leader; /* threadgroup leader */
|
|
|
|
/*
|
|
* ptraced is the list of tasks this task is using ptrace on.
|
|
* This includes both natural children and PTRACE_ATTACH targets.
|
|
* p->ptrace_entry is p's link on the p->parent->ptraced list.
|
|
*/
|
|
struct list_head ptraced;
|
|
struct list_head ptrace_entry;
|
|
|
|
/* PID/PID hash table linkage. */
|
|
struct pid_link pids[PIDTYPE_MAX];
|
|
struct list_head thread_group;
|
|
struct list_head thread_node;
|
|
|
|
struct completion *vfork_done; /* for vfork() */
|
|
int __user *set_child_tid; /* CLONE_CHILD_SETTID */
|
|
int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */
|
|
|
|
cputime_t utime, stime, utimescaled, stimescaled;
|
|
cputime_t gtime;
|
|
struct prev_cputime prev_cputime;
|
|
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
|
|
seqcount_t vtime_seqcount;
|
|
unsigned long long vtime_snap;
|
|
enum {
|
|
/* Task is sleeping or running in a CPU with VTIME inactive */
|
|
VTIME_INACTIVE = 0,
|
|
/* Task runs in userspace in a CPU with VTIME active */
|
|
VTIME_USER,
|
|
/* Task runs in kernelspace in a CPU with VTIME active */
|
|
VTIME_SYS,
|
|
} vtime_snap_whence;
|
|
#endif
|
|
|
|
#ifdef CONFIG_NO_HZ_FULL
|
|
atomic_t tick_dep_mask;
|
|
#endif
|
|
unsigned long nvcsw, nivcsw; /* context switch counts */
|
|
u64 start_time; /* monotonic time in nsec */
|
|
u64 real_start_time; /* boot based time in nsec */
|
|
/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
|
|
unsigned long min_flt, maj_flt;
|
|
|
|
struct task_cputime cputime_expires;
|
|
struct list_head cpu_timers[3];
|
|
|
|
/* process credentials */
|
|
const struct cred __rcu *ptracer_cred; /* Tracer's credentials at attach */
|
|
const struct cred __rcu *real_cred; /* objective and real subjective task
|
|
* credentials (COW) */
|
|
const struct cred __rcu *cred; /* effective (overridable) subjective task
|
|
* credentials (COW) */
|
|
char comm[TASK_COMM_LEN]; /* executable name excluding path
|
|
- access with [gs]et_task_comm (which lock
|
|
it with task_lock())
|
|
- initialized normally by setup_new_exec */
|
|
/* file system info */
|
|
struct nameidata *nameidata;
|
|
#ifdef CONFIG_SYSVIPC
|
|
/* ipc stuff */
|
|
struct sysv_sem sysvsem;
|
|
struct sysv_shm sysvshm;
|
|
#endif
|
|
#ifdef CONFIG_DETECT_HUNG_TASK
|
|
/* hung task detection */
|
|
unsigned long last_switch_count;
|
|
#endif
|
|
/* filesystem information */
|
|
struct fs_struct *fs;
|
|
/* open file information */
|
|
struct files_struct *files;
|
|
/* namespaces */
|
|
struct nsproxy *nsproxy;
|
|
/* signal handlers */
|
|
struct signal_struct *signal;
|
|
struct sighand_struct *sighand;
|
|
|
|
sigset_t blocked, real_blocked;
|
|
sigset_t saved_sigmask; /* restored if set_restore_sigmask() was used */
|
|
struct sigpending pending;
|
|
|
|
unsigned long sas_ss_sp;
|
|
size_t sas_ss_size;
|
|
unsigned sas_ss_flags;
|
|
|
|
struct callback_head *task_works;
|
|
|
|
struct audit_context *audit_context;
|
|
#ifdef CONFIG_AUDITSYSCALL
|
|
kuid_t loginuid;
|
|
unsigned int sessionid;
|
|
#endif
|
|
struct seccomp seccomp;
|
|
|
|
/* Thread group tracking */
|
|
u32 parent_exec_id;
|
|
u32 self_exec_id;
|
|
/* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed,
|
|
* mempolicy */
|
|
spinlock_t alloc_lock;
|
|
|
|
/* Protection of the PI data structures: */
|
|
raw_spinlock_t pi_lock;
|
|
|
|
struct wake_q_node wake_q;
|
|
|
|
#ifdef CONFIG_RT_MUTEXES
|
|
/* PI waiters blocked on a rt_mutex held by this task */
|
|
struct rb_root pi_waiters;
|
|
struct rb_node *pi_waiters_leftmost;
|
|
/* Deadlock detection and priority inheritance handling */
|
|
struct rt_mutex_waiter *pi_blocked_on;
|
|
#endif
|
|
|
|
#ifdef CONFIG_DEBUG_MUTEXES
|
|
/* mutex deadlock detection */
|
|
struct mutex_waiter *blocked_on;
|
|
#endif
|
|
#ifdef CONFIG_TRACE_IRQFLAGS
|
|
unsigned int irq_events;
|
|
unsigned long hardirq_enable_ip;
|
|
unsigned long hardirq_disable_ip;
|
|
unsigned int hardirq_enable_event;
|
|
unsigned int hardirq_disable_event;
|
|
int hardirqs_enabled;
|
|
int hardirq_context;
|
|
unsigned long softirq_disable_ip;
|
|
unsigned long softirq_enable_ip;
|
|
unsigned int softirq_disable_event;
|
|
unsigned int softirq_enable_event;
|
|
int softirqs_enabled;
|
|
int softirq_context;
|
|
#endif
|
|
#ifdef CONFIG_LOCKDEP
|
|
# define MAX_LOCK_DEPTH 48UL
|
|
u64 curr_chain_key;
|
|
int lockdep_depth;
|
|
unsigned int lockdep_recursion;
|
|
struct held_lock held_locks[MAX_LOCK_DEPTH];
|
|
gfp_t lockdep_reclaim_gfp;
|
|
#endif
|
|
#ifdef CONFIG_UBSAN
|
|
unsigned int in_ubsan;
|
|
#endif
|
|
|
|
/* journalling filesystem info */
|
|
void *journal_info;
|
|
|
|
/* stacked block device info */
|
|
struct bio_list *bio_list;
|
|
|
|
#ifdef CONFIG_BLOCK
|
|
/* stack plugging */
|
|
struct blk_plug *plug;
|
|
#endif
|
|
|
|
/* VM state */
|
|
struct reclaim_state *reclaim_state;
|
|
|
|
struct backing_dev_info *backing_dev_info;
|
|
|
|
struct io_context *io_context;
|
|
|
|
unsigned long ptrace_message;
|
|
siginfo_t *last_siginfo; /* For ptrace use. */
|
|
struct task_io_accounting ioac;
|
|
#if defined(CONFIG_TASK_XACCT)
|
|
u64 acct_rss_mem1; /* accumulated rss usage */
|
|
u64 acct_vm_mem1; /* accumulated virtual memory usage */
|
|
cputime_t acct_timexpd; /* stime + utime since last update */
|
|
#endif
|
|
#ifdef CONFIG_CPUSETS
|
|
nodemask_t mems_allowed; /* Protected by alloc_lock */
|
|
seqcount_t mems_allowed_seq; /* Seqence no to catch updates */
|
|
int cpuset_mem_spread_rotor;
|
|
int cpuset_slab_spread_rotor;
|
|
#endif
|
|
#ifdef CONFIG_CGROUPS
|
|
/* Control Group info protected by css_set_lock */
|
|
struct css_set __rcu *cgroups;
|
|
/* cg_list protected by css_set_lock and tsk->alloc_lock */
|
|
struct list_head cg_list;
|
|
#endif
|
|
#ifdef CONFIG_FUTEX
|
|
struct robust_list_head __user *robust_list;
|
|
#ifdef CONFIG_COMPAT
|
|
struct compat_robust_list_head __user *compat_robust_list;
|
|
#endif
|
|
struct list_head pi_state_list;
|
|
struct futex_pi_state *pi_state_cache;
|
|
#endif
|
|
#ifdef CONFIG_PERF_EVENTS
|
|
struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
|
|
struct mutex perf_event_mutex;
|
|
struct list_head perf_event_list;
|
|
#endif
|
|
#ifdef CONFIG_DEBUG_PREEMPT
|
|
unsigned long preempt_disable_ip;
|
|
#endif
|
|
#ifdef CONFIG_NUMA
|
|
struct mempolicy *mempolicy; /* Protected by alloc_lock */
|
|
short il_next;
|
|
short pref_node_fork;
|
|
#endif
|
|
#ifdef CONFIG_NUMA_BALANCING
|
|
int numa_scan_seq;
|
|
unsigned int numa_scan_period;
|
|
unsigned int numa_scan_period_max;
|
|
int numa_preferred_nid;
|
|
unsigned long numa_migrate_retry;
|
|
u64 node_stamp; /* migration stamp */
|
|
u64 last_task_numa_placement;
|
|
u64 last_sum_exec_runtime;
|
|
struct callback_head numa_work;
|
|
|
|
struct list_head numa_entry;
|
|
struct numa_group *numa_group;
|
|
|
|
/*
|
|
* numa_faults is an array split into four regions:
|
|
* faults_memory, faults_cpu, faults_memory_buffer, faults_cpu_buffer
|
|
* in this precise order.
|
|
*
|
|
* faults_memory: Exponential decaying average of faults on a per-node
|
|
* basis. Scheduling placement decisions are made based on these
|
|
* counts. The values remain static for the duration of a PTE scan.
|
|
* faults_cpu: Track the nodes the process was running on when a NUMA
|
|
* hinting fault was incurred.
|
|
* faults_memory_buffer and faults_cpu_buffer: Record faults per node
|
|
* during the current scan window. When the scan completes, the counts
|
|
* in faults_memory and faults_cpu decay and these values are copied.
|
|
*/
|
|
unsigned long *numa_faults;
|
|
unsigned long total_numa_faults;
|
|
|
|
/*
|
|
* numa_faults_locality tracks if faults recorded during the last
|
|
* scan window were remote/local or failed to migrate. The task scan
|
|
* period is adapted based on the locality of the faults with different
|
|
* weights depending on whether they were shared or private faults
|
|
*/
|
|
unsigned long numa_faults_locality[3];
|
|
|
|
unsigned long numa_pages_migrated;
|
|
#endif /* CONFIG_NUMA_BALANCING */
|
|
|
|
#ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
|
|
struct tlbflush_unmap_batch tlb_ubc;
|
|
#endif
|
|
|
|
struct rcu_head rcu;
|
|
|
|
/*
|
|
* cache last used pipe for splice
|
|
*/
|
|
struct pipe_inode_info *splice_pipe;
|
|
|
|
struct page_frag task_frag;
|
|
|
|
#ifdef CONFIG_TASK_DELAY_ACCT
|
|
struct task_delay_info *delays;
|
|
#endif
|
|
#ifdef CONFIG_FAULT_INJECTION
|
|
int make_it_fail;
|
|
#endif
|
|
/*
|
|
* when (nr_dirtied >= nr_dirtied_pause), it's time to call
|
|
* balance_dirty_pages() for some dirty throttling pause
|
|
*/
|
|
int nr_dirtied;
|
|
int nr_dirtied_pause;
|
|
unsigned long dirty_paused_when; /* start of a write-and-pause period */
|
|
|
|
#ifdef CONFIG_LATENCYTOP
|
|
int latency_record_count;
|
|
struct latency_record latency_record[LT_SAVECOUNT];
|
|
#endif
|
|
/*
|
|
* time slack values; these are used to round up poll() and
|
|
* select() etc timeout values. These are in nanoseconds.
|
|
*/
|
|
u64 timer_slack_ns;
|
|
u64 default_timer_slack_ns;
|
|
|
|
#ifdef CONFIG_KASAN
|
|
unsigned int kasan_depth;
|
|
#endif
|
|
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
|
/* Index of current stored address in ret_stack */
|
|
int curr_ret_stack;
|
|
/* Stack of return addresses for return function tracing */
|
|
struct ftrace_ret_stack *ret_stack;
|
|
/* time stamp for last schedule */
|
|
unsigned long long ftrace_timestamp;
|
|
/*
|
|
* Number of functions that haven't been traced
|
|
* because of depth overrun.
|
|
*/
|
|
atomic_t trace_overrun;
|
|
/* Pause for the tracing */
|
|
atomic_t tracing_graph_pause;
|
|
#endif
|
|
#ifdef CONFIG_TRACING
|
|
/* state flags for use by tracers */
|
|
unsigned long trace;
|
|
/* bitmask and counter of trace recursion */
|
|
unsigned long trace_recursion;
|
|
#endif /* CONFIG_TRACING */
|
|
#ifdef CONFIG_KCOV
|
|
/* Coverage collection mode enabled for this task (0 if disabled). */
|
|
enum kcov_mode kcov_mode;
|
|
/* Size of the kcov_area. */
|
|
unsigned kcov_size;
|
|
/* Buffer for coverage collection. */
|
|
void *kcov_area;
|
|
/* kcov desciptor wired with this task or NULL. */
|
|
struct kcov *kcov;
|
|
#endif
|
|
#ifdef CONFIG_MEMCG
|
|
struct mem_cgroup *memcg_in_oom;
|
|
gfp_t memcg_oom_gfp_mask;
|
|
int memcg_oom_order;
|
|
|
|
/* number of pages to reclaim on returning to userland */
|
|
unsigned int memcg_nr_pages_over_high;
|
|
#endif
|
|
#ifdef CONFIG_UPROBES
|
|
struct uprobe_task *utask;
|
|
#endif
|
|
#if defined(CONFIG_BCACHE) || defined(CONFIG_BCACHE_MODULE)
|
|
unsigned int sequential_io;
|
|
unsigned int sequential_io_avg;
|
|
#endif
|
|
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
|
|
unsigned long task_state_change;
|
|
#endif
|
|
int pagefault_disabled;
|
|
#ifdef CONFIG_MMU
|
|
struct task_struct *oom_reaper_list;
|
|
#endif
|
|
#ifdef CONFIG_VMAP_STACK
|
|
struct vm_struct *stack_vm_area;
|
|
#endif
|
|
#ifdef CONFIG_THREAD_INFO_IN_TASK
|
|
/* A live task holds one reference. */
|
|
atomic_t stack_refcount;
|
|
#endif
|
|
/* CPU-specific state of this task */
|
|
struct thread_struct thread;
|
|
/*
|
|
* WARNING: on x86, 'thread_struct' contains a variable-sized
|
|
* structure. It *MUST* be at the end of 'task_struct'.
|
|
*
|
|
* Do not put anything below here!
|
|
*/
|
|
};
|
|
|
|
#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
|
|
|
|
#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
|
|
|
|
/* Future-safe accessor for struct task_struct's cpus_allowed. */
|
|
#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
|
|
|
|
static inline int tsk_nr_cpus_allowed(struct task_struct *p)
|
|
{
|
|
return p->nr_cpus_allowed;
|
|
}
|
|
|
|
#define TNF_MIGRATED 0x01
|
|
#define TNF_NO_GROUP 0x02
|
|
#define TNF_SHARED 0x04
|
|
#define TNF_FAULT_LOCAL 0x08
|
|
#define TNF_MIGRATE_FAIL 0x10
|
|
|
|
static inline bool in_vfork(struct task_struct *tsk)
|
|
{
|
|
bool ret;
|
|
|
|
/*
|
|
* need RCU to access ->real_parent if CLONE_VM was used along with
|
|
* CLONE_PARENT.
|
|
*
|
|
* We check real_parent->mm == tsk->mm because CLONE_VFORK does not
|
|
* imply CLONE_VM
|
|
*
|
|
* CLONE_VFORK can be used with CLONE_PARENT/CLONE_THREAD and thus
|
|
* ->real_parent is not necessarily the task doing vfork(), so in
|
|
* theory we can't rely on task_lock() if we want to dereference it.
|
|
*
|
|
* And in this case we can't trust the real_parent->mm == tsk->mm
|
|
* check, it can be false negative. But we do not care, if init or
|
|
* another oom-unkillable task does this it should blame itself.
|
|
*/
|
|
rcu_read_lock();
|
|
ret = tsk->vfork_done && tsk->real_parent->mm == tsk->mm;
|
|
rcu_read_unlock();
|
|
|
|
return ret;
|
|
}
|
|
|
|
#ifdef CONFIG_NUMA_BALANCING
|
|
extern void task_numa_fault(int last_node, int node, int pages, int flags);
|
|
extern pid_t task_numa_group_id(struct task_struct *p);
|
|
extern void set_numabalancing_state(bool enabled);
|
|
extern void task_numa_free(struct task_struct *p);
|
|
extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page,
|
|
int src_nid, int dst_cpu);
|
|
#else
|
|
static inline void task_numa_fault(int last_node, int node, int pages,
|
|
int flags)
|
|
{
|
|
}
|
|
static inline pid_t task_numa_group_id(struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void set_numabalancing_state(bool enabled)
|
|
{
|
|
}
|
|
static inline void task_numa_free(struct task_struct *p)
|
|
{
|
|
}
|
|
static inline bool should_numa_migrate_memory(struct task_struct *p,
|
|
struct page *page, int src_nid, int dst_cpu)
|
|
{
|
|
return true;
|
|
}
|
|
#endif
|
|
|
|
static inline struct pid *task_pid(struct task_struct *task)
|
|
{
|
|
return task->pids[PIDTYPE_PID].pid;
|
|
}
|
|
|
|
static inline struct pid *task_tgid(struct task_struct *task)
|
|
{
|
|
return task->group_leader->pids[PIDTYPE_PID].pid;
|
|
}
|
|
|
|
/*
|
|
* Without tasklist or rcu lock it is not safe to dereference
|
|
* the result of task_pgrp/task_session even if task == current,
|
|
* we can race with another thread doing sys_setsid/sys_setpgid.
|
|
*/
|
|
static inline struct pid *task_pgrp(struct task_struct *task)
|
|
{
|
|
return task->group_leader->pids[PIDTYPE_PGID].pid;
|
|
}
|
|
|
|
static inline struct pid *task_session(struct task_struct *task)
|
|
{
|
|
return task->group_leader->pids[PIDTYPE_SID].pid;
|
|
}
|
|
|
|
struct pid_namespace;
|
|
|
|
/*
|
|
* the helpers to get the task's different pids as they are seen
|
|
* from various namespaces
|
|
*
|
|
* task_xid_nr() : global id, i.e. the id seen from the init namespace;
|
|
* task_xid_vnr() : virtual id, i.e. the id seen from the pid namespace of
|
|
* current.
|
|
* task_xid_nr_ns() : id seen from the ns specified;
|
|
*
|
|
* set_task_vxid() : assigns a virtual id to a task;
|
|
*
|
|
* see also pid_nr() etc in include/linux/pid.h
|
|
*/
|
|
pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
|
|
struct pid_namespace *ns);
|
|
|
|
static inline pid_t task_pid_nr(struct task_struct *tsk)
|
|
{
|
|
return tsk->pid;
|
|
}
|
|
|
|
static inline pid_t task_pid_nr_ns(struct task_struct *tsk,
|
|
struct pid_namespace *ns)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns);
|
|
}
|
|
|
|
static inline pid_t task_pid_vnr(struct task_struct *tsk)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_PID, NULL);
|
|
}
|
|
|
|
|
|
static inline pid_t task_tgid_nr(struct task_struct *tsk)
|
|
{
|
|
return tsk->tgid;
|
|
}
|
|
|
|
static inline int pid_alive(const struct task_struct *p);
|
|
static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns);
|
|
static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
|
|
{
|
|
pid_t pid = 0;
|
|
|
|
rcu_read_lock();
|
|
if (pid_alive(tsk))
|
|
pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns);
|
|
rcu_read_unlock();
|
|
|
|
return pid;
|
|
}
|
|
|
|
static inline pid_t task_ppid_nr(const struct task_struct *tsk)
|
|
{
|
|
return task_ppid_nr_ns(tsk, &init_pid_ns);
|
|
}
|
|
|
|
static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk,
|
|
struct pid_namespace *ns)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns);
|
|
}
|
|
|
|
static inline pid_t task_pgrp_vnr(struct task_struct *tsk)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_PGID, NULL);
|
|
}
|
|
|
|
|
|
static inline pid_t task_session_nr_ns(struct task_struct *tsk,
|
|
struct pid_namespace *ns)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_SID, ns);
|
|
}
|
|
|
|
static inline pid_t task_session_vnr(struct task_struct *tsk)
|
|
{
|
|
return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL);
|
|
}
|
|
|
|
static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
|
|
{
|
|
return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ns);
|
|
}
|
|
|
|
static inline pid_t task_tgid_vnr(struct task_struct *tsk)
|
|
{
|
|
return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, NULL);
|
|
}
|
|
|
|
/* obsolete, do not use */
|
|
static inline pid_t task_pgrp_nr(struct task_struct *tsk)
|
|
{
|
|
return task_pgrp_nr_ns(tsk, &init_pid_ns);
|
|
}
|
|
|
|
/**
|
|
* pid_alive - check that a task structure is not stale
|
|
* @p: Task structure to be checked.
|
|
*
|
|
* Test if a process is not yet dead (at most zombie state)
|
|
* If pid_alive fails, then pointers within the task structure
|
|
* can be stale and must not be dereferenced.
|
|
*
|
|
* Return: 1 if the process is alive. 0 otherwise.
|
|
*/
|
|
static inline int pid_alive(const struct task_struct *p)
|
|
{
|
|
return p->pids[PIDTYPE_PID].pid != NULL;
|
|
}
|
|
|
|
/**
|
|
* is_global_init - check if a task structure is init. Since init
|
|
* is free to have sub-threads we need to check tgid.
|
|
* @tsk: Task structure to be checked.
|
|
*
|
|
* Check if a task structure is the first user space task the kernel created.
|
|
*
|
|
* Return: 1 if the task structure is init. 0 otherwise.
|
|
*/
|
|
static inline int is_global_init(struct task_struct *tsk)
|
|
{
|
|
return task_tgid_nr(tsk) == 1;
|
|
}
|
|
|
|
extern struct pid *cad_pid;
|
|
|
|
extern void free_task(struct task_struct *tsk);
|
|
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
|
|
|
|
extern void __put_task_struct(struct task_struct *t);
|
|
|
|
static inline void put_task_struct(struct task_struct *t)
|
|
{
|
|
if (atomic_dec_and_test(&t->usage))
|
|
__put_task_struct(t);
|
|
}
|
|
|
|
struct task_struct *task_rcu_dereference(struct task_struct **ptask);
|
|
struct task_struct *try_get_task_struct(struct task_struct **ptask);
|
|
|
|
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
|
|
extern void task_cputime(struct task_struct *t,
|
|
cputime_t *utime, cputime_t *stime);
|
|
extern void task_cputime_scaled(struct task_struct *t,
|
|
cputime_t *utimescaled, cputime_t *stimescaled);
|
|
extern cputime_t task_gtime(struct task_struct *t);
|
|
#else
|
|
static inline void task_cputime(struct task_struct *t,
|
|
cputime_t *utime, cputime_t *stime)
|
|
{
|
|
if (utime)
|
|
*utime = t->utime;
|
|
if (stime)
|
|
*stime = t->stime;
|
|
}
|
|
|
|
static inline void task_cputime_scaled(struct task_struct *t,
|
|
cputime_t *utimescaled,
|
|
cputime_t *stimescaled)
|
|
{
|
|
if (utimescaled)
|
|
*utimescaled = t->utimescaled;
|
|
if (stimescaled)
|
|
*stimescaled = t->stimescaled;
|
|
}
|
|
|
|
static inline cputime_t task_gtime(struct task_struct *t)
|
|
{
|
|
return t->gtime;
|
|
}
|
|
#endif
|
|
extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
|
|
extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
|
|
|
|
/*
|
|
* Per process flags
|
|
*/
|
|
#define PF_WAKE_UP_IDLE 0x00000002 /* try to wake up on an idle CPU */
|
|
#define PF_EXITING 0x00000004 /* getting shut down */
|
|
#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
|
|
#define PF_VCPU 0x00000010 /* I'm a virtual CPU */
|
|
#define PF_WQ_WORKER 0x00000020 /* I'm a workqueue worker */
|
|
#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
|
|
#define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */
|
|
#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
|
|
#define PF_DUMPCORE 0x00000200 /* dumped core */
|
|
#define PF_SIGNALED 0x00000400 /* killed by a signal */
|
|
#define PF_MEMALLOC 0x00000800 /* Allocating memory */
|
|
#define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */
|
|
#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
|
|
#define PF_USED_ASYNC 0x00004000 /* used async_schedule*(), used by module init */
|
|
#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
|
|
#define PF_FROZEN 0x00010000 /* frozen for system suspend */
|
|
#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
|
|
#define PF_KSWAPD 0x00040000 /* I am kswapd */
|
|
#define PF_MEMALLOC_NOIO 0x00080000 /* Allocating memory without IO involved */
|
|
#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
|
|
#define PF_KTHREAD 0x00200000 /* I am a kernel thread */
|
|
#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
|
|
#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */
|
|
#define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */
|
|
#define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */
|
|
#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
|
|
#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */
|
|
#define PF_SUSPEND_TASK 0x80000000 /* this thread called freeze_processes and should not be frozen */
|
|
|
|
/*
|
|
* Only the _current_ task can read/write to tsk->flags, but other
|
|
* tasks can access tsk->flags in readonly mode for example
|
|
* with tsk_used_math (like during threaded core dumping).
|
|
* There is however an exception to this rule during ptrace
|
|
* or during fork: the ptracer task is allowed to write to the
|
|
* child->flags of its traced child (same goes for fork, the parent
|
|
* can write to the child->flags), because we're guaranteed the
|
|
* child is not running and in turn not changing child->flags
|
|
* at the same time the parent does it.
|
|
*/
|
|
#define clear_stopped_child_used_math(child) do { (child)->flags &= ~PF_USED_MATH; } while (0)
|
|
#define set_stopped_child_used_math(child) do { (child)->flags |= PF_USED_MATH; } while (0)
|
|
#define clear_used_math() clear_stopped_child_used_math(current)
|
|
#define set_used_math() set_stopped_child_used_math(current)
|
|
#define conditional_stopped_child_used_math(condition, child) \
|
|
do { (child)->flags &= ~PF_USED_MATH, (child)->flags |= (condition) ? PF_USED_MATH : 0; } while (0)
|
|
#define conditional_used_math(condition) \
|
|
conditional_stopped_child_used_math(condition, current)
|
|
#define copy_to_stopped_child_used_math(child) \
|
|
do { (child)->flags &= ~PF_USED_MATH, (child)->flags |= current->flags & PF_USED_MATH; } while (0)
|
|
/* NOTE: this will return 0 or PF_USED_MATH, it will never return 1 */
|
|
#define tsk_used_math(p) ((p)->flags & PF_USED_MATH)
|
|
#define used_math() tsk_used_math(current)
|
|
|
|
/* __GFP_IO isn't allowed if PF_MEMALLOC_NOIO is set in current->flags
|
|
* __GFP_FS is also cleared as it implies __GFP_IO.
|
|
*/
|
|
static inline gfp_t memalloc_noio_flags(gfp_t flags)
|
|
{
|
|
if (unlikely(current->flags & PF_MEMALLOC_NOIO))
|
|
flags &= ~(__GFP_IO | __GFP_FS);
|
|
return flags;
|
|
}
|
|
|
|
static inline unsigned int memalloc_noio_save(void)
|
|
{
|
|
unsigned int flags = current->flags & PF_MEMALLOC_NOIO;
|
|
current->flags |= PF_MEMALLOC_NOIO;
|
|
return flags;
|
|
}
|
|
|
|
static inline void memalloc_noio_restore(unsigned int flags)
|
|
{
|
|
current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags;
|
|
}
|
|
|
|
/* Per-process atomic flags. */
|
|
#define PFA_NO_NEW_PRIVS 0 /* May not gain new privileges. */
|
|
#define PFA_SPREAD_PAGE 1 /* Spread page cache over cpuset */
|
|
#define PFA_SPREAD_SLAB 2 /* Spread some slab caches over cpuset */
|
|
#define PFA_LMK_WAITING 3 /* Lowmemorykiller is waiting */
|
|
|
|
|
|
#define TASK_PFA_TEST(name, func) \
|
|
static inline bool task_##func(struct task_struct *p) \
|
|
{ return test_bit(PFA_##name, &p->atomic_flags); }
|
|
#define TASK_PFA_SET(name, func) \
|
|
static inline void task_set_##func(struct task_struct *p) \
|
|
{ set_bit(PFA_##name, &p->atomic_flags); }
|
|
#define TASK_PFA_CLEAR(name, func) \
|
|
static inline void task_clear_##func(struct task_struct *p) \
|
|
{ clear_bit(PFA_##name, &p->atomic_flags); }
|
|
|
|
TASK_PFA_TEST(NO_NEW_PRIVS, no_new_privs)
|
|
TASK_PFA_SET(NO_NEW_PRIVS, no_new_privs)
|
|
|
|
TASK_PFA_TEST(SPREAD_PAGE, spread_page)
|
|
TASK_PFA_SET(SPREAD_PAGE, spread_page)
|
|
TASK_PFA_CLEAR(SPREAD_PAGE, spread_page)
|
|
|
|
TASK_PFA_TEST(SPREAD_SLAB, spread_slab)
|
|
TASK_PFA_SET(SPREAD_SLAB, spread_slab)
|
|
TASK_PFA_CLEAR(SPREAD_SLAB, spread_slab)
|
|
|
|
TASK_PFA_TEST(LMK_WAITING, lmk_waiting)
|
|
TASK_PFA_SET(LMK_WAITING, lmk_waiting)
|
|
|
|
/*
|
|
* task->jobctl flags
|
|
*/
|
|
#define JOBCTL_STOP_SIGMASK 0xffff /* signr of the last group stop */
|
|
|
|
#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_TRAP_STOP_BIT 19 /* trap for STOP */
|
|
#define JOBCTL_TRAP_NOTIFY_BIT 20 /* trap for NOTIFY */
|
|
#define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */
|
|
#define JOBCTL_LISTENING_BIT 22 /* ptracer is listening for events */
|
|
|
|
#define JOBCTL_STOP_DEQUEUED (1UL << JOBCTL_STOP_DEQUEUED_BIT)
|
|
#define JOBCTL_STOP_PENDING (1UL << JOBCTL_STOP_PENDING_BIT)
|
|
#define JOBCTL_STOP_CONSUME (1UL << JOBCTL_STOP_CONSUME_BIT)
|
|
#define JOBCTL_TRAP_STOP (1UL << JOBCTL_TRAP_STOP_BIT)
|
|
#define JOBCTL_TRAP_NOTIFY (1UL << JOBCTL_TRAP_NOTIFY_BIT)
|
|
#define JOBCTL_TRAPPING (1UL << JOBCTL_TRAPPING_BIT)
|
|
#define JOBCTL_LISTENING (1UL << JOBCTL_LISTENING_BIT)
|
|
|
|
#define JOBCTL_TRAP_MASK (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY)
|
|
#define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK)
|
|
|
|
extern bool task_set_jobctl_pending(struct task_struct *task,
|
|
unsigned long mask);
|
|
extern void task_clear_jobctl_trapping(struct task_struct *task);
|
|
extern void task_clear_jobctl_pending(struct task_struct *task,
|
|
unsigned long mask);
|
|
|
|
static inline void rcu_copy_process(struct task_struct *p)
|
|
{
|
|
#ifdef CONFIG_PREEMPT_RCU
|
|
p->rcu_read_lock_nesting = 0;
|
|
p->rcu_read_unlock_special.s = 0;
|
|
p->rcu_blocked_node = NULL;
|
|
INIT_LIST_HEAD(&p->rcu_node_entry);
|
|
#endif /* #ifdef CONFIG_PREEMPT_RCU */
|
|
#ifdef CONFIG_TASKS_RCU
|
|
p->rcu_tasks_holdout = false;
|
|
INIT_LIST_HEAD(&p->rcu_tasks_holdout_list);
|
|
p->rcu_tasks_idle_cpu = -1;
|
|
#endif /* #ifdef CONFIG_TASKS_RCU */
|
|
}
|
|
|
|
static inline void tsk_restore_flags(struct task_struct *task,
|
|
unsigned long orig_flags, unsigned long flags)
|
|
{
|
|
task->flags &= ~flags;
|
|
task->flags |= orig_flags & flags;
|
|
}
|
|
|
|
extern int cpuset_cpumask_can_shrink(const struct cpumask *cur,
|
|
const struct cpumask *trial);
|
|
extern int task_can_attach(struct task_struct *p,
|
|
const struct cpumask *cs_cpus_allowed);
|
|
#ifdef CONFIG_SMP
|
|
extern void do_set_cpus_allowed(struct task_struct *p,
|
|
const struct cpumask *new_mask);
|
|
|
|
extern int set_cpus_allowed_ptr(struct task_struct *p,
|
|
const struct cpumask *new_mask);
|
|
#else
|
|
static inline void do_set_cpus_allowed(struct task_struct *p,
|
|
const struct cpumask *new_mask)
|
|
{
|
|
}
|
|
static inline int set_cpus_allowed_ptr(struct task_struct *p,
|
|
const struct cpumask *new_mask)
|
|
{
|
|
if (!cpumask_test_cpu(0, new_mask))
|
|
return -EINVAL;
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
struct sched_load {
|
|
unsigned long prev_load;
|
|
unsigned long new_task_load;
|
|
unsigned long predicted_load;
|
|
};
|
|
|
|
extern int sched_set_wake_up_idle(struct task_struct *p, int wake_up_idle);
|
|
extern u32 sched_get_wake_up_idle(struct task_struct *p);
|
|
|
|
struct cpu_cycle_counter_cb {
|
|
u64 (*get_cpu_cycle_counter)(int cpu);
|
|
};
|
|
|
|
#define MAX_NUM_CGROUP_COLOC_ID 20
|
|
|
|
#ifdef CONFIG_SCHED_HMP
|
|
extern void free_task_load_ptrs(struct task_struct *p);
|
|
extern int sched_set_window(u64 window_start, unsigned int window_size);
|
|
extern unsigned long sched_get_busy(int cpu);
|
|
extern void sched_get_cpus_busy(struct sched_load *busy,
|
|
const struct cpumask *query_cpus);
|
|
extern void sched_set_io_is_busy(int val);
|
|
extern int sched_set_boost(int enable);
|
|
extern int sched_set_init_task_load(struct task_struct *p, int init_load_pct);
|
|
extern u32 sched_get_init_task_load(struct task_struct *p);
|
|
extern int sched_set_static_cpu_pwr_cost(int cpu, unsigned int cost);
|
|
extern unsigned int sched_get_static_cpu_pwr_cost(int cpu);
|
|
extern int sched_set_static_cluster_pwr_cost(int cpu, unsigned int cost);
|
|
extern unsigned int sched_get_static_cluster_pwr_cost(int cpu);
|
|
extern int sched_set_cluster_wake_idle(int cpu, unsigned int wake_idle);
|
|
extern unsigned int sched_get_cluster_wake_idle(int cpu);
|
|
extern int sched_update_freq_max_load(const cpumask_t *cpumask);
|
|
extern void sched_update_cpu_freq_min_max(const cpumask_t *cpus,
|
|
u32 fmin, u32 fmax);
|
|
extern void sched_set_cpu_cstate(int cpu, int cstate,
|
|
int wakeup_energy, int wakeup_latency);
|
|
extern void sched_set_cluster_dstate(const cpumask_t *cluster_cpus, int dstate,
|
|
int wakeup_energy, int wakeup_latency);
|
|
extern int register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb);
|
|
extern u64 sched_ktime_clock(void);
|
|
extern int sched_set_group_id(struct task_struct *p, unsigned int group_id);
|
|
extern unsigned int sched_get_group_id(struct task_struct *p);
|
|
|
|
#else /* CONFIG_SCHED_HMP */
|
|
static inline void free_task_load_ptrs(struct task_struct *p) { }
|
|
|
|
static inline u64 sched_ktime_clock(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int
|
|
register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int sched_set_window(u64 window_start, unsigned int window_size)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
static inline unsigned long sched_get_busy(int cpu)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void sched_get_cpus_busy(struct sched_load *busy,
|
|
const struct cpumask *query_cpus) {};
|
|
|
|
static inline void sched_set_io_is_busy(int val) {};
|
|
|
|
static inline int sched_set_boost(int enable)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int sched_update_freq_max_load(const cpumask_t *cpumask)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void sched_update_cpu_freq_min_max(const cpumask_t *cpus,
|
|
u32 fmin, u32 fmax) { }
|
|
|
|
static inline void
|
|
sched_set_cpu_cstate(int cpu, int cstate, int wakeup_energy, int wakeup_latency)
|
|
{
|
|
}
|
|
|
|
static inline void sched_set_cluster_dstate(const cpumask_t *cluster_cpus,
|
|
int dstate, int wakeup_energy, int wakeup_latency)
|
|
{
|
|
}
|
|
#endif /* CONFIG_SCHED_HMP */
|
|
|
|
#ifdef CONFIG_NO_HZ_COMMON
|
|
void calc_load_enter_idle(void);
|
|
void calc_load_exit_idle(void);
|
|
#else
|
|
static inline void calc_load_enter_idle(void) { }
|
|
static inline void calc_load_exit_idle(void) { }
|
|
#endif /* CONFIG_NO_HZ_COMMON */
|
|
|
|
static inline void set_wake_up_idle(bool enabled)
|
|
{
|
|
if (enabled)
|
|
current->flags |= PF_WAKE_UP_IDLE;
|
|
else
|
|
current->flags &= ~PF_WAKE_UP_IDLE;
|
|
}
|
|
|
|
/*
|
|
* Do not use outside of architecture code which knows its limitations.
|
|
*
|
|
* sched_clock() has no promise of monotonicity or bounded drift between
|
|
* CPUs, use (which you should not) requires disabling IRQs.
|
|
*
|
|
* Please use one of the three interfaces below.
|
|
*/
|
|
extern unsigned long long notrace sched_clock(void);
|
|
/*
|
|
* See the comment in kernel/sched/clock.c
|
|
*/
|
|
extern u64 running_clock(void);
|
|
extern u64 sched_clock_cpu(int cpu);
|
|
|
|
|
|
extern void sched_clock_init(void);
|
|
extern int sched_clock_initialized(void);
|
|
|
|
#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
|
|
static inline void sched_clock_tick(void)
|
|
{
|
|
}
|
|
|
|
static inline void sched_clock_idle_sleep_event(void)
|
|
{
|
|
}
|
|
|
|
static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
|
|
{
|
|
}
|
|
|
|
static inline u64 cpu_clock(int cpu)
|
|
{
|
|
return sched_clock();
|
|
}
|
|
|
|
static inline u64 local_clock(void)
|
|
{
|
|
return sched_clock();
|
|
}
|
|
#else
|
|
/*
|
|
* Architectures can set this to 1 if they have specified
|
|
* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK in their arch Kconfig,
|
|
* but then during bootup it turns out that sched_clock()
|
|
* is reliable after all:
|
|
*/
|
|
extern int sched_clock_stable(void);
|
|
extern void set_sched_clock_stable(void);
|
|
extern void clear_sched_clock_stable(void);
|
|
|
|
extern void sched_clock_tick(void);
|
|
extern void sched_clock_idle_sleep_event(void);
|
|
extern void sched_clock_idle_wakeup_event(u64 delta_ns);
|
|
|
|
/*
|
|
* As outlined in clock.c, provides a fast, high resolution, nanosecond
|
|
* time source that is monotonic per cpu argument and has bounded drift
|
|
* between cpus.
|
|
*
|
|
* ######################### BIG FAT WARNING ##########################
|
|
* # when comparing cpu_clock(i) to cpu_clock(j) for i != j, time can #
|
|
* # go backwards !! #
|
|
* ####################################################################
|
|
*/
|
|
static inline u64 cpu_clock(int cpu)
|
|
{
|
|
return sched_clock_cpu(cpu);
|
|
}
|
|
|
|
static inline u64 local_clock(void)
|
|
{
|
|
return sched_clock_cpu(raw_smp_processor_id());
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
|
/*
|
|
* An i/f to runtime opt-in for irq time accounting based off of sched_clock.
|
|
* The reason for this explicit opt-in is not to have perf penalty with
|
|
* slow sched_clocks.
|
|
*/
|
|
extern void enable_sched_clock_irqtime(void);
|
|
extern void disable_sched_clock_irqtime(void);
|
|
#else
|
|
static inline void enable_sched_clock_irqtime(void) {}
|
|
static inline void disable_sched_clock_irqtime(void) {}
|
|
#endif
|
|
|
|
extern unsigned long long
|
|
task_sched_runtime(struct task_struct *task);
|
|
|
|
/* sched_exec is called by processes performing an exec */
|
|
#if defined(CONFIG_SMP) && !defined(CONFIG_SCHED_HMP)
|
|
extern void sched_exec(void);
|
|
#else
|
|
#define sched_exec() {}
|
|
#endif
|
|
|
|
extern void sched_clock_idle_sleep_event(void);
|
|
extern void sched_clock_idle_wakeup_event(u64 delta_ns);
|
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
extern void idle_task_exit(void);
|
|
#else
|
|
static inline void idle_task_exit(void) {}
|
|
#endif
|
|
|
|
#if defined(CONFIG_NO_HZ_COMMON) && defined(CONFIG_SMP)
|
|
extern void wake_up_nohz_cpu(int cpu);
|
|
#else
|
|
static inline void wake_up_nohz_cpu(int cpu) { }
|
|
#endif
|
|
|
|
#ifdef CONFIG_NO_HZ_FULL
|
|
extern u64 scheduler_tick_max_deferment(void);
|
|
#endif
|
|
|
|
#ifdef CONFIG_SCHED_AUTOGROUP
|
|
extern void sched_autogroup_create_attach(struct task_struct *p);
|
|
extern void sched_autogroup_detach(struct task_struct *p);
|
|
extern void sched_autogroup_fork(struct signal_struct *sig);
|
|
extern void sched_autogroup_exit(struct signal_struct *sig);
|
|
extern void sched_autogroup_exit_task(struct task_struct *p);
|
|
#ifdef CONFIG_PROC_FS
|
|
extern void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m);
|
|
extern int proc_sched_autogroup_set_nice(struct task_struct *p, int nice);
|
|
#endif
|
|
#else
|
|
static inline void sched_autogroup_create_attach(struct task_struct *p) { }
|
|
static inline void sched_autogroup_detach(struct task_struct *p) { }
|
|
static inline void sched_autogroup_fork(struct signal_struct *sig) { }
|
|
static inline void sched_autogroup_exit(struct signal_struct *sig) { }
|
|
static inline void sched_autogroup_exit_task(struct task_struct *p) { }
|
|
#endif
|
|
|
|
extern int yield_to(struct task_struct *p, bool preempt);
|
|
extern void set_user_nice(struct task_struct *p, long nice);
|
|
extern int task_prio(const struct task_struct *p);
|
|
/**
|
|
* task_nice - return the nice value of a given task.
|
|
* @p: the task in question.
|
|
*
|
|
* Return: The nice value [ -20 ... 0 ... 19 ].
|
|
*/
|
|
static inline int task_nice(const struct task_struct *p)
|
|
{
|
|
return PRIO_TO_NICE((p)->static_prio);
|
|
}
|
|
extern int can_nice(const struct task_struct *p, const int nice);
|
|
extern int task_curr(const struct task_struct *p);
|
|
extern int idle_cpu(int cpu);
|
|
extern int sched_setscheduler(struct task_struct *, int,
|
|
const struct sched_param *);
|
|
extern int sched_setscheduler_nocheck(struct task_struct *, int,
|
|
const struct sched_param *);
|
|
extern int sched_setattr(struct task_struct *,
|
|
const struct sched_attr *);
|
|
extern struct task_struct *idle_task(int cpu);
|
|
/**
|
|
* is_idle_task - is the specified task an idle task?
|
|
* @p: the task in question.
|
|
*
|
|
* Return: 1 if @p is an idle task. 0 otherwise.
|
|
*/
|
|
static inline bool is_idle_task(const struct task_struct *p)
|
|
{
|
|
return p->pid == 0;
|
|
}
|
|
extern struct task_struct *curr_task(int cpu);
|
|
extern void ia64_set_curr_task(int cpu, struct task_struct *p);
|
|
|
|
void yield(void);
|
|
|
|
union thread_union {
|
|
#ifndef CONFIG_THREAD_INFO_IN_TASK
|
|
struct thread_info thread_info;
|
|
#endif
|
|
unsigned long stack[THREAD_SIZE/sizeof(long)];
|
|
};
|
|
|
|
#ifndef __HAVE_ARCH_KSTACK_END
|
|
static inline int kstack_end(void *addr)
|
|
{
|
|
/* Reliable end of stack detection:
|
|
* Some APM bios versions misalign the stack
|
|
*/
|
|
return !(((unsigned long)addr+sizeof(void*)-1) & (THREAD_SIZE-sizeof(void*)));
|
|
}
|
|
#endif
|
|
|
|
extern union thread_union init_thread_union;
|
|
extern struct task_struct init_task;
|
|
|
|
extern struct mm_struct init_mm;
|
|
|
|
extern struct pid_namespace init_pid_ns;
|
|
|
|
/*
|
|
* find a task by one of its numerical ids
|
|
*
|
|
* find_task_by_pid_ns():
|
|
* finds a task by its pid in the specified namespace
|
|
* find_task_by_vpid():
|
|
* finds a task by its virtual pid
|
|
*
|
|
* see also find_vpid() etc in include/linux/pid.h
|
|
*/
|
|
|
|
extern struct task_struct *find_task_by_vpid(pid_t nr);
|
|
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
|
|
struct pid_namespace *ns);
|
|
|
|
/* per-UID process charging. */
|
|
extern struct user_struct * alloc_uid(kuid_t);
|
|
static inline struct user_struct *get_uid(struct user_struct *u)
|
|
{
|
|
atomic_inc(&u->__count);
|
|
return u;
|
|
}
|
|
extern void free_uid(struct user_struct *);
|
|
|
|
#include <asm/current.h>
|
|
|
|
extern void xtime_update(unsigned long ticks);
|
|
|
|
extern int wake_up_state(struct task_struct *tsk, unsigned int state);
|
|
extern int wake_up_process(struct task_struct *tsk);
|
|
extern int wake_up_process_no_notif(struct task_struct *tsk);
|
|
extern void wake_up_new_task(struct task_struct *tsk);
|
|
#ifdef CONFIG_SMP
|
|
extern void kick_process(struct task_struct *tsk);
|
|
#else
|
|
static inline void kick_process(struct task_struct *tsk) { }
|
|
#endif
|
|
extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
|
|
extern void sched_dead(struct task_struct *p);
|
|
#ifdef CONFIG_SCHED_HMP
|
|
extern void sched_exit(struct task_struct *p);
|
|
#else
|
|
static inline void sched_exit(struct task_struct *p) { }
|
|
#endif
|
|
|
|
|
|
extern void proc_caches_init(void);
|
|
extern void flush_signals(struct task_struct *);
|
|
extern void ignore_signals(struct task_struct *);
|
|
extern void flush_signal_handlers(struct task_struct *, int force_default);
|
|
extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info);
|
|
|
|
static inline int kernel_dequeue_signal(siginfo_t *info)
|
|
{
|
|
struct task_struct *tsk = current;
|
|
siginfo_t __info;
|
|
int ret;
|
|
|
|
spin_lock_irq(&tsk->sighand->siglock);
|
|
ret = dequeue_signal(tsk, &tsk->blocked, info ?: &__info);
|
|
spin_unlock_irq(&tsk->sighand->siglock);
|
|
|
|
return ret;
|
|
}
|
|
|
|
static inline void kernel_signal_stop(void)
|
|
{
|
|
spin_lock_irq(¤t->sighand->siglock);
|
|
if (current->jobctl & JOBCTL_STOP_DEQUEUED)
|
|
__set_current_state(TASK_STOPPED);
|
|
spin_unlock_irq(¤t->sighand->siglock);
|
|
|
|
schedule();
|
|
}
|
|
|
|
extern void release_task(struct task_struct * p);
|
|
extern int send_sig_info(int, struct siginfo *, struct task_struct *);
|
|
extern int force_sigsegv(int, struct task_struct *);
|
|
extern int force_sig_info(int, struct siginfo *, struct task_struct *);
|
|
extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
|
|
extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
|
|
extern int kill_pid_info_as_cred(int, struct siginfo *, struct pid *,
|
|
const struct cred *, u32);
|
|
extern int kill_pgrp(struct pid *pid, int sig, int priv);
|
|
extern int kill_pid(struct pid *pid, int sig, int priv);
|
|
extern int kill_proc_info(int, struct siginfo *, pid_t);
|
|
extern __must_check bool do_notify_parent(struct task_struct *, int);
|
|
extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
|
|
extern void force_sig(int, struct task_struct *);
|
|
extern int send_sig(int, struct task_struct *, int);
|
|
extern int zap_other_threads(struct task_struct *p);
|
|
extern struct sigqueue *sigqueue_alloc(void);
|
|
extern void sigqueue_free(struct sigqueue *);
|
|
extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
|
|
extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
|
|
|
|
#ifdef TIF_RESTORE_SIGMASK
|
|
/*
|
|
* Legacy restore_sigmask accessors. These are inefficient on
|
|
* SMP architectures because they require atomic operations.
|
|
*/
|
|
|
|
/**
|
|
* set_restore_sigmask() - make sure saved_sigmask processing gets done
|
|
*
|
|
* This sets TIF_RESTORE_SIGMASK and ensures that the arch signal code
|
|
* will run before returning to user mode, to process the flag. For
|
|
* all callers, TIF_SIGPENDING is already set or it's no harm to set
|
|
* it. TIF_RESTORE_SIGMASK need not be in the set of bits that the
|
|
* arch code will notice on return to user mode, in case those bits
|
|
* are scarce. We set TIF_SIGPENDING here to ensure that the arch
|
|
* signal code always gets run when TIF_RESTORE_SIGMASK is set.
|
|
*/
|
|
static inline void set_restore_sigmask(void)
|
|
{
|
|
set_thread_flag(TIF_RESTORE_SIGMASK);
|
|
WARN_ON(!test_thread_flag(TIF_SIGPENDING));
|
|
}
|
|
static inline void clear_restore_sigmask(void)
|
|
{
|
|
clear_thread_flag(TIF_RESTORE_SIGMASK);
|
|
}
|
|
static inline bool test_restore_sigmask(void)
|
|
{
|
|
return test_thread_flag(TIF_RESTORE_SIGMASK);
|
|
}
|
|
static inline bool test_and_clear_restore_sigmask(void)
|
|
{
|
|
return test_and_clear_thread_flag(TIF_RESTORE_SIGMASK);
|
|
}
|
|
|
|
#else /* TIF_RESTORE_SIGMASK */
|
|
|
|
/* Higher-quality implementation, used if TIF_RESTORE_SIGMASK doesn't exist. */
|
|
static inline void set_restore_sigmask(void)
|
|
{
|
|
current->restore_sigmask = true;
|
|
WARN_ON(!test_thread_flag(TIF_SIGPENDING));
|
|
}
|
|
static inline void clear_restore_sigmask(void)
|
|
{
|
|
current->restore_sigmask = false;
|
|
}
|
|
static inline bool test_restore_sigmask(void)
|
|
{
|
|
return current->restore_sigmask;
|
|
}
|
|
static inline bool test_and_clear_restore_sigmask(void)
|
|
{
|
|
if (!current->restore_sigmask)
|
|
return false;
|
|
current->restore_sigmask = false;
|
|
return true;
|
|
}
|
|
#endif
|
|
|
|
static inline void restore_saved_sigmask(void)
|
|
{
|
|
if (test_and_clear_restore_sigmask())
|
|
__set_current_blocked(¤t->saved_sigmask);
|
|
}
|
|
|
|
static inline sigset_t *sigmask_to_save(void)
|
|
{
|
|
sigset_t *res = ¤t->blocked;
|
|
if (unlikely(test_restore_sigmask()))
|
|
res = ¤t->saved_sigmask;
|
|
return res;
|
|
}
|
|
|
|
static inline int kill_cad_pid(int sig, int priv)
|
|
{
|
|
return kill_pid(cad_pid, sig, priv);
|
|
}
|
|
|
|
/* These can be the second arg to send_sig_info/send_group_sig_info. */
|
|
#define SEND_SIG_NOINFO ((struct siginfo *) 0)
|
|
#define SEND_SIG_PRIV ((struct siginfo *) 1)
|
|
#define SEND_SIG_FORCED ((struct siginfo *) 2)
|
|
|
|
/*
|
|
* True if we are on the alternate signal stack.
|
|
*/
|
|
static inline int on_sig_stack(unsigned long sp)
|
|
{
|
|
/*
|
|
* If the signal stack is SS_AUTODISARM then, by construction, we
|
|
* can't be on the signal stack unless user code deliberately set
|
|
* SS_AUTODISARM when we were already on it.
|
|
*
|
|
* This improves reliability: if user state gets corrupted such that
|
|
* the stack pointer points very close to the end of the signal stack,
|
|
* then this check will enable the signal to be handled anyway.
|
|
*/
|
|
if (current->sas_ss_flags & SS_AUTODISARM)
|
|
return 0;
|
|
|
|
#ifdef CONFIG_STACK_GROWSUP
|
|
return sp >= current->sas_ss_sp &&
|
|
sp - current->sas_ss_sp < current->sas_ss_size;
|
|
#else
|
|
return sp > current->sas_ss_sp &&
|
|
sp - current->sas_ss_sp <= current->sas_ss_size;
|
|
#endif
|
|
}
|
|
|
|
static inline int sas_ss_flags(unsigned long sp)
|
|
{
|
|
if (!current->sas_ss_size)
|
|
return SS_DISABLE;
|
|
|
|
return on_sig_stack(sp) ? SS_ONSTACK : 0;
|
|
}
|
|
|
|
static inline void sas_ss_reset(struct task_struct *p)
|
|
{
|
|
p->sas_ss_sp = 0;
|
|
p->sas_ss_size = 0;
|
|
p->sas_ss_flags = SS_DISABLE;
|
|
}
|
|
|
|
static inline unsigned long sigsp(unsigned long sp, struct ksignal *ksig)
|
|
{
|
|
if (unlikely((ksig->ka.sa.sa_flags & SA_ONSTACK)) && ! sas_ss_flags(sp))
|
|
#ifdef CONFIG_STACK_GROWSUP
|
|
return current->sas_ss_sp;
|
|
#else
|
|
return current->sas_ss_sp + current->sas_ss_size;
|
|
#endif
|
|
return sp;
|
|
}
|
|
|
|
/*
|
|
* Routines for handling mm_structs
|
|
*/
|
|
extern struct mm_struct * mm_alloc(void);
|
|
|
|
/* mmdrop drops the mm and the page tables */
|
|
extern void __mmdrop(struct mm_struct *);
|
|
static inline void mmdrop(struct mm_struct *mm)
|
|
{
|
|
if (unlikely(atomic_dec_and_test(&mm->mm_count)))
|
|
__mmdrop(mm);
|
|
}
|
|
|
|
static inline void mmdrop_async_fn(struct work_struct *work)
|
|
{
|
|
struct mm_struct *mm = container_of(work, struct mm_struct, async_put_work);
|
|
__mmdrop(mm);
|
|
}
|
|
|
|
static inline void mmdrop_async(struct mm_struct *mm)
|
|
{
|
|
if (unlikely(atomic_dec_and_test(&mm->mm_count))) {
|
|
INIT_WORK(&mm->async_put_work, mmdrop_async_fn);
|
|
schedule_work(&mm->async_put_work);
|
|
}
|
|
}
|
|
|
|
static inline bool mmget_not_zero(struct mm_struct *mm)
|
|
{
|
|
return atomic_inc_not_zero(&mm->mm_users);
|
|
}
|
|
|
|
/* mmput gets rid of the mappings and all user-space */
|
|
extern void mmput(struct mm_struct *);
|
|
#ifdef CONFIG_MMU
|
|
/* same as above but performs the slow path from the async context. Can
|
|
* be called from the atomic context as well
|
|
*/
|
|
extern void mmput_async(struct mm_struct *);
|
|
#endif
|
|
|
|
/* Grab a reference to a task's mm, if it is not already going away */
|
|
extern struct mm_struct *get_task_mm(struct task_struct *task);
|
|
/*
|
|
* Grab a reference to a task's mm, if it is not already going away
|
|
* and ptrace_may_access with the mode parameter passed to it
|
|
* succeeds.
|
|
*/
|
|
extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode);
|
|
/* Remove the current tasks stale references to the old mm_struct */
|
|
extern void mm_release(struct task_struct *, struct mm_struct *);
|
|
|
|
#ifdef CONFIG_HAVE_COPY_THREAD_TLS
|
|
extern int copy_thread_tls(unsigned long, unsigned long, unsigned long,
|
|
struct task_struct *, unsigned long);
|
|
#else
|
|
extern int copy_thread(unsigned long, unsigned long, unsigned long,
|
|
struct task_struct *);
|
|
|
|
/* Architectures that haven't opted into copy_thread_tls get the tls argument
|
|
* via pt_regs, so ignore the tls argument passed via C. */
|
|
static inline int copy_thread_tls(
|
|
unsigned long clone_flags, unsigned long sp, unsigned long arg,
|
|
struct task_struct *p, unsigned long tls)
|
|
{
|
|
return copy_thread(clone_flags, sp, arg, p);
|
|
}
|
|
#endif
|
|
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 void exit_files(struct task_struct *);
|
|
extern void __cleanup_sighand(struct sighand_struct *);
|
|
|
|
extern void exit_itimers(struct signal_struct *);
|
|
extern void flush_itimer_signals(void);
|
|
|
|
extern void do_group_exit(int);
|
|
|
|
extern int do_execve(struct filename *,
|
|
const char __user * const __user *,
|
|
const char __user * const __user *);
|
|
extern int do_execveat(int, struct filename *,
|
|
const char __user * const __user *,
|
|
const char __user * const __user *,
|
|
int);
|
|
extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *, unsigned long);
|
|
extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
|
|
struct task_struct *fork_idle(int);
|
|
extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
|
|
|
|
extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
|
|
static inline void set_task_comm(struct task_struct *tsk, const char *from)
|
|
{
|
|
__set_task_comm(tsk, from, false);
|
|
}
|
|
extern char *get_task_comm(char *to, struct task_struct *tsk);
|
|
|
|
#ifdef CONFIG_SMP
|
|
void scheduler_ipi(void);
|
|
extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
|
|
#else
|
|
static inline void scheduler_ipi(void) { }
|
|
static inline unsigned long wait_task_inactive(struct task_struct *p,
|
|
long match_state)
|
|
{
|
|
return 1;
|
|
}
|
|
#endif
|
|
|
|
#define tasklist_empty() \
|
|
list_empty(&init_task.tasks)
|
|
|
|
#define next_task(p) \
|
|
list_entry_rcu((p)->tasks.next, struct task_struct, tasks)
|
|
|
|
#define for_each_process(p) \
|
|
for (p = &init_task ; (p = next_task(p)) != &init_task ; )
|
|
|
|
extern bool current_is_single_threaded(void);
|
|
|
|
/*
|
|
* Careful: do_each_thread/while_each_thread is a double loop so
|
|
* 'break' will not work as expected - use goto instead.
|
|
*/
|
|
#define do_each_thread(g, t) \
|
|
for (g = t = &init_task ; (g = t = next_task(g)) != &init_task ; ) do
|
|
|
|
#define while_each_thread(g, t) \
|
|
while ((t = next_thread(t)) != g)
|
|
|
|
#define __for_each_thread(signal, t) \
|
|
list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node)
|
|
|
|
#define for_each_thread(p, t) \
|
|
__for_each_thread((p)->signal, t)
|
|
|
|
/* Careful: this is a double loop, 'break' won't work as expected. */
|
|
#define for_each_process_thread(p, t) \
|
|
for_each_process(p) for_each_thread(p, t)
|
|
|
|
static inline int get_nr_threads(struct task_struct *tsk)
|
|
{
|
|
return tsk->signal->nr_threads;
|
|
}
|
|
|
|
static inline bool thread_group_leader(struct task_struct *p)
|
|
{
|
|
return p->exit_signal >= 0;
|
|
}
|
|
|
|
/* Do to the insanities of de_thread it is possible for a process
|
|
* to have the pid of the thread group leader without actually being
|
|
* the thread group leader. For iteration through the pids in proc
|
|
* all we care about is that we have a task with the appropriate
|
|
* pid, we don't actually care if we have the right task.
|
|
*/
|
|
static inline bool has_group_leader_pid(struct task_struct *p)
|
|
{
|
|
return task_pid(p) == p->signal->leader_pid;
|
|
}
|
|
|
|
static inline
|
|
bool same_thread_group(struct task_struct *p1, struct task_struct *p2)
|
|
{
|
|
return p1->signal == p2->signal;
|
|
}
|
|
|
|
static inline struct task_struct *next_thread(const struct task_struct *p)
|
|
{
|
|
return list_entry_rcu(p->thread_group.next,
|
|
struct task_struct, thread_group);
|
|
}
|
|
|
|
static inline int thread_group_empty(struct task_struct *p)
|
|
{
|
|
return list_empty(&p->thread_group);
|
|
}
|
|
|
|
#define delay_group_leader(p) \
|
|
(thread_group_leader(p) && !thread_group_empty(p))
|
|
|
|
/*
|
|
* 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.
|
|
*
|
|
* 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);
|
|
}
|
|
|
|
extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
|
|
unsigned long *flags);
|
|
|
|
static inline struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
|
|
unsigned long *flags)
|
|
{
|
|
struct sighand_struct *ret;
|
|
|
|
ret = __lock_task_sighand(tsk, flags);
|
|
(void)__cond_lock(&tsk->sighand->siglock, ret);
|
|
return ret;
|
|
}
|
|
|
|
static inline void unlock_task_sighand(struct task_struct *tsk,
|
|
unsigned long *flags)
|
|
{
|
|
spin_unlock_irqrestore(&tsk->sighand->siglock, *flags);
|
|
}
|
|
|
|
/**
|
|
* threadgroup_change_begin - mark the beginning of changes to a threadgroup
|
|
* @tsk: task causing the changes
|
|
*
|
|
* All operations which modify a threadgroup - a new thread joining the
|
|
* group, death of a member thread (the assertion of PF_EXITING) and
|
|
* exec(2) dethreading the process and replacing the leader - are wrapped
|
|
* by threadgroup_change_{begin|end}(). This is to provide a place which
|
|
* subsystems needing threadgroup stability can hook into for
|
|
* synchronization.
|
|
*/
|
|
static inline void threadgroup_change_begin(struct task_struct *tsk)
|
|
{
|
|
might_sleep();
|
|
cgroup_threadgroup_change_begin(tsk);
|
|
}
|
|
|
|
/**
|
|
* threadgroup_change_end - mark the end of changes to a threadgroup
|
|
* @tsk: task causing the changes
|
|
*
|
|
* See threadgroup_change_begin().
|
|
*/
|
|
static inline void threadgroup_change_end(struct task_struct *tsk)
|
|
{
|
|
cgroup_threadgroup_change_end(tsk);
|
|
}
|
|
|
|
#ifdef CONFIG_THREAD_INFO_IN_TASK
|
|
|
|
static inline struct thread_info *task_thread_info(struct task_struct *task)
|
|
{
|
|
return &task->thread_info;
|
|
}
|
|
|
|
/*
|
|
* When accessing the stack of a non-current task that might exit, use
|
|
* try_get_task_stack() instead. task_stack_page will return a pointer
|
|
* that could get freed out from under you.
|
|
*/
|
|
static inline void *task_stack_page(const struct task_struct *task)
|
|
{
|
|
return task->stack;
|
|
}
|
|
|
|
#define setup_thread_stack(new,old) do { } while(0)
|
|
|
|
static inline unsigned long *end_of_stack(const struct task_struct *task)
|
|
{
|
|
return task->stack;
|
|
}
|
|
|
|
#elif !defined(__HAVE_THREAD_FUNCTIONS)
|
|
|
|
#define task_thread_info(task) ((struct thread_info *)(task)->stack)
|
|
#define task_stack_page(task) ((void *)(task)->stack)
|
|
|
|
static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org)
|
|
{
|
|
*task_thread_info(p) = *task_thread_info(org);
|
|
task_thread_info(p)->task = p;
|
|
}
|
|
|
|
/*
|
|
* Return the address of the last usable long on the stack.
|
|
*
|
|
* When the stack grows down, this is just above the thread
|
|
* info struct. Going any lower will corrupt the threadinfo.
|
|
*
|
|
* When the stack grows up, this is the highest address.
|
|
* Beyond that position, we corrupt data on the next page.
|
|
*/
|
|
static inline unsigned long *end_of_stack(struct task_struct *p)
|
|
{
|
|
#ifdef CONFIG_STACK_GROWSUP
|
|
return (unsigned long *)((unsigned long)task_thread_info(p) + THREAD_SIZE) - 1;
|
|
#else
|
|
return (unsigned long *)(task_thread_info(p) + 1);
|
|
#endif
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_THREAD_INFO_IN_TASK
|
|
static inline void *try_get_task_stack(struct task_struct *tsk)
|
|
{
|
|
return atomic_inc_not_zero(&tsk->stack_refcount) ?
|
|
task_stack_page(tsk) : NULL;
|
|
}
|
|
|
|
extern void put_task_stack(struct task_struct *tsk);
|
|
#else
|
|
static inline void *try_get_task_stack(struct task_struct *tsk)
|
|
{
|
|
return task_stack_page(tsk);
|
|
}
|
|
|
|
static inline void put_task_stack(struct task_struct *tsk) {}
|
|
#endif
|
|
|
|
#define task_stack_end_corrupted(task) \
|
|
(*(end_of_stack(task)) != STACK_END_MAGIC)
|
|
|
|
static inline int object_is_on_stack(void *obj)
|
|
{
|
|
void *stack = task_stack_page(current);
|
|
|
|
return (obj >= stack) && (obj < (stack + THREAD_SIZE));
|
|
}
|
|
|
|
extern void thread_stack_cache_init(void);
|
|
|
|
#ifdef CONFIG_DEBUG_STACK_USAGE
|
|
static inline unsigned long stack_not_used(struct task_struct *p)
|
|
{
|
|
unsigned long *n = end_of_stack(p);
|
|
|
|
do { /* Skip over canary */
|
|
# ifdef CONFIG_STACK_GROWSUP
|
|
n--;
|
|
# else
|
|
n++;
|
|
# endif
|
|
} while (!*n);
|
|
|
|
# ifdef CONFIG_STACK_GROWSUP
|
|
return (unsigned long)end_of_stack(p) - (unsigned long)n;
|
|
# else
|
|
return (unsigned long)n - (unsigned long)end_of_stack(p);
|
|
# endif
|
|
}
|
|
#endif
|
|
extern void set_task_stack_end_magic(struct task_struct *tsk);
|
|
|
|
/* set thread flags in other task's structures
|
|
* - see asm/thread_info.h for TIF_xxxx flags available
|
|
*/
|
|
static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
set_ti_thread_flag(task_thread_info(tsk), flag);
|
|
}
|
|
|
|
static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
clear_ti_thread_flag(task_thread_info(tsk), flag);
|
|
}
|
|
|
|
static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
|
|
}
|
|
|
|
static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag);
|
|
}
|
|
|
|
static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)
|
|
{
|
|
return test_ti_thread_flag(task_thread_info(tsk), flag);
|
|
}
|
|
|
|
static inline void set_tsk_need_resched(struct task_struct *tsk)
|
|
{
|
|
set_tsk_thread_flag(tsk,TIF_NEED_RESCHED);
|
|
}
|
|
|
|
static inline void clear_tsk_need_resched(struct task_struct *tsk)
|
|
{
|
|
clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED);
|
|
}
|
|
|
|
static inline int test_tsk_need_resched(struct task_struct *tsk)
|
|
{
|
|
return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
|
|
}
|
|
|
|
static inline int restart_syscall(void)
|
|
{
|
|
set_tsk_thread_flag(current, TIF_SIGPENDING);
|
|
return -ERESTARTNOINTR;
|
|
}
|
|
|
|
static inline int signal_pending(struct task_struct *p)
|
|
{
|
|
return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING));
|
|
}
|
|
|
|
static inline int __fatal_signal_pending(struct task_struct *p)
|
|
{
|
|
return unlikely(sigismember(&p->pending.signal, SIGKILL));
|
|
}
|
|
|
|
static inline int fatal_signal_pending(struct task_struct *p)
|
|
{
|
|
return signal_pending(p) && __fatal_signal_pending(p);
|
|
}
|
|
|
|
static inline int signal_pending_state(long state, struct task_struct *p)
|
|
{
|
|
if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL)))
|
|
return 0;
|
|
if (!signal_pending(p))
|
|
return 0;
|
|
|
|
return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
|
|
}
|
|
|
|
/*
|
|
* cond_resched() and cond_resched_lock(): latency reduction via
|
|
* explicit rescheduling in places that are safe. The return
|
|
* value indicates whether a reschedule was done in fact.
|
|
* cond_resched_lock() will drop the spinlock before scheduling,
|
|
* cond_resched_softirq() will enable bhs before scheduling.
|
|
*/
|
|
#ifndef CONFIG_PREEMPT
|
|
extern int _cond_resched(void);
|
|
#else
|
|
static inline int _cond_resched(void) { return 0; }
|
|
#endif
|
|
|
|
#define cond_resched() ({ \
|
|
___might_sleep(__FILE__, __LINE__, 0); \
|
|
_cond_resched(); \
|
|
})
|
|
|
|
extern int __cond_resched_lock(spinlock_t *lock);
|
|
|
|
#define cond_resched_lock(lock) ({ \
|
|
___might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET);\
|
|
__cond_resched_lock(lock); \
|
|
})
|
|
|
|
extern int __cond_resched_softirq(void);
|
|
|
|
#define cond_resched_softirq() ({ \
|
|
___might_sleep(__FILE__, __LINE__, SOFTIRQ_DISABLE_OFFSET); \
|
|
__cond_resched_softirq(); \
|
|
})
|
|
|
|
static inline void cond_resched_rcu(void)
|
|
{
|
|
#if defined(CONFIG_DEBUG_ATOMIC_SLEEP) || !defined(CONFIG_PREEMPT_RCU)
|
|
rcu_read_unlock();
|
|
cond_resched();
|
|
rcu_read_lock();
|
|
#endif
|
|
}
|
|
|
|
static inline unsigned long get_preempt_disable_ip(struct task_struct *p)
|
|
{
|
|
#ifdef CONFIG_DEBUG_PREEMPT
|
|
return p->preempt_disable_ip;
|
|
#else
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
/*
|
|
* Does a critical section need to be broken due to another
|
|
* task waiting?: (technically does not depend on CONFIG_PREEMPT,
|
|
* but a general need for low latency)
|
|
*/
|
|
static inline int spin_needbreak(spinlock_t *lock)
|
|
{
|
|
#ifdef CONFIG_PREEMPT
|
|
return spin_is_contended(lock);
|
|
#else
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
/*
|
|
* Idle thread specific functions to determine the need_resched
|
|
* polling state.
|
|
*/
|
|
#ifdef TIF_POLLING_NRFLAG
|
|
static inline int tsk_is_polling(struct task_struct *p)
|
|
{
|
|
return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG);
|
|
}
|
|
|
|
static inline void __current_set_polling(void)
|
|
{
|
|
set_thread_flag(TIF_POLLING_NRFLAG);
|
|
}
|
|
|
|
static inline bool __must_check current_set_polling_and_test(void)
|
|
{
|
|
__current_set_polling();
|
|
|
|
/*
|
|
* Polling state must be visible before we test NEED_RESCHED,
|
|
* paired by resched_curr()
|
|
*/
|
|
smp_mb__after_atomic();
|
|
|
|
return unlikely(tif_need_resched());
|
|
}
|
|
|
|
static inline void __current_clr_polling(void)
|
|
{
|
|
clear_thread_flag(TIF_POLLING_NRFLAG);
|
|
}
|
|
|
|
static inline bool __must_check current_clr_polling_and_test(void)
|
|
{
|
|
__current_clr_polling();
|
|
|
|
/*
|
|
* Polling state must be visible before we test NEED_RESCHED,
|
|
* paired by resched_curr()
|
|
*/
|
|
smp_mb__after_atomic();
|
|
|
|
return unlikely(tif_need_resched());
|
|
}
|
|
|
|
#else
|
|
static inline int tsk_is_polling(struct task_struct *p) { return 0; }
|
|
static inline void __current_set_polling(void) { }
|
|
static inline void __current_clr_polling(void) { }
|
|
|
|
static inline bool __must_check current_set_polling_and_test(void)
|
|
{
|
|
return unlikely(tif_need_resched());
|
|
}
|
|
static inline bool __must_check current_clr_polling_and_test(void)
|
|
{
|
|
return unlikely(tif_need_resched());
|
|
}
|
|
#endif
|
|
|
|
static inline void current_clr_polling(void)
|
|
{
|
|
__current_clr_polling();
|
|
|
|
/*
|
|
* Ensure we check TIF_NEED_RESCHED after we clear the polling bit.
|
|
* Once the bit is cleared, we'll get IPIs with every new
|
|
* TIF_NEED_RESCHED and the IPI handler, scheduler_ipi(), will also
|
|
* fold.
|
|
*/
|
|
smp_mb(); /* paired with resched_curr() */
|
|
|
|
preempt_fold_need_resched();
|
|
}
|
|
|
|
static __always_inline bool need_resched(void)
|
|
{
|
|
return unlikely(tif_need_resched());
|
|
}
|
|
|
|
/*
|
|
* Thread group CPU time accounting.
|
|
*/
|
|
void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
|
|
void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
|
|
|
|
/*
|
|
* Reevaluate whether the task has signals pending delivery.
|
|
* Wake the task if so.
|
|
* This is required every time the blocked sigset_t changes.
|
|
* callers must hold sighand->siglock.
|
|
*/
|
|
extern void recalc_sigpending_and_wake(struct task_struct *t);
|
|
extern void recalc_sigpending(void);
|
|
|
|
extern void signal_wake_up_state(struct task_struct *t, unsigned int state);
|
|
|
|
static inline void signal_wake_up(struct task_struct *t, bool resume)
|
|
{
|
|
signal_wake_up_state(t, resume ? TASK_WAKEKILL : 0);
|
|
}
|
|
static inline void ptrace_signal_wake_up(struct task_struct *t, bool resume)
|
|
{
|
|
signal_wake_up_state(t, resume ? __TASK_TRACED : 0);
|
|
}
|
|
|
|
/*
|
|
* Wrappers for p->thread_info->cpu access. No-op on UP.
|
|
*/
|
|
#ifdef CONFIG_SMP
|
|
|
|
static inline unsigned int task_cpu(const struct task_struct *p)
|
|
{
|
|
#ifdef CONFIG_THREAD_INFO_IN_TASK
|
|
return p->cpu;
|
|
#else
|
|
return task_thread_info(p)->cpu;
|
|
#endif
|
|
}
|
|
|
|
static inline int task_node(const struct task_struct *p)
|
|
{
|
|
return cpu_to_node(task_cpu(p));
|
|
}
|
|
|
|
extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
|
|
|
|
#else
|
|
|
|
static inline unsigned int task_cpu(const struct task_struct *p)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
|
|
{
|
|
}
|
|
|
|
#endif /* CONFIG_SMP */
|
|
|
|
extern struct atomic_notifier_head load_alert_notifier_head;
|
|
|
|
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
|
|
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
|
|
|
|
#ifdef CONFIG_CGROUP_SCHED
|
|
extern struct task_group root_task_group;
|
|
#endif /* CONFIG_CGROUP_SCHED */
|
|
|
|
extern int task_can_switch_user(struct user_struct *up,
|
|
struct task_struct *tsk);
|
|
|
|
#ifdef CONFIG_TASK_XACCT
|
|
static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
|
|
{
|
|
tsk->ioac.rchar += amt;
|
|
}
|
|
|
|
static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
|
|
{
|
|
tsk->ioac.wchar += amt;
|
|
}
|
|
|
|
static inline void inc_syscr(struct task_struct *tsk)
|
|
{
|
|
tsk->ioac.syscr++;
|
|
}
|
|
|
|
static inline void inc_syscw(struct task_struct *tsk)
|
|
{
|
|
tsk->ioac.syscw++;
|
|
}
|
|
#else
|
|
static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
|
|
{
|
|
}
|
|
|
|
static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
|
|
{
|
|
}
|
|
|
|
static inline void inc_syscr(struct task_struct *tsk)
|
|
{
|
|
}
|
|
|
|
static inline void inc_syscw(struct task_struct *tsk)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#ifndef TASK_SIZE_OF
|
|
#define TASK_SIZE_OF(tsk) TASK_SIZE
|
|
#endif
|
|
|
|
#ifdef CONFIG_MEMCG
|
|
extern void mm_update_next_owner(struct mm_struct *mm);
|
|
#else
|
|
static inline void mm_update_next_owner(struct mm_struct *mm)
|
|
{
|
|
}
|
|
#endif /* CONFIG_MEMCG */
|
|
|
|
static inline unsigned long task_rlimit(const struct task_struct *tsk,
|
|
unsigned int limit)
|
|
{
|
|
return READ_ONCE(tsk->signal->rlim[limit].rlim_cur);
|
|
}
|
|
|
|
static inline unsigned long task_rlimit_max(const struct task_struct *tsk,
|
|
unsigned int limit)
|
|
{
|
|
return READ_ONCE(tsk->signal->rlim[limit].rlim_max);
|
|
}
|
|
|
|
static inline unsigned long rlimit(unsigned int limit)
|
|
{
|
|
return task_rlimit(current, limit);
|
|
}
|
|
|
|
static inline unsigned long rlimit_max(unsigned int limit)
|
|
{
|
|
return task_rlimit_max(current, limit);
|
|
}
|
|
|
|
#define SCHED_CPUFREQ_RT (1U << 0)
|
|
#define SCHED_CPUFREQ_DL (1U << 1)
|
|
#define SCHED_CPUFREQ_IOWAIT (1U << 2)
|
|
|
|
#define SCHED_CPUFREQ_RT_DL (SCHED_CPUFREQ_RT | SCHED_CPUFREQ_DL)
|
|
|
|
#ifdef CONFIG_CPU_FREQ
|
|
struct update_util_data {
|
|
void (*func)(struct update_util_data *data, u64 time, unsigned int flags);
|
|
};
|
|
|
|
void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data,
|
|
void (*func)(struct update_util_data *data, u64 time,
|
|
unsigned int flags));
|
|
void cpufreq_remove_update_util_hook(int cpu);
|
|
#endif /* CONFIG_CPU_FREQ */
|
|
|
|
#endif
|