Message ID | 20240408145819.8787-3-mkoutny@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | kernel/pid: Remove default pid_max value | expand |
On Mon, 8 Apr 2024 16:58:18 +0200 Michal Koutný <mkoutny@suse.com> wrote: > The kernel provides mechanisms, while it should not imply policies -- > default pid_max seems to be an example of the policy that does not fit > all. At the same time pid_max must have some value assigned, so use the > end of the allowed range -- pid_max_max. > > This change thus increases initial pid_max from 32k to 4M (x86_64 > defconfig). That seems like a large change. It isn't clear why we'd want to merge this patchset. Does it improve anyone's life and if so, how?
Hi Michal,
kernel test robot noticed the following build warnings:
[auto build test WARNING on fec50db7033ea478773b159e0e2efb135270e3b7]
url: https://github.com/intel-lab-lkp/linux/commits/Michal-Koutn/tracing-Remove-dependency-of-saved_cmdlines_buffer-on-PID_MAX_DEFAULT/20240408-230031
base: fec50db7033ea478773b159e0e2efb135270e3b7
patch link: https://lore.kernel.org/r/20240408145819.8787-3-mkoutny%40suse.com
patch subject: [PATCH 2/3] kernel/pid: Remove default pid_max value
config: alpha-allnoconfig (https://download.01.org/0day-ci/archive/20240409/202404090849.mgJ3z0xI-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240409/202404090849.mgJ3z0xI-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404090849.mgJ3z0xI-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/sysctl.c:1819:35: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1819 | .extra2 = &pid_max_max,
| ^
vim +/const +1819 kernel/sysctl.c
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1617
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1618 static struct ctl_table kern_table[] = {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1619 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1620 .procname = "panic",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1621 .data = &panic_timeout,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1622 .maxlen = sizeof(int),
49f0ce5f92321c Jerome Marchand 2014-01-21 1623 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1624 .proc_handler = proc_dointvec,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1625 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1626 #ifdef CONFIG_PROC_SYSCTL
^1da177e4c3f41 Linus Torvalds 2005-04-16 1627 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1628 .procname = "tainted",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1629 .maxlen = sizeof(long),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1630 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1631 .proc_handler = proc_taint,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1632 },
2da02997e08d3e David Rientjes 2009-01-06 1633 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1634 .procname = "sysctl_writes_strict",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1635 .data = &sysctl_writes_strict,
9e3961a0979817 Prarit Bhargava 2014-12-10 1636 .maxlen = sizeof(int),
2da02997e08d3e David Rientjes 2009-01-06 1637 .mode = 0644,
9e3961a0979817 Prarit Bhargava 2014-12-10 1638 .proc_handler = proc_dointvec_minmax,
78e36f3b0dae58 Xiaoming Ni 2022-01-21 1639 .extra1 = SYSCTL_NEG_ONE,
eec4844fae7c03 Matteo Croce 2019-07-18 1640 .extra2 = SYSCTL_ONE,
2da02997e08d3e David Rientjes 2009-01-06 1641 },
964c9dff009189 Alexander Popov 2018-08-17 1642 #endif
1efff914afac8a Theodore Ts'o 2015-03-17 1643 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1644 .procname = "print-fatal-signals",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1645 .data = &print_fatal_signals,
964c9dff009189 Alexander Popov 2018-08-17 1646 .maxlen = sizeof(int),
1efff914afac8a Theodore Ts'o 2015-03-17 1647 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1648 .proc_handler = proc_dointvec,
1efff914afac8a Theodore Ts'o 2015-03-17 1649 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1650 #ifdef CONFIG_SPARC
^1da177e4c3f41 Linus Torvalds 2005-04-16 1651 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1652 .procname = "reboot-cmd",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1653 .data = reboot_command,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1654 .maxlen = 256,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1655 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1656 .proc_handler = proc_dostring,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1657 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1658 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1659 .procname = "stop-a",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1660 .data = &stop_a_enabled,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1661 .maxlen = sizeof (int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1662 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1663 .proc_handler = proc_dointvec,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1664 },
06808b0827e1cd Lee Schermerhorn 2009-12-14 1665 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1666 .procname = "scons-poweroff",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1667 .data = &scons_pwroff,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1668 .maxlen = sizeof (int),
06808b0827e1cd Lee Schermerhorn 2009-12-14 1669 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1670 .proc_handler = proc_dointvec,
06808b0827e1cd Lee Schermerhorn 2009-12-14 1671 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1672 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1673 #ifdef CONFIG_SPARC64
4518085e127dff Kemi Wang 2017-11-15 1674 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1675 .procname = "tsb-ratio",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1676 .data = &sysctl_tsb_ratio,
4518085e127dff Kemi Wang 2017-11-15 1677 .maxlen = sizeof (int),
4518085e127dff Kemi Wang 2017-11-15 1678 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1679 .proc_handler = proc_dointvec,
4518085e127dff Kemi Wang 2017-11-15 1680 },
06808b0827e1cd Lee Schermerhorn 2009-12-14 1681 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1682 #ifdef CONFIG_PARISC
^1da177e4c3f41 Linus Torvalds 2005-04-16 1683 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1684 .procname = "soft-power",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1685 .data = &pwrsw_enabled,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1686 .maxlen = sizeof (int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1687 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1688 .proc_handler = proc_dointvec,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1689 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1690 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1691 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
d1c3fb1f8f29c4 Nishanth Aravamudan 2007-12-17 1692 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1693 .procname = "unaligned-trap",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1694 .data = &unaligned_enabled,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1695 .maxlen = sizeof (int),
d1c3fb1f8f29c4 Nishanth Aravamudan 2007-12-17 1696 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1697 .proc_handler = proc_dointvec,
d1c3fb1f8f29c4 Nishanth Aravamudan 2007-12-17 1698 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1699 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1700 #ifdef CONFIG_STACK_TRACER
76ab0f530e4a01 Mel Gorman 2010-05-24 1701 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1702 .procname = "stack_tracer_enabled",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1703 .data = &stack_tracer_enabled,
76ab0f530e4a01 Mel Gorman 2010-05-24 1704 .maxlen = sizeof(int),
2da02997e08d3e David Rientjes 2009-01-06 1705 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1706 .proc_handler = stack_trace_sysctl,
76ab0f530e4a01 Mel Gorman 2010-05-24 1707 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1708 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1709 #ifdef CONFIG_TRACING
5e7719058079a1 Mel Gorman 2010-05-24 1710 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1711 .procname = "ftrace_dump_on_oops",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1712 .data = &ftrace_dump_on_oops,
19f0423fd55c30 Huang Yiwei 2024-02-23 1713 .maxlen = MAX_TRACER_SIZE,
5e7719058079a1 Mel Gorman 2010-05-24 1714 .mode = 0644,
19f0423fd55c30 Huang Yiwei 2024-02-23 1715 .proc_handler = proc_dostring,
5e7719058079a1 Mel Gorman 2010-05-24 1716 },
5bbe3547aa3ba5 Eric B Munson 2015-04-15 1717 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1718 .procname = "traceoff_on_warning",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1719 .data = &__disable_trace_on_warning,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1720 .maxlen = sizeof(__disable_trace_on_warning),
5bbe3547aa3ba5 Eric B Munson 2015-04-15 1721 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1722 .proc_handler = proc_dointvec,
5bbe3547aa3ba5 Eric B Munson 2015-04-15 1723 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1724 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1725 .procname = "tracepoint_printk",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1726 .data = &tracepoint_printk,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1727 .maxlen = sizeof(tracepoint_printk),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1728 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1729 .proc_handler = tracepoint_printk_sysctl,
1c30844d2dfe27 Mel Gorman 2018-12-28 1730 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1731 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1732 #ifdef CONFIG_MODULES
8ad4b1fb820534 Rohit Seth 2006-01-08 1733 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1734 .procname = "modprobe",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1735 .data = &modprobe_path,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1736 .maxlen = KMOD_PATH_LEN,
8ad4b1fb820534 Rohit Seth 2006-01-08 1737 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1738 .proc_handler = proc_dostring,
8ad4b1fb820534 Rohit Seth 2006-01-08 1739 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1740 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1741 .procname = "modules_disabled",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1742 .data = &modules_disabled,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1743 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1744 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1745 /* only handle a transition from default "0" to "1" */
3e26120cc7c819 WANG Cong 2009-12-17 1746 .proc_handler = proc_dointvec_minmax,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1747 .extra1 = SYSCTL_ONE,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1748 .extra2 = SYSCTL_ONE,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1749 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1750 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1751 #ifdef CONFIG_UEVENT_HELPER
dd8632a12e500a Paul Mundt 2009-01-08 1752 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1753 .procname = "hotplug",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1754 .data = &uevent_helper,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1755 .maxlen = UEVENT_HELPER_PATH_LEN,
dd8632a12e500a Paul Mundt 2009-01-08 1756 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1757 .proc_handler = proc_dostring,
dd8632a12e500a Paul Mundt 2009-01-08 1758 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1759 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1760 #ifdef CONFIG_MAGIC_SYSRQ
^1da177e4c3f41 Linus Torvalds 2005-04-16 1761 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1762 .procname = "sysrq",
e5ff215941d59f Andi Kleen 2008-07-23 1763 .data = NULL,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1764 .maxlen = sizeof (int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1765 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1766 .proc_handler = sysrq_sysctl_handler,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1767 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1768 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1769 #ifdef CONFIG_PROC_SYSCTL
^1da177e4c3f41 Linus Torvalds 2005-04-16 1770 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1771 .procname = "cad_pid",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1772 .data = NULL,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1773 .maxlen = sizeof (int),
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1774 .mode = 0600,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1775 .proc_handler = proc_do_cad_pid,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1776 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1777 #endif
9d0243bca345d5 Andrew Morton 2006-01-08 1778 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1779 .procname = "threads-max",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1780 .data = NULL,
9d0243bca345d5 Andrew Morton 2006-01-08 1781 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1782 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1783 .proc_handler = sysctl_max_threads,
9d0243bca345d5 Andrew Morton 2006-01-08 1784 },
1743660b911bfb Christoph Lameter 2006-01-18 1785 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1786 .procname = "overflowuid",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1787 .data = &overflowuid,
5e7719058079a1 Mel Gorman 2010-05-24 1788 .maxlen = sizeof(int),
1743660b911bfb Christoph Lameter 2006-01-18 1789 .mode = 0644,
6b7e5cad651a2b Matthew Wilcox 2019-03-05 1790 .proc_handler = proc_dointvec_minmax,
2452dcb9f7f2ba Xiaoming Ni 2022-01-21 1791 .extra1 = SYSCTL_ZERO,
54771613e8a7db Luis Chamberlain 2022-01-21 1792 .extra2 = SYSCTL_MAXOLDUID,
1743660b911bfb Christoph Lameter 2006-01-18 1793 },
9614634fe6a138 Christoph Lameter 2006-07-03 1794 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1795 .procname = "overflowgid",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1796 .data = &overflowgid,
5bbe3547aa3ba5 Eric B Munson 2015-04-15 1797 .maxlen = sizeof(int),
9614634fe6a138 Christoph Lameter 2006-07-03 1798 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1799 .proc_handler = proc_dointvec_minmax,
2452dcb9f7f2ba Xiaoming Ni 2022-01-21 1800 .extra1 = SYSCTL_ZERO,
54771613e8a7db Luis Chamberlain 2022-01-21 1801 .extra2 = SYSCTL_MAXOLDUID,
9614634fe6a138 Christoph Lameter 2006-07-03 1802 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1803 #ifdef CONFIG_S390
0ff38490c836dc Christoph Lameter 2006-09-25 1804 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1805 .procname = "userprocess_debug",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1806 .data = &show_unhandled_signals,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1807 .maxlen = sizeof(int),
0ff38490c836dc Christoph Lameter 2006-09-25 1808 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1809 .proc_handler = proc_dointvec,
0ff38490c836dc Christoph Lameter 2006-09-25 1810 },
e6e5494cb23d19 Ingo Molnar 2006-06-27 1811 #endif
77461ab33229d4 Christoph Lameter 2007-05-09 1812 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1813 .procname = "pid_max",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1814 .data = &pid_max,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1815 .maxlen = sizeof (int),
77461ab33229d4 Christoph Lameter 2007-05-09 1816 .mode = 0644,
26363af5643490 Christoph Hellwig 2020-04-24 1817 .proc_handler = proc_dointvec_minmax,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1818 .extra1 = &pid_max_min,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 @1819 .extra2 = &pid_max_max,
77461ab33229d4 Christoph Lameter 2007-05-09 1820 },
52b6f46bc163ee Hugh Dickins 2016-05-19 1821 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1822 .procname = "panic_on_oops",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1823 .data = &panic_on_oops,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1824 .maxlen = sizeof(int),
795ae7a0de6b83 Johannes Weiner 2016-03-17 1825 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1826 .proc_handler = proc_dointvec,
52b6f46bc163ee Hugh Dickins 2016-05-19 1827 },
ed0321895182ff Eric Paris 2007-06-28 1828 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1829 .procname = "panic_print",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1830 .data = &panic_print,
ed0321895182ff Eric Paris 2007-06-28 1831 .maxlen = sizeof(unsigned long),
ed0321895182ff Eric Paris 2007-06-28 1832 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1833 .proc_handler = proc_doulongvec_minmax,
ed0321895182ff Eric Paris 2007-06-28 1834 },
c9b1d0981fcce3 Andrew Shewmaker 2013-04-29 1835 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1836 .procname = "ngroups_max",
f628867da46f88 Stephen Kitt 2022-01-21 1837 .data = (void *)&ngroups_max,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1838 .maxlen = sizeof (int),
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1839 .mode = 0444,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1840 .proc_handler = proc_dointvec,
1743660b911bfb Christoph Lameter 2006-01-18 1841 },
9614634fe6a138 Christoph Lameter 2006-07-03 1842 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1843 .procname = "cap_last_cap",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1844 .data = (void *)&cap_last_cap,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1845 .maxlen = sizeof(int),
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1846 .mode = 0444,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1847 .proc_handler = proc_dointvec,
9614634fe6a138 Christoph Lameter 2006-07-03 1848 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1849 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1850 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1851 .procname = "unknown_nmi_panic",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1852 .data = &unknown_nmi_panic,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1853 .maxlen = sizeof (int),
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1854 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1855 .proc_handler = proc_dointvec,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1856 },
6a46079cf57a7f Andi Kleen 2009-09-16 1857 #endif
cb8e59cc87201a Linus Torvalds 2020-06-03 1858
Hi Michal,
kernel test robot noticed the following build errors:
[auto build test ERROR on fec50db7033ea478773b159e0e2efb135270e3b7]
url: https://github.com/intel-lab-lkp/linux/commits/Michal-Koutn/tracing-Remove-dependency-of-saved_cmdlines_buffer-on-PID_MAX_DEFAULT/20240408-230031
base: fec50db7033ea478773b159e0e2efb135270e3b7
patch link: https://lore.kernel.org/r/20240408145819.8787-3-mkoutny%40suse.com
patch subject: [PATCH 2/3] kernel/pid: Remove default pid_max value
config: arm-allnoconfig (https://download.01.org/0day-ci/archive/20240409/202404090903.3Jz667sn-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 8b3b4a92adee40483c27f26c478a384cd69c6f05)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240409/202404090903.3Jz667sn-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404090903.3Jz667sn-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from kernel/sysctl.c:23:
In file included from include/linux/mm.h:2208:
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> kernel/sysctl.c:1819:14: error: initializing 'void *' with an expression of type 'const int *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
1819 | .extra2 = &pid_max_max,
| ^~~~~~~~~~~~
1 warning and 1 error generated.
vim +1819 kernel/sysctl.c
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1617
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1618 static struct ctl_table kern_table[] = {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1619 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1620 .procname = "panic",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1621 .data = &panic_timeout,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1622 .maxlen = sizeof(int),
49f0ce5f92321c Jerome Marchand 2014-01-21 1623 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1624 .proc_handler = proc_dointvec,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1625 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1626 #ifdef CONFIG_PROC_SYSCTL
^1da177e4c3f41 Linus Torvalds 2005-04-16 1627 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1628 .procname = "tainted",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1629 .maxlen = sizeof(long),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1630 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1631 .proc_handler = proc_taint,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1632 },
2da02997e08d3e David Rientjes 2009-01-06 1633 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1634 .procname = "sysctl_writes_strict",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1635 .data = &sysctl_writes_strict,
9e3961a0979817 Prarit Bhargava 2014-12-10 1636 .maxlen = sizeof(int),
2da02997e08d3e David Rientjes 2009-01-06 1637 .mode = 0644,
9e3961a0979817 Prarit Bhargava 2014-12-10 1638 .proc_handler = proc_dointvec_minmax,
78e36f3b0dae58 Xiaoming Ni 2022-01-21 1639 .extra1 = SYSCTL_NEG_ONE,
eec4844fae7c03 Matteo Croce 2019-07-18 1640 .extra2 = SYSCTL_ONE,
2da02997e08d3e David Rientjes 2009-01-06 1641 },
964c9dff009189 Alexander Popov 2018-08-17 1642 #endif
1efff914afac8a Theodore Ts'o 2015-03-17 1643 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1644 .procname = "print-fatal-signals",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1645 .data = &print_fatal_signals,
964c9dff009189 Alexander Popov 2018-08-17 1646 .maxlen = sizeof(int),
1efff914afac8a Theodore Ts'o 2015-03-17 1647 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1648 .proc_handler = proc_dointvec,
1efff914afac8a Theodore Ts'o 2015-03-17 1649 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1650 #ifdef CONFIG_SPARC
^1da177e4c3f41 Linus Torvalds 2005-04-16 1651 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1652 .procname = "reboot-cmd",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1653 .data = reboot_command,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1654 .maxlen = 256,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1655 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1656 .proc_handler = proc_dostring,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1657 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1658 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1659 .procname = "stop-a",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1660 .data = &stop_a_enabled,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1661 .maxlen = sizeof (int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1662 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1663 .proc_handler = proc_dointvec,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1664 },
06808b0827e1cd Lee Schermerhorn 2009-12-14 1665 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1666 .procname = "scons-poweroff",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1667 .data = &scons_pwroff,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1668 .maxlen = sizeof (int),
06808b0827e1cd Lee Schermerhorn 2009-12-14 1669 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1670 .proc_handler = proc_dointvec,
06808b0827e1cd Lee Schermerhorn 2009-12-14 1671 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1672 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1673 #ifdef CONFIG_SPARC64
4518085e127dff Kemi Wang 2017-11-15 1674 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1675 .procname = "tsb-ratio",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1676 .data = &sysctl_tsb_ratio,
4518085e127dff Kemi Wang 2017-11-15 1677 .maxlen = sizeof (int),
4518085e127dff Kemi Wang 2017-11-15 1678 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1679 .proc_handler = proc_dointvec,
4518085e127dff Kemi Wang 2017-11-15 1680 },
06808b0827e1cd Lee Schermerhorn 2009-12-14 1681 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1682 #ifdef CONFIG_PARISC
^1da177e4c3f41 Linus Torvalds 2005-04-16 1683 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1684 .procname = "soft-power",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1685 .data = &pwrsw_enabled,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1686 .maxlen = sizeof (int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1687 .mode = 0644,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1688 .proc_handler = proc_dointvec,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1689 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1690 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1691 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
d1c3fb1f8f29c4 Nishanth Aravamudan 2007-12-17 1692 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1693 .procname = "unaligned-trap",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1694 .data = &unaligned_enabled,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1695 .maxlen = sizeof (int),
d1c3fb1f8f29c4 Nishanth Aravamudan 2007-12-17 1696 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1697 .proc_handler = proc_dointvec,
d1c3fb1f8f29c4 Nishanth Aravamudan 2007-12-17 1698 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1699 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1700 #ifdef CONFIG_STACK_TRACER
76ab0f530e4a01 Mel Gorman 2010-05-24 1701 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1702 .procname = "stack_tracer_enabled",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1703 .data = &stack_tracer_enabled,
76ab0f530e4a01 Mel Gorman 2010-05-24 1704 .maxlen = sizeof(int),
2da02997e08d3e David Rientjes 2009-01-06 1705 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1706 .proc_handler = stack_trace_sysctl,
76ab0f530e4a01 Mel Gorman 2010-05-24 1707 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1708 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1709 #ifdef CONFIG_TRACING
5e7719058079a1 Mel Gorman 2010-05-24 1710 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1711 .procname = "ftrace_dump_on_oops",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1712 .data = &ftrace_dump_on_oops,
19f0423fd55c30 Huang Yiwei 2024-02-23 1713 .maxlen = MAX_TRACER_SIZE,
5e7719058079a1 Mel Gorman 2010-05-24 1714 .mode = 0644,
19f0423fd55c30 Huang Yiwei 2024-02-23 1715 .proc_handler = proc_dostring,
5e7719058079a1 Mel Gorman 2010-05-24 1716 },
5bbe3547aa3ba5 Eric B Munson 2015-04-15 1717 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1718 .procname = "traceoff_on_warning",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1719 .data = &__disable_trace_on_warning,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1720 .maxlen = sizeof(__disable_trace_on_warning),
5bbe3547aa3ba5 Eric B Munson 2015-04-15 1721 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1722 .proc_handler = proc_dointvec,
5bbe3547aa3ba5 Eric B Munson 2015-04-15 1723 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1724 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1725 .procname = "tracepoint_printk",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1726 .data = &tracepoint_printk,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1727 .maxlen = sizeof(tracepoint_printk),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1728 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1729 .proc_handler = tracepoint_printk_sysctl,
1c30844d2dfe27 Mel Gorman 2018-12-28 1730 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1731 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1732 #ifdef CONFIG_MODULES
8ad4b1fb820534 Rohit Seth 2006-01-08 1733 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1734 .procname = "modprobe",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1735 .data = &modprobe_path,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1736 .maxlen = KMOD_PATH_LEN,
8ad4b1fb820534 Rohit Seth 2006-01-08 1737 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1738 .proc_handler = proc_dostring,
8ad4b1fb820534 Rohit Seth 2006-01-08 1739 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1740 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1741 .procname = "modules_disabled",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1742 .data = &modules_disabled,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1743 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1744 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1745 /* only handle a transition from default "0" to "1" */
3e26120cc7c819 WANG Cong 2009-12-17 1746 .proc_handler = proc_dointvec_minmax,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1747 .extra1 = SYSCTL_ONE,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1748 .extra2 = SYSCTL_ONE,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1749 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1750 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1751 #ifdef CONFIG_UEVENT_HELPER
dd8632a12e500a Paul Mundt 2009-01-08 1752 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1753 .procname = "hotplug",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1754 .data = &uevent_helper,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1755 .maxlen = UEVENT_HELPER_PATH_LEN,
dd8632a12e500a Paul Mundt 2009-01-08 1756 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1757 .proc_handler = proc_dostring,
dd8632a12e500a Paul Mundt 2009-01-08 1758 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1759 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1760 #ifdef CONFIG_MAGIC_SYSRQ
^1da177e4c3f41 Linus Torvalds 2005-04-16 1761 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1762 .procname = "sysrq",
e5ff215941d59f Andi Kleen 2008-07-23 1763 .data = NULL,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1764 .maxlen = sizeof (int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1765 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1766 .proc_handler = sysrq_sysctl_handler,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1767 },
^1da177e4c3f41 Linus Torvalds 2005-04-16 1768 #endif
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1769 #ifdef CONFIG_PROC_SYSCTL
^1da177e4c3f41 Linus Torvalds 2005-04-16 1770 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1771 .procname = "cad_pid",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1772 .data = NULL,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1773 .maxlen = sizeof (int),
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1774 .mode = 0600,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1775 .proc_handler = proc_do_cad_pid,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1776 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1777 #endif
9d0243bca345d5 Andrew Morton 2006-01-08 1778 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1779 .procname = "threads-max",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1780 .data = NULL,
9d0243bca345d5 Andrew Morton 2006-01-08 1781 .maxlen = sizeof(int),
^1da177e4c3f41 Linus Torvalds 2005-04-16 1782 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1783 .proc_handler = sysctl_max_threads,
9d0243bca345d5 Andrew Morton 2006-01-08 1784 },
1743660b911bfb Christoph Lameter 2006-01-18 1785 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1786 .procname = "overflowuid",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1787 .data = &overflowuid,
5e7719058079a1 Mel Gorman 2010-05-24 1788 .maxlen = sizeof(int),
1743660b911bfb Christoph Lameter 2006-01-18 1789 .mode = 0644,
6b7e5cad651a2b Matthew Wilcox 2019-03-05 1790 .proc_handler = proc_dointvec_minmax,
2452dcb9f7f2ba Xiaoming Ni 2022-01-21 1791 .extra1 = SYSCTL_ZERO,
54771613e8a7db Luis Chamberlain 2022-01-21 1792 .extra2 = SYSCTL_MAXOLDUID,
1743660b911bfb Christoph Lameter 2006-01-18 1793 },
9614634fe6a138 Christoph Lameter 2006-07-03 1794 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1795 .procname = "overflowgid",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1796 .data = &overflowgid,
5bbe3547aa3ba5 Eric B Munson 2015-04-15 1797 .maxlen = sizeof(int),
9614634fe6a138 Christoph Lameter 2006-07-03 1798 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1799 .proc_handler = proc_dointvec_minmax,
2452dcb9f7f2ba Xiaoming Ni 2022-01-21 1800 .extra1 = SYSCTL_ZERO,
54771613e8a7db Luis Chamberlain 2022-01-21 1801 .extra2 = SYSCTL_MAXOLDUID,
9614634fe6a138 Christoph Lameter 2006-07-03 1802 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1803 #ifdef CONFIG_S390
0ff38490c836dc Christoph Lameter 2006-09-25 1804 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1805 .procname = "userprocess_debug",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1806 .data = &show_unhandled_signals,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1807 .maxlen = sizeof(int),
0ff38490c836dc Christoph Lameter 2006-09-25 1808 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1809 .proc_handler = proc_dointvec,
0ff38490c836dc Christoph Lameter 2006-09-25 1810 },
e6e5494cb23d19 Ingo Molnar 2006-06-27 1811 #endif
77461ab33229d4 Christoph Lameter 2007-05-09 1812 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1813 .procname = "pid_max",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1814 .data = &pid_max,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1815 .maxlen = sizeof (int),
77461ab33229d4 Christoph Lameter 2007-05-09 1816 .mode = 0644,
26363af5643490 Christoph Hellwig 2020-04-24 1817 .proc_handler = proc_dointvec_minmax,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1818 .extra1 = &pid_max_min,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 @1819 .extra2 = &pid_max_max,
77461ab33229d4 Christoph Lameter 2007-05-09 1820 },
52b6f46bc163ee Hugh Dickins 2016-05-19 1821 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1822 .procname = "panic_on_oops",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1823 .data = &panic_on_oops,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1824 .maxlen = sizeof(int),
795ae7a0de6b83 Johannes Weiner 2016-03-17 1825 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1826 .proc_handler = proc_dointvec,
52b6f46bc163ee Hugh Dickins 2016-05-19 1827 },
ed0321895182ff Eric Paris 2007-06-28 1828 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1829 .procname = "panic_print",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1830 .data = &panic_print,
ed0321895182ff Eric Paris 2007-06-28 1831 .maxlen = sizeof(unsigned long),
ed0321895182ff Eric Paris 2007-06-28 1832 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1833 .proc_handler = proc_doulongvec_minmax,
ed0321895182ff Eric Paris 2007-06-28 1834 },
c9b1d0981fcce3 Andrew Shewmaker 2013-04-29 1835 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1836 .procname = "ngroups_max",
f628867da46f88 Stephen Kitt 2022-01-21 1837 .data = (void *)&ngroups_max,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1838 .maxlen = sizeof (int),
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1839 .mode = 0444,
6d4561110a3e9f Eric W. Biederman 2009-11-16 1840 .proc_handler = proc_dointvec,
1743660b911bfb Christoph Lameter 2006-01-18 1841 },
9614634fe6a138 Christoph Lameter 2006-07-03 1842 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1843 .procname = "cap_last_cap",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1844 .data = (void *)&cap_last_cap,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1845 .maxlen = sizeof(int),
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1846 .mode = 0444,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1847 .proc_handler = proc_dointvec,
9614634fe6a138 Christoph Lameter 2006-07-03 1848 },
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1849 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1850 {
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1851 .procname = "unknown_nmi_panic",
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1852 .data = &unknown_nmi_panic,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1853 .maxlen = sizeof (int),
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1854 .mode = 0644,
f461d2dcd511c0 Christoph Hellwig 2020-04-24 1855 .proc_handler = proc_dointvec,
^1da177e4c3f41 Linus Torvalds 2005-04-16 1856 },
6a46079cf57a7f Andi Kleen 2009-09-16 1857 #endif
cb8e59cc87201a Linus Torvalds 2020-06-03 1858
Hello. On Mon, Apr 08, 2024 at 01:29:55PM -0700, Andrew Morton <akpm@linux-foundation.org> wrote: > That seems like a large change. In what sense is it large? I tried to lookup the code parts that depend on this default and either add the other patches or mention the impact (that part could be more thorough) in the commit message. > It isn't clear why we'd want to merge this patchset. Does it improve > anyone's life and if so, how? - kernel devs who don't care about policy - policy should be decided by distros/users, not in kernel - users who need many threads - current default is too low - this is one more place to look at when configuring - users who want to prevent fork-bombs - current default is ineffective (too high), false feeling of safety - i.e. they should configure appropriate mechanism appropriately I thought that the first point alone would be convincing and that only scaling impact might need clarification. Regards, Michal
On Thu, 11 Apr 2024 17:40:02 +0200 Michal Koutný <mkoutny@suse.com> wrote: > Hello. > > On Mon, Apr 08, 2024 at 01:29:55PM -0700, Andrew Morton <akpm@linux-foundation.org> wrote: > > That seems like a large change. > > In what sense is it large? A large increase in the maximum number of processes. Or did I misinterpret?
On Thu, Apr 11, 2024 at 03:03:31PM -0700, Andrew Morton <akpm@linux-foundation.org> wrote: > A large increase in the maximum number of processes. The change from (some) default to effective infinity is the crux of the change. Because that is only a number. (Thus I don't find the number's 12700% increase alone a big change.) Actual maximum amount of processes is "workload dependent" and hence should be determined based on the particular workload. > Or did I misinterpret? I thought you saw an issue with projection of that number into sizings based on the default. Which of them comprises the large change in your eyes? Thanks, Michal
On Mon, Apr 08, 2024 at 04:58:18PM GMT, Michal Koutný <mkoutny@suse.com> wrote: > The kernel provides mechanisms, while it should not imply policies -- > default pid_max seems to be an example of the policy that does not fit > all. At the same time pid_max must have some value assigned, so use the > end of the allowed range -- pid_max_max. > > This change thus increases initial pid_max from 32k to 4M (x86_64 > defconfig). Out of curiosity I dug out the commit acdc721fe26d ("[PATCH] pid-max-2.5.33-A0") v2.5.34~5 that introduced the 32k default. The commit message doesn't say why such a sudden change though. Previously, the limit was 1G of pids (i.e. effectively no default limit like the intention of this series). Honestly, I expected more enthusiasm or reasons against removing the default value of pid_max. Is this really not of interest to anyone? (Thanks, Andrew, for your responses. I don't plan to pursue this further should there be no more interest in having less default limit values in kernel.) Regards, Michal
diff --git a/include/linux/pid.h b/include/linux/pid.h index a3aad9b4074c..0d191ac02958 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -106,8 +106,8 @@ extern void exchange_tids(struct task_struct *task, struct task_struct *old); extern void transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type); -extern int pid_max; -extern int pid_max_min, pid_max_max; +extern int pid_max_min, pid_max; +extern const int pid_max_max; /* * look up a PID in the hash table. Must be called with the tasklist_lock diff --git a/include/linux/threads.h b/include/linux/threads.h index c34173e6c5f1..43f8f38a0c13 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h @@ -22,25 +22,18 @@ #define MIN_THREADS_LEFT_FOR_ROOT 4 -/* - * This controls the default maximum pid allocated to a process - */ -#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) - /* * A maximum of 4 million PIDs should be enough for a while. * [NOTE: PID/TIDs are limited to 2^30 ~= 1 billion, see FUTEX_TID_MASK.] */ #define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ - (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) + (sizeof(long) > 4 ? 4 * 1024 * 1024 : 0x8000)) /* - * Define a minimum number of pids per cpu. Heuristically based - * on original pid max of 32k for 32 cpus. Also, increase the - * minimum settable value for pid_max on the running system based - * on similar defaults. See kernel/pid.c:pid_idr_init() for details. + * Define a minimum number of pids per cpu. Mainly to accommodate + * smpboot_register_percpu_thread() kernel threads. + * See kernel/pid.c:pid_idr_init() for details. */ -#define PIDS_PER_CPU_DEFAULT 1024 #define PIDS_PER_CPU_MIN 8 #endif diff --git a/kernel/pid.c b/kernel/pid.c index da76ed1873f7..24ae505ac3b0 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -60,10 +60,10 @@ struct pid init_struct_pid = { }, } }; -int pid_max = PID_MAX_DEFAULT; +int pid_max = PID_MAX_LIMIT; int pid_max_min = RESERVED_PIDS + 1; -int pid_max_max = PID_MAX_LIMIT; +const int pid_max_max = PID_MAX_LIMIT; /* * Pseudo filesystems start inode numbering after one. We use Reserved * PIDs as a natural offset. @@ -652,9 +652,7 @@ void __init pid_idr_init(void) /* Verify no one has done anything silly: */ BUILD_BUG_ON(PID_MAX_LIMIT >= PIDNS_ADDING); - /* bump default and minimum pid_max based on number of cpus */ - pid_max = min(pid_max_max, max_t(int, pid_max, - PIDS_PER_CPU_DEFAULT * num_possible_cpus())); + /* bump minimum pid_max based on number of cpus */ pid_max_min = max_t(int, pid_max_min, PIDS_PER_CPU_MIN * num_possible_cpus()); pr_info("pid_max: default: %u minimum: %u\n", pid_max, pid_max_min);
pid_max is a per-pidns (thus global too) limit on a number of tasks the kernel admits. The knob can be configured by admin in the range between pid_max_min and pid_max_max (sic). The default value sits between those and it typically equals max(32k, 1k*nr_cpus). The nr_cpu scaling was introduced in commit 72680a191b93 ("pids: increase pid_max based on num_possible_cpus") to accommodate kernel's own helper tasks (before workqueues). Generally, 1024 tasks/cpu cap is too much if they were all running and it is also too little when they are idle (memory being bottleneck). The kernel also provides other mechanisms to restrict number of tasks -- threads-max sysctl and RLIMIT_NPROC with memory-scaled defaults and generic pids cgroup controller (the last one being the solution of fork-bombs, with qualified limits set up by admin). The kernel provides mechanisms, while it should not imply policies -- default pid_max seems to be an example of the policy that does not fit all. At the same time pid_max must have some value assigned, so use the end of the allowed range -- pid_max_max. This change thus increases initial pid_max from 32k to 4M (x86_64 defconfig). This has effect on size of structure that alloc_pid/idr_alloc_cyclic eventually uses and structure that kernel tracing uses with 'record-tgid' (~16 MiB). Signed-off-by: Michal Koutný <mkoutny@suse.com> --- include/linux/pid.h | 4 ++-- include/linux/threads.h | 15 ++++----------- kernel/pid.c | 8 +++----- 3 files changed, 9 insertions(+), 18 deletions(-)