Skip to content

Commit

Permalink
Merge branch 'akpm' (patches from Andrew)
Browse files Browse the repository at this point in the history
Merge more updates from Andrew Morton:
 "55 patches.

  Subsystems affected by this patch series: percpu, procfs, sysctl,
  misc, core-kernel, get_maintainer, lib, checkpatch, binfmt, nilfs2,
  hfs, fat, adfs, panic, delayacct, kconfig, kcov, and ubsan"

* emailed patches from Andrew Morton <[email protected]>: (55 commits)
  lib: remove redundant assignment to variable ret
  ubsan: remove CONFIG_UBSAN_OBJECT_SIZE
  kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR
  lib/Kconfig.debug: make TEST_KMOD depend on PAGE_SIZE_LESS_THAN_256KB
  btrfs: use generic Kconfig option for 256kB page size limit
  arch/Kconfig: split PAGE_SIZE_LESS_THAN_256KB from PAGE_SIZE_LESS_THAN_64KB
  configs: introduce debug.config for CI-like setup
  delayacct: track delays from memory compact
  Documentation/accounting/delay-accounting.rst: add thrashing page cache and direct compact
  delayacct: cleanup flags in struct task_delay_info and functions use it
  delayacct: fix incomplete disable operation when switch enable to disable
  delayacct: support swapin delay accounting for swapping without blkio
  panic: remove oops_id
  panic: use error_report_end tracepoint on warnings
  fs/adfs: remove unneeded variable make code cleaner
  FAT: use io_schedule_timeout() instead of congestion_wait()
  hfsplus: use struct_group_attr() for memcpy() region
  nilfs2: remove redundant pointer sbufs
  fs/binfmt_elf: use PT_LOAD p_align values for static PIE
  const_structs.checkpatch: add frequently used ops structs
  ...
  • Loading branch information
torvalds committed Jan 20, 2022
2 parents 1d1df41 + b1e78ef commit f4484d1
Show file tree
Hide file tree
Showing 77 changed files with 826 additions and 873 deletions.
55 changes: 27 additions & 28 deletions Documentation/accounting/delay-accounting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ a) waiting for a CPU (while being runnable)
b) completion of synchronous block I/O initiated by the task
c) swapping in pages
d) memory reclaim
e) thrashing page cache
f) direct compact

and makes these statistics available to userspace through
the taskstats interface.
Expand Down Expand Up @@ -41,11 +43,12 @@ generic data structure to userspace corresponding to per-pid and per-tgid
statistics. The delay accounting functionality populates specific fields of
this structure. See

include/linux/taskstats.h
include/uapi/linux/taskstats.h

for a description of the fields pertaining to delay accounting.
It will generally be in the form of counters returning the cumulative
delay seen for cpu, sync block I/O, swapin, memory reclaim etc.
delay seen for cpu, sync block I/O, swapin, memory reclaim, thrash page
cache, direct compact etc.

Taking the difference of two successive readings of a given
counter (say cpu_delay_total) for a task will give the delay
Expand Down Expand Up @@ -88,41 +91,37 @@ seen.

General format of the getdelays command::

getdelays [-t tgid] [-p pid] [-c cmd...]

getdelays [-dilv] [-t tgid] [-p pid]

Get delays, since system boot, for pid 10::

# ./getdelays -p 10
# ./getdelays -d -p 10
(output similar to next case)

Get sum of delays, since system boot, for all pids with tgid 5::

# ./getdelays -t 5


CPU count real total virtual total delay total
7876 92005750 100000000 24001500
IO count delay total
0 0
SWAP count delay total
0 0
RECLAIM count delay total
0 0
# ./getdelays -d -t 5
print delayacct stats ON
TGID 5

Get delays seen in executing a given simple command::

# ./getdelays -c ls /
CPU count real total virtual total delay total delay average
8 7000000 6872122 3382277 0.423ms
IO count delay total delay average
0 0 0ms
SWAP count delay total delay average
0 0 0ms
RECLAIM count delay total delay average
0 0 0ms
THRASHING count delay total delay average
0 0 0ms
COMPACT count delay total delay average
0 0 0ms

bin data1 data3 data5 dev home media opt root srv sys usr
boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var
Get IO accounting for pid 1, it works only with -p::

# ./getdelays -i -p 1
printing IO accounting
linuxrc: read=65536, write=0, cancelled_write=0

CPU count real total virtual total delay total
6 4000250 4000000 0
IO count delay total
0 0
SWAP count delay total
0 0
RECLAIM count delay total
0 0
The above command can be used with -v to get more debug information.
4 changes: 4 additions & 0 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,10 @@ config PAGE_SIZE_LESS_THAN_64KB
depends on !PAGE_SIZE_64KB
depends on !PARISC_PAGE_SIZE_64KB
depends on !PPC_64K_PAGES
depends on PAGE_SIZE_LESS_THAN_256KB

config PAGE_SIZE_LESS_THAN_256KB
def_bool y
depends on !PPC_256K_PAGES
depends on !PAGE_SIZE_256KB

Expand Down
20 changes: 4 additions & 16 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,10 @@ config NUMA
select GENERIC_ARCH_NUMA
select ACPI_NUMA if ACPI
select OF_NUMA
select HAVE_SETUP_PER_CPU_AREA
select NEED_PER_CPU_EMBED_FIRST_CHUNK
select NEED_PER_CPU_PAGE_FIRST_CHUNK
select USE_PERCPU_NUMA_NODE_ID
help
Enable NUMA (Non-Uniform Memory Access) support.

Expand All @@ -1152,22 +1156,6 @@ config NODES_SHIFT
Specify the maximum number of NUMA Nodes available on the target
system. Increases memory reserved to accommodate various tables.

config USE_PERCPU_NUMA_NODE_ID
def_bool y
depends on NUMA

config HAVE_SETUP_PER_CPU_AREA
def_bool y
depends on NUMA

config NEED_PER_CPU_EMBED_FIRST_CHUNK
def_bool y
depends on NUMA

config NEED_PER_CPU_PAGE_FIRST_CHUNK
def_bool y
depends on NUMA

source "kernel/Kconfig.hz"

config ARCH_SPARSEMEM_ENABLE
Expand Down
9 changes: 2 additions & 7 deletions arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ config IA64
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE if (!ITANIUM)
select HAVE_FUNCTION_TRACER
select HAVE_SETUP_PER_CPU_AREA
select TTY
select HAVE_ARCH_TRACEHOOK
select HAVE_VIRT_CPU_ACCOUNTING
Expand Down Expand Up @@ -88,9 +89,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y

config HAVE_SETUP_PER_CPU_AREA
def_bool y

config DMI
bool
default y
Expand Down Expand Up @@ -292,6 +290,7 @@ config NUMA
bool "NUMA support"
depends on !FLATMEM
select SMP
select USE_PERCPU_NUMA_NODE_ID
help
Say Y to compile the kernel to support NUMA (Non-Uniform Memory
Access). This option is for configuring high-end multiprocessor
Expand All @@ -311,10 +310,6 @@ config HAVE_ARCH_NODEDATA_EXTENSION
def_bool y
depends on NUMA

config USE_PERCPU_NUMA_NODE_ID
def_bool y
depends on NUMA

config HAVE_MEMORYLESS_NODES
def_bool NUMA

Expand Down
10 changes: 2 additions & 8 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,8 @@ config NUMA
bool "NUMA Support"
depends on SYS_SUPPORTS_NUMA
select SMP
select HAVE_SETUP_PER_CPU_AREA
select NEED_PER_CPU_EMBED_FIRST_CHUNK
help
Say Y to compile the kernel to support NUMA (Non-Uniform Memory
Access). This option improves performance on systems with more
Expand All @@ -2684,14 +2686,6 @@ config NUMA
config SYS_SUPPORTS_NUMA
bool

config HAVE_SETUP_PER_CPU_AREA
def_bool y
depends on NUMA

config NEED_PER_CPU_EMBED_FIRST_CHUNK
def_bool y
depends on NUMA

config RELOCATABLE
bool "Relocatable kernel"
depends on SYS_SUPPORTS_RELOCATABLE
Expand Down
14 changes: 3 additions & 11 deletions arch/mips/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,9 @@ static int __init pcpu_cpu_distance(unsigned int from, unsigned int to)
return node_distance(cpu_to_node(from), cpu_to_node(to));
}

static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size,
size_t align)
static int __init pcpu_cpu_to_node(int cpu)
{
return memblock_alloc_try_nid(size, align, __pa(MAX_DMA_ADDRESS),
MEMBLOCK_ALLOC_ACCESSIBLE,
cpu_to_node(cpu));
}

static void __init pcpu_fc_free(void *ptr, size_t size)
{
memblock_free(ptr, size);
return cpu_to_node(cpu);
}

void __init setup_per_cpu_areas(void)
Expand All @@ -545,7 +537,7 @@ void __init setup_per_cpu_areas(void)
rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE,
PERCPU_DYNAMIC_RESERVE, PAGE_SIZE,
pcpu_cpu_distance,
pcpu_fc_alloc, pcpu_fc_free);
pcpu_cpu_to_node);
if (rc < 0)
panic("Failed to initialize percpu areas.");

Expand Down
17 changes: 4 additions & 13 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ config ARCH_MMAP_RND_COMPAT_BITS_MIN
default 9 if PPC_16K_PAGES # 9 = 23 (8MB) - 14 (16K)
default 11 # 11 = 23 (8MB) - 12 (4K)

config HAVE_SETUP_PER_CPU_AREA
def_bool PPC64

config NEED_PER_CPU_EMBED_FIRST_CHUNK
def_bool y if PPC64

config NEED_PER_CPU_PAGE_FIRST_CHUNK
def_bool y if PPC64

config NR_IRQS
int "Number of virtual interrupt numbers"
range 32 1048576
Expand Down Expand Up @@ -241,6 +232,7 @@ config PPC
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_RELIABLE_STACKTRACE
select HAVE_RSEQ
select HAVE_SETUP_PER_CPU_AREA if PPC64
select HAVE_SOFTIRQ_ON_OWN_STACK
select HAVE_STACKPROTECTOR if PPC32 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r2)
select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13)
Expand All @@ -255,6 +247,8 @@ config PPC
select MMU_GATHER_RCU_TABLE_FREE
select MODULES_USE_ELF_RELA
select NEED_DMA_MAP_STATE if PPC64 || NOT_COHERENT_CACHE
select NEED_PER_CPU_EMBED_FIRST_CHUNK if PPC64
select NEED_PER_CPU_PAGE_FIRST_CHUNK if PPC64
select NEED_SG_DMA_LENGTH
select OF
select OF_DMA_DEFAULT_COHERENT if !NOT_COHERENT_CACHE
Expand Down Expand Up @@ -660,6 +654,7 @@ config NUMA
bool "NUMA Memory Allocation and Scheduler Support"
depends on PPC64 && SMP
default y if PPC_PSERIES || PPC_POWERNV
select USE_PERCPU_NUMA_NODE_ID
help
Enable NUMA (Non-Uniform Memory Access) support.

Expand All @@ -673,10 +668,6 @@ config NODES_SHIFT
default "4"
depends on NUMA

config USE_PERCPU_NUMA_NODE_ID
def_bool y
depends on NUMA

config HAVE_MEMORYLESS_NODES
def_bool y
depends on NUMA
Expand Down
Loading

0 comments on commit f4484d1

Please sign in to comment.