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

Merge tag 'docs-5.10-2' of git://git.lwn.net/linux

Pull documentation fixes from Jonathan Corbet:
"A handful of late-arriving documentation fixes"

* tag 'docs-5.10-2' of git://git.lwn.net/linux:
docs: Add two missing entries in vm sysctl index
docs/vm: trivial fixes to several spelling mistakes
docs: submitting-patches: describe preserving review/test tags
Documentation: Chinese translation of Documentation/arm64/hugetlbpage.rst
Documentation: x86: fix a missing word in x86_64/mm.rst.
docs: driver-api: remove a duplicated index entry
docs: lkdtm: Modernize and improve details
docs: deprecated.rst: Expand str*cpy() replacement notes
docs/cpu-load: format the example code.

+151 -74
+30 -27
Documentation/admin-guide/cpu-load.rst
··· 61 61 62 62 static volatile sig_atomic_t stop; 63 63 64 - static void sighandler (int signr) 64 + static void sighandler(int signr) 65 65 { 66 - (void) signr; 67 - stop = 1; 66 + (void) signr; 67 + stop = 1; 68 68 } 69 + 69 70 static unsigned long hog (unsigned long niters) 70 71 { 71 - stop = 0; 72 - while (!stop && --niters); 73 - return niters; 72 + stop = 0; 73 + while (!stop && --niters); 74 + return niters; 74 75 } 76 + 75 77 int main (void) 76 78 { 77 - int i; 78 - struct itimerval it = { .it_interval = { .tv_sec = 0, .tv_usec = 1 }, 79 - .it_value = { .tv_sec = 0, .tv_usec = 1 } }; 80 - sigset_t set; 81 - unsigned long v[HIST]; 82 - double tmp = 0.0; 83 - unsigned long n; 84 - signal (SIGALRM, &sighandler); 85 - setitimer (ITIMER_REAL, &it, NULL); 79 + int i; 80 + struct itimerval it = { 81 + .it_interval = { .tv_sec = 0, .tv_usec = 1 }, 82 + .it_value = { .tv_sec = 0, .tv_usec = 1 } }; 83 + sigset_t set; 84 + unsigned long v[HIST]; 85 + double tmp = 0.0; 86 + unsigned long n; 87 + signal(SIGALRM, &sighandler); 88 + setitimer(ITIMER_REAL, &it, NULL); 86 89 87 - hog (ULONG_MAX); 88 - for (i = 0; i < HIST; ++i) v[i] = ULONG_MAX - hog (ULONG_MAX); 89 - for (i = 0; i < HIST; ++i) tmp += v[i]; 90 - tmp /= HIST; 91 - n = tmp - (tmp / 3.0); 90 + hog (ULONG_MAX); 91 + for (i = 0; i < HIST; ++i) v[i] = ULONG_MAX - hog(ULONG_MAX); 92 + for (i = 0; i < HIST; ++i) tmp += v[i]; 93 + tmp /= HIST; 94 + n = tmp - (tmp / 3.0); 92 95 93 - sigemptyset (&set); 94 - sigaddset (&set, SIGALRM); 96 + sigemptyset(&set); 97 + sigaddset(&set, SIGALRM); 95 98 96 - for (;;) { 97 - hog (n); 98 - sigwait (&set, &i); 99 - } 100 - return 0; 99 + for (;;) { 100 + hog(n); 101 + sigwait(&set, &i); 102 + } 103 + return 0; 101 104 } 102 105 103 106
+2
Documentation/admin-guide/sysctl/vm.rst
··· 27 27 - admin_reserve_kbytes 28 28 - block_dump 29 29 - compact_memory 30 + - compaction_proactiveness 30 31 - compact_unevictable_allowed 31 32 - dirty_background_bytes 32 33 - dirty_background_ratio ··· 38 37 - dirty_writeback_centisecs 39 38 - drop_caches 40 39 - extfrag_threshold 40 + - highmem_is_dirtyable 41 41 - hugetlb_shm_group 42 42 - laptop_mode 43 43 - legacy_va_layout
+2
Documentation/arm64/hugetlbpage.rst
··· 1 + .. _hugetlbpage_index: 2 + 1 3 ==================== 2 4 HugeTLBpage on ARM64 3 5 ====================
-1
Documentation/driver-api/index.rst
··· 77 77 console 78 78 dcdbas 79 79 eisa 80 - ipmb 81 80 isa 82 81 isapnp 83 82 io-mapping
+33 -23
Documentation/fault-injection/provoke-crashes.rst
··· 1 - =============== 2 - Provoke crashes 3 - =============== 1 + .. SPDX-License-Identifier: GPL-2.0 4 2 5 - The lkdtm module provides an interface to crash or injure the kernel at 6 - predefined crashpoints to evaluate the reliability of crash dumps obtained 7 - using different dumping solutions. The module uses KPROBEs to instrument 8 - crashing points, but can also crash the kernel directly without KRPOBE 9 - support. 3 + ============================================================ 4 + Provoking crashes with Linux Kernel Dump Test Module (LKDTM) 5 + ============================================================ 10 6 7 + The lkdtm module provides an interface to disrupt (and usually crash) 8 + the kernel at predefined code locations to evaluate the reliability of 9 + the kernel's exception handling and to test crash dumps obtained using 10 + different dumping solutions. The module uses KPROBEs to instrument the 11 + trigger location, but can also trigger the kernel directly without KPROBE 12 + support via debugfs. 11 13 12 - You can provide the way either through module arguments when inserting 13 - the module, or through a debugfs interface. 14 + You can select the location of the trigger ("crash point name") and the 15 + type of action ("crash point type") either through module arguments when 16 + inserting the module, or through the debugfs interface. 14 17 15 18 Usage:: 16 19 ··· 21 18 [cpoint_count={>0}] 22 19 23 20 recur_count 24 - Recursion level for the stack overflow test. Default is 10. 21 + Recursion level for the stack overflow test. By default this is 22 + dynamically calculated based on kernel configuration, with the 23 + goal of being just large enough to exhaust the kernel stack. The 24 + value can be seen at `/sys/module/lkdtm/parameters/recur_count`. 25 25 26 26 cpoint_name 27 - Crash point where the kernel is to be crashed. It can be 27 + Where in the kernel to trigger the action. It can be 28 28 one of INT_HARDWARE_ENTRY, INT_HW_IRQ_EN, INT_TASKLET_ENTRY, 29 29 FS_DEVRW, MEM_SWAPOUT, TIMERADD, SCSI_DISPATCH_CMD, 30 - IDE_CORE_CP, DIRECT 30 + IDE_CORE_CP, or DIRECT 31 31 32 32 cpoint_type 33 33 Indicates the action to be taken on hitting the crash point. 34 - It can be one of PANIC, BUG, EXCEPTION, LOOP, OVERFLOW, 35 - CORRUPT_STACK, UNALIGNED_LOAD_STORE_WRITE, OVERWRITE_ALLOCATION, 36 - WRITE_AFTER_FREE, 34 + These are numerous, and best queried directly from debugfs. Some 35 + of the common ones are PANIC, BUG, EXCEPTION, LOOP, and OVERFLOW. 36 + See the contents of `/sys/kernel/debug/provoke-crash/DIRECT` for 37 + a complete list. 37 38 38 39 cpoint_count 39 40 Indicates the number of times the crash point is to be hit 40 - to trigger an action. The default is 10. 41 + before triggering the action. The default is 10 (except for 42 + DIRECT, which always fires immediately). 41 43 42 44 You can also induce failures by mounting debugfs and writing the type to 43 - <mountpoint>/provoke-crash/<crashpoint>. E.g.:: 45 + <debugfs>/provoke-crash/<crashpoint>. E.g.:: 44 46 45 - mount -t debugfs debugfs /mnt 46 - echo EXCEPTION > /mnt/provoke-crash/INT_HARDWARE_ENTRY 47 + mount -t debugfs debugfs /sys/kernel/debug 48 + echo EXCEPTION > /sys/kernel/debug/provoke-crash/INT_HARDWARE_ENTRY 47 49 50 + The special file `DIRECT` will induce the action directly without KPROBE 51 + instrumentation. This mode is the only one available when the module is 52 + built for a kernel without KPROBEs support:: 48 53 49 - A special file is `DIRECT` which will induce the crash directly without 50 - KPROBE instrumentation. This mode is the only one available when the module 51 - is built on a kernel without KPROBEs support. 54 + # Instead of having a BUG kill your shell, have it kill "cat": 55 + cat <(echo WRITE_RO) >/sys/kernel/debug/provoke-crash/DIRECT
+26 -18
Documentation/process/deprecated.rst
··· 106 106 107 107 strcpy() 108 108 -------- 109 - strcpy() performs no bounds checking on the destination 110 - buffer. This could result in linear overflows beyond the 111 - end of the buffer, leading to all kinds of misbehaviors. While 112 - `CONFIG_FORTIFY_SOURCE=y` and various compiler flags help reduce the 113 - risk of using this function, there is no good reason to add new uses of 114 - this function. The safe replacement is strscpy(). 109 + strcpy() performs no bounds checking on the destination buffer. This 110 + could result in linear overflows beyond the end of the buffer, leading to 111 + all kinds of misbehaviors. While `CONFIG_FORTIFY_SOURCE=y` and various 112 + compiler flags help reduce the risk of using this function, there is 113 + no good reason to add new uses of this function. The safe replacement 114 + is strscpy(), though care must be given to any cases where the return 115 + value of strcpy() was used, since strscpy() does not return a pointer to 116 + the destination, but rather a count of non-NUL bytes copied (or negative 117 + errno when it truncates). 115 118 116 119 strncpy() on NUL-terminated strings 117 120 ----------------------------------- 118 - Use of strncpy() does not guarantee that the destination buffer 119 - will be NUL terminated. This can lead to various linear read overflows 120 - and other misbehavior due to the missing termination. It also NUL-pads the 121 - destination buffer if the source contents are shorter than the destination 122 - buffer size, which may be a needless performance penalty for callers using 123 - only NUL-terminated strings. The safe replacement is strscpy(). 124 - (Users of strscpy() still needing NUL-padding should instead 125 - use strscpy_pad().) 121 + Use of strncpy() does not guarantee that the destination buffer will 122 + be NUL terminated. This can lead to various linear read overflows and 123 + other misbehavior due to the missing termination. It also NUL-pads 124 + the destination buffer if the source contents are shorter than the 125 + destination buffer size, which may be a needless performance penalty 126 + for callers using only NUL-terminated strings. The safe replacement is 127 + strscpy(), though care must be given to any cases where the return value 128 + of strncpy() was used, since strscpy() does not return a pointer to the 129 + destination, but rather a count of non-NUL bytes copied (or negative 130 + errno when it truncates). Any cases still needing NUL-padding should 131 + instead use strscpy_pad(). 126 132 127 133 If a caller is using non-NUL-terminated strings, strncpy() can 128 134 still be used, but destinations should be marked with the `__nonstring ··· 137 131 138 132 strlcpy() 139 133 --------- 140 - strlcpy() reads the entire source buffer first, possibly exceeding 141 - the given limit of bytes to copy. This is inefficient and can lead to 142 - linear read overflows if a source string is not NUL-terminated. The 143 - safe replacement is strscpy(). 134 + strlcpy() reads the entire source buffer first (since the return value 135 + is meant to match that of strlen()). This read may exceed the destination 136 + size limit. This is both inefficient and can lead to linear read overflows 137 + if a source string is not NUL-terminated. The safe replacement is strscpy(), 138 + though care must be given to any cases where the return value of strlcpy() 139 + is used, since strscpy() will return negative errno values when it truncates. 144 140 145 141 %p format specifier 146 142 -------------------
+7
Documentation/process/submitting-patches.rst
··· 527 527 understand the subject area and to perform thorough reviews, will normally 528 528 increase the likelihood of your patch getting into the kernel. 529 529 530 + Both Tested-by and Reviewed-by tags, once received on mailing list from tester 531 + or reviewer, should be added by author to the applicable patches when sending 532 + next versions. However if the patch has changed substantially in following 533 + version, these tags might not be applicable anymore and thus should be removed. 534 + Usually removal of someone's Tested-by or Reviewed-by tags should be mentioned 535 + in the patch changelog (after the '---' separator). 536 + 530 537 A Suggested-by: tag indicates that the patch idea is suggested by the person 531 538 named and ensures credit to the person for the idea. Please note that this 532 539 tag should not be added without the reporter's permission, especially if the
+45
Documentation/translations/zh_CN/arm64/hugetlbpage.rst
··· 1 + .. include:: ../disclaimer-zh_CN.rst 2 + 3 + :Original: :ref:`Documentation/arm64/hugetlbpage.rst <hugetlbpage_index>` 4 + 5 + Translator: Bailu Lin <bailu.lin@vivo.com> 6 + 7 + ===================== 8 + ARM64中的 HugeTLBpage 9 + ===================== 10 + 11 + 大页依靠有效利用 TLBs 来提高地址翻译的性能。这取决于以下 12 + 两点 - 13 + 14 + - 大页的大小 15 + - TLBs 支持的条目大小 16 + 17 + ARM64 接口支持2种大页方式。 18 + 19 + 1) pud/pmd 级别的块映射 20 + ----------------------- 21 + 22 + 这是常规大页,他们的 pmd 或 pud 页面表条目指向一个内存块。 23 + 不管 TLB 中支持的条目大小如何,块映射可以减少翻译大页地址 24 + 所需遍历的页表深度。 25 + 26 + 2) 使用连续位 27 + ------------- 28 + 29 + 架构中转换页表条目(D4.5.3, ARM DDI 0487C.a)中提供一个连续 30 + 位告诉 MMU 这个条目是一个连续条目集的一员,它可以被缓存在单 31 + 个 TLB 条目中。 32 + 33 + 在 Linux 中连续位用来增加 pmd 和 pte(最后一级)级别映射的大 34 + 小。受支持的连续页表条目数量因页面大小和页表级别而异。 35 + 36 + 37 + 支持以下大页尺寸配置 - 38 + 39 + ====== ======== ==== ======== === 40 + - CONT PTE PMD CONT PMD PUD 41 + ====== ======== ==== ======== === 42 + 4K: 64K 2M 32M 1G 43 + 16K: 2M 32M 1G 44 + 64K: 2M 512M 16G 45 + ====== ======== ==== ======== ===
+1
Documentation/translations/zh_CN/arm64/index.rst
··· 14 14 :maxdepth: 2 15 15 16 16 amu 17 + hugetlbpage
+1 -1
Documentation/vm/mmu_notifier.rst
··· 89 89 90 90 So here because at time N+2 the clear page table entry was not pair with a 91 91 notification to invalidate the secondary TLB, the device see the new value for 92 - addrB before seing the new value for addrA. This break total memory ordering 92 + addrB before seeing the new value for addrA. This break total memory ordering 93 93 for the device. 94 94 95 95 When changing a pte to write protect or to point to a new write protected page
+1 -1
Documentation/vm/page_migration.rst
··· 99 99 2. Ensure that writeback is complete. 100 100 101 101 3. Lock the new page that we want to move to. It is locked so that accesses to 102 - this (not yet uptodate) page immediately block while the move is in progress. 102 + this (not yet up-to-date) page immediately block while the move is in progress. 103 103 104 104 4. All the page table references to the page are converted to migration 105 105 entries. This decreases the mapcount of a page. If the resulting
+1 -1
Documentation/vm/page_owner.rst
··· 18 18 using it for analyzing who allocate each page is rather complex. We need 19 19 to enlarge the trace buffer for preventing overlapping until userspace 20 20 program launched. And, launched program continually dump out the trace 21 - buffer for later analysis and it would change system behviour with more 21 + buffer for later analysis and it would change system behaviour with more 22 22 possibility rather than just keeping it in memory, so bad for debugging. 23 23 24 24 page owner can also be used for various purposes. For example, accurate
+1 -1
Documentation/vm/slub.rst
··· 378 378 can go unnoticed. To deal with that, ``slabinfo-gnuplot.sh`` has two 379 379 options to 'zoom-in'/'zoom-out': 380 380 381 - a) ``-s %d,%d`` -- overwrites the default image width and heigh 381 + a) ``-s %d,%d`` -- overwrites the default image width and height 382 382 b) ``-r %d,%d`` -- specifies a range of samples to use (for example, 383 383 in ``slabinfo -X >> FOO_STATS; sleep 1;`` case, using a ``-r 384 384 40,60`` range will plot only samples collected between 40th and
+1 -1
Documentation/x86/x86_64/mm.rst
··· 19 19 Note that as we get closer to the top of the address space, the notation changes 20 20 from TB to GB and then MB/KB. 21 21 22 - - "16M TB" might look weird at first sight, but it's an easier to visualize size 22 + - "16M TB" might look weird at first sight, but it's an easier way to visualize size 23 23 notation than "16 EB", which few will recognize at first sight as 16 exabytes. 24 24 It also shows it nicely how incredibly large 64-bit address space is. 25 25