Skip to content
Snippets Groups Projects
  1. Jun 25, 2023
  2. Jun 16, 2023
  3. Jun 10, 2023
    • Angus Chen's avatar
      init: add bdev fs printk if mount_block_root failed · 6aee6723
      Angus Chen authored
      Booting with the QEMU command line:
      "qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..."
      will panic if ext4 is not builtin and a request to load the ext4 module
      fails.
      
      [    1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19
      [    1.730603] Please append a correct "root=" boot option; here are the available partitions:
      [    1.732323] fd00          256000 vda
      [    1.732329]  driver: virtio_blk
      [    1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0)
      [    1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53
      [    1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1 04/01/2014
      [    1.735772] Call Trace:
      [    1.735950]  <TASK>
      [    1.736113]  dump_stack_lvl+0x32/0x50
      [    1.736367]  panic+0x108/0x310
      [    1.736570]  mount_block_root+0x161/0x310
      [    1.736849]  ? rdinit_setup+0x40/0x40
      [    1.737088]  prepare_namespace+0x10c/0x180
      [    1.737393]  kernel_init_freeable+0x354/0x450
      [    1.737707]  ? rest_init+0xd0/0xd0
      [    1.737945]  kernel_init+0x16/0x130
      [    1.738196]  ret_from_fork+0x1f/0x30
      
      As a hint, print all the bdev fstypes which are available.
      
      [akpm@linux-foundation.org: fix spelling in printk message]
      Link: https://lkml.kernel.org/r/20230518035321.1672-1-angus.chen@jaguarmicro.com
      
      
      Signed-off-by: default avatarAngus Chen <angus.chen@jaguarmicro.com>
      Acked-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Mike Rapoport (IBM) <rppt@kernel.org>
      Cc: Paul E. McKenney <paulmck@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6aee6723
    • Arnd Bergmann's avatar
      init: move cifs_root_data() prototype into linux/mount.h · 73648e6f
      Arnd Bergmann authored
      cifs_root_data() is defined in cifs and called from early init code, but
      lacks a global prototype:
      
      fs/cifs/cifsroot.c:83:12: error: no previous prototype for 'cifs_root_data'
      
      Move the declaration from do_mounts.c into an appropriate header.
      
      Link: https://lkml.kernel.org/r/20230517131102.934196-13-arnd@kernel.org
      
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Dennis Zhou <dennis@kernel.org>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Moore <paul@paul-moore.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rafael J. Wysocki <rafael@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <longman@redhat.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      73648e6f
    • Arnd Bergmann's avatar
      init: consolidate prototypes in linux/init.h · ad1a4830
      Arnd Bergmann authored
      The init/main.c file contains some extern declarations for functions
      defined in architecture code, and it defines some other functions that are
      called from architecture code with a custom prototype.  Both of those
      result in warnings with 'make W=1':
      
      init/calibrate.c:261:37: error: no previous prototype for 'calibrate_delay_is_known' [-Werror=missing-prototypes]
      init/main.c:790:20: error: no previous prototype for 'mem_encrypt_init' [-Werror=missing-prototypes]
      init/main.c:792:20: error: no previous prototype for 'poking_init' [-Werror=missing-prototypes]
      arch/arm64/kernel/irq.c:122:13: error: no previous prototype for 'init_IRQ' [-Werror=missing-prototypes]
      arch/arm64/kernel/time.c:55:13: error: no previous prototype for 'time_init' [-Werror=missing-prototypes]
      arch/x86/kernel/process.c:935:13: error: no previous prototype for 'arch_post_acpi_subsys_init' [-Werror=missing-prototypes]
      init/calibrate.c:261:37: error: no previous prototype for 'calibrate_delay_is_known' [-Werror=missing-prototypes]
      kernel/fork.c:991:20: error: no previous prototype for 'arch_task_cache_init' [-Werror=missing-prototypes]
      
      Add prototypes for all of these in include/linux/init.h or another
      appropriate header, and remove the duplicate declarations from
      architecture specific code.
      
      [sfr@canb.auug.org.au: declare time_init_early()]
        Link: https://lkml.kernel.org/r/20230519124311.5167221c@canb.auug.org.au
      Link: https://lkml.kernel.org/r/20230517131102.934196-12-arnd@kernel.org
      
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Dennis Zhou <dennis@kernel.org>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Moore <paul@paul-moore.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rafael J. Wysocki <rafael@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <longman@redhat.com>
      Cc: Will Deacon <will@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      ad1a4830
  4. Jun 09, 2023
    • Nhat Pham's avatar
      cachestat: implement cachestat syscall · cf264e13
      Nhat Pham authored
      There is currently no good way to query the page cache state of large file
      sets and directory trees.  There is mincore(), but it scales poorly: the
      kernel writes out a lot of bitmap data that userspace has to aggregate,
      when the user really doesn not care about per-page information in that
      case.  The user also needs to mmap and unmap each file as it goes along,
      which can be quite slow as well.
      
      Some use cases where this information could come in handy:
        * Allowing database to decide whether to perform an index scan or
          direct table queries based on the in-memory cache state of the
          index.
        * Visibility into the writeback algorithm, for performance issues
          diagnostic.
        * Workload-aware writeback pacing: estimating IO fulfilled by page
          cache (and IO to be done) within a range of a file, allowing for
          more frequent syncing when and where there is IO capacity, and
          batching when there is not.
        * Computing memory usage of large files/directory trees, analogous to
          the du tool for disk usage.
      
      More information about these use cases could be found in the following
      thread:
      
      https://lore.kernel.org/lkml/20230315170934.GA97793@cmpxchg.org/
      
      This patch implements a new syscall that queries cache state of a file and
      summarizes the number of cached pages, number of dirty pages, number of
      pages marked for writeback, number of (recently) evicted pages, etc.  in a
      given range.  Currently, the syscall is only wired in for x86
      architecture.
      
      NAME
          cachestat - query the page cache statistics of a file.
      
      SYNOPSIS
          #include <sys/mman.h>
      
          struct cachestat_range {
              __u64 off;
              __u64 len;
          };
      
          struct cachestat {
              __u64 nr_cache;
              __u64 nr_dirty;
              __u64 nr_writeback;
              __u64 nr_evicted;
              __u64 nr_recently_evicted;
          };
      
          int cachestat(unsigned int fd, struct cachestat_range *cstat_range,
              struct cachestat *cstat, unsigned int flags);
      
      DESCRIPTION
          cachestat() queries the number of cached pages, number of dirty
          pages, number of pages marked for writeback, number of evicted
          pages, number of recently evicted pages, in the bytes range given by
          `off` and `len`.
      
          An evicted page is a page that is previously in the page cache but
          has been evicted since. A page is recently evicted if its last
          eviction was recent enough that its reentry to the cache would
          indicate that it is actively being used by the system, and that
          there is memory pressure on the system.
      
          These values are returned in a cachestat struct, whose address is
          given by the `cstat` argument.
      
          The `off` and `len` arguments must be non-negative integers. If
          `len` > 0, the queried range is [`off`, `off` + `len`]. If `len` ==
          0, we will query in the range from `off` to the end of the file.
      
          The `flags` argument is unused for now, but is included for future
          extensibility. User should pass 0 (i.e no flag specified).
      
          Currently, hugetlbfs is not supported.
      
          Because the status of a page can change after cachestat() checks it
          but before it returns to the application, the returned values may
          contain stale information.
      
      RETURN VALUE
          On success, cachestat returns 0. On error, -1 is returned, and errno
          is set to indicate the error.
      
      ERRORS
          EFAULT cstat or cstat_args points to an invalid address.
      
          EINVAL invalid flags.
      
          EBADF  invalid file descriptor.
      
          EOPNOTSUPP file descriptor is of a hugetlbfs file
      
      [nphamcs@gmail.com: replace rounddown logic with the existing helper]
        Link: https://lkml.kernel.org/r/20230504022044.3675469-1-nphamcs@gmail.com
      Link: https://lkml.kernel.org/r/20230503013608.2431726-3-nphamcs@gmail.com
      
      
      Signed-off-by: default avatarNhat Pham <nphamcs@gmail.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Brian Foster <bfoster@redhat.com>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      cf264e13
  5. Jun 05, 2023
  6. May 16, 2023
  7. Apr 23, 2023
    • Linus Torvalds's avatar
      gcc: disable '-Warray-bounds' for gcc-13 too · 0da6e5fd
      Linus Torvalds authored
      
      We started disabling '-Warray-bounds' for gcc-12 originally on s390,
      because it resulted in some warnings that weren't realistically fixable
      (commit 8b202ee2: "s390: disable -Warray-bounds").
      
      That s390-specific issue was then found to be less common elsewhere, but
      generic (see f0be87c4: "gcc-12: disable '-Warray-bounds' universally
      for now"), and then later expanded the version check was expanded to
      gcc-11 (5a41237a: "gcc: disable -Warray-bounds for gcc-11 too").
      
      And it turns out that I was much too optimistic in thinking that it's
      all going to go away, and here we are with gcc-13 showing all the same
      issues.  So instead of expanding this one version at a time, let's just
      disable it for gcc-11+, and put an end limit to it only when we actually
      find a solution.
      
      Yes, I'm sure some of this is because the kernel just does odd things
      (like our "container_of()" use, but also knowingly playing games with
      things like linker tables and array layouts).
      
      And yes, some of the warnings are likely signs of real bugs, but when
      there are hundreds of false positives, that doesn't really help.
      
      Oh well.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0da6e5fd
  8. Apr 16, 2023
  9. Apr 14, 2023
  10. Apr 06, 2023
  11. Mar 29, 2023
  12. Mar 27, 2023
  13. Mar 22, 2023
  14. Mar 12, 2023
  15. Mar 06, 2023
    • Greg Kroah-Hartman's avatar
      driver core: remove CONFIG_SYSFS_DEPRECATED and CONFIG_SYSFS_DEPRECATED_V2 · 721da5ce
      Greg Kroah-Hartman authored
      
      CONFIG_SYSFS_DEPRECATED was added in commit 88a22c98
      ("CONFIG_SYSFS_DEPRECATED") in 2006 to allow systems with older versions
      of some tools (i.e. Fedora 3's version of udev) to boot properly.  Four
      years later, in 2010, the option was attempted to be removed as most of
      userspace should have been fixed up properly by then, but some kernel
      developers clung to those old systems and refused to update, so we added
      CONFIG_SYSFS_DEPRECATED_V2 in commit e52eec13 ("SYSFS: Allow boot
      time switching between deprecated and modern sysfs layout") to allow
      them to continue to boot properly, and we allowed a boot time parameter
      to be used to switch back to the old format if needed.
      
      Over time, the logic that was covered under these config options was
      slowly removed from individual driver subsystems successfully, removed,
      and the only thing that is now left in the kernel are some changes in
      the block layer's representation in sysfs where real directories are
      used instead of symlinks like normal.
      
      Because the original changes were done to userspace tools in 2006, and
      all distros that use those tools are long end-of-life, and older
      non-udev-based systems do not care about the block layer's sysfs
      representation, it is time to finally remove this old logic and the
      config entries from the kernel.
      
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: linux-block@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      Acked-by: default avatarJens Axboe <axboe@kernel.dk>
      Link: https://lore.kernel.org/r/20230223073326.2073220-1-gregkh@linuxfoundation.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      721da5ce
  16. Feb 21, 2023
  17. Feb 03, 2023
Loading