1. 22 Oct, 2023 22 commits
  2. 19 Oct, 2023 10 commits
  3. 12 Sep, 2023 5 commits
    • Kent Overstreet's avatar
      lib: Export errname · 21db9314
      Kent Overstreet authored
      errname() returns the name of an errcode; this functionality is
      otherwise only available for error pointers via %pE - bcachefs uses this
      for better error messages.
      Signed-off-by: default avatarChristopher James Halse Rogers <raof@ubuntu.com>
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      21db9314
    • Kent Overstreet's avatar
      lib/string_helpers: string_get_size() now returns characters wrote · 83feeb19
      Kent Overstreet authored
      printbuf now needs to know the number of characters that would have been
      written if the buffer was too small, like snprintf(); this changes
      string_get_size() to return the the return value of snprintf().
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      83feeb19
    • Christopher James Halse Rogers's avatar
      stacktrace: Export stack_trace_save_tsk · 7d672f40
      Christopher James Halse Rogers authored
      The bcachefs module wants it, and there doesn't seem to be any
      reason it shouldn't be exported like the other functions.
      Signed-off-by: default avatarChristopher James Halse Rogers <raof@ubuntu.com>
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      7d672f40
    • Kent Overstreet's avatar
      fs: factor out d_mark_tmpfile() · 771eb4fe
      Kent Overstreet authored
      New helper for bcachefs - bcachefs doesn't want the
      inode_dec_link_count() call that d_tmpfile does, it handles i_nlink on
      its own atomically with other btree updates
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: linux-fsdevel@vger.kernel.org
      Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
      Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
      771eb4fe
    • Kent Overstreet's avatar
      sched: Add task_struct->faults_disabled_mapping · 2b69987b
      Kent Overstreet authored
      There has been a long standing page cache coherence bug with direct IO.
      This provides part of a mechanism to fix it, currently just used by
      bcachefs but potentially worth promoting to the VFS.
      
      Direct IO evicts the range of the pagecache being read or written to.
      
      For reads, we need dirty pages to be written to disk, so that the read
      doesn't return stale data. For writes, we need to evict that range of
      the pagecache so that it's not stale after the write completes.
      
      However, without a locking mechanism to prevent those pages from being
      re-added to the pagecache - by a buffered read or page fault - page
      cache inconsistency is still possible.
      
      This isn't necessarily just an issue for userspace when they're playing
      games; filesystems may hang arbitrary state off the pagecache, and so
      page cache inconsistency may cause real filesystem bugs, depending on
      the filesystem. This is less of an issue for iomap based filesystems,
      but e.g. buffer heads caches disk block mappings (!) and attaches them
      to the pagecache, and bcachefs attaches disk reservations to pagecache
      pages.
      
      This issue has been hard to fix, because
       - we need to add a lock (henceforth called pagecache_add_lock), which
         would be held for the duration of the direct IO
       - page faults add pages to the page cache, thus need to take the same
         lock
       - dio -> gup -> page fault thus can deadlock
      
      And we cannot enforce a lock ordering with this lock, since userspace
      will be controlling the lock ordering (via the fd and buffer arguments
      to direct IOs), so we need a different method of deadlock avoidance.
      
      We need to tell the page fault handler that we're already holding a
      pagecache_add_lock, and since plumbing it through the entire gup() path
      would be highly impractical this adds a field to task_struct.
      
      Then the full method is:
       - in the dio path, when we first take the pagecache_add_lock, note the
         mapping in the current task_struct
       - in the page fault handler, if faults_disabled_mapping is set, we
         check if it's the same mapping as the one we're taking a page fault
         for, and if so return an error.
      
         Then we check lock ordering: if there's a lock ordering violation and
         trylock fails, we'll have to cycle the locks and return an error that
         tells the DIO path to retry: faults_disabled_mapping is also used for
         signalling "locks were dropped, please retry".
      
      Also relevant to this patch: mapping->invalidate_lock.
      mapping->invalidate_lock provides most of the required semantics - it's
      used by truncate/fallocate to block pages being added to the pagecache.
      However, since it's a rwsem, direct IOs would need to take the write
      side in order to block page cache adds, and would then be exclusive with
      each other - we'll need a new type of lock to pair with this approach.
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Darrick J. Wong <djwong@kernel.org>
      Cc: linux-fsdevel@vger.kernel.org
      Cc: Andreas Grünbacher <andreas.gruenbacher@gmail.com>
      2b69987b
  4. 10 Sep, 2023 3 commits
    • Linus Torvalds's avatar
      Linux 6.6-rc1 · 0bb80ecc
      Linus Torvalds authored
      0bb80ecc
    • Linus Torvalds's avatar
      Merge tag 'topic/drm-ci-2023-08-31-1' of git://anongit.freedesktop.org/drm/drm · 1548b060
      Linus Torvalds authored
      Pull drm ci scripts from Dave Airlie:
       "This is a bunch of ci integration for the freedesktop gitlab instance
        where we currently do upstream userspace testing on diverse sets of
        GPU hardware. From my perspective I think it's an experiment worth
        going with and seeing how the benefits/noise playout keeping these
        files useful.
      
        Ideally I'd like to get this so we can do pre-merge testing on PRs
        eventually.
      
        Below is some info from danvet on why we've ended up making the
        decision and how we can roll it back if we decide it was a bad plan.
      
        Why in upstream?
      
         - like documentation, testcases, tools CI integration is one of these
           things where you can waste endless amounts of time if you
           accidentally have a version that doesn't match your source code
      
         - but also like the above, there's a balance, this is the initial cut
           of what we think makes sense to keep in sync vs out-of-tree,
           probably needs adjustment
      
         - gitlab supports out-of-repo gitlab integration and that's what's
           been used for the kernel in drm, but it results in per-driver
           fragmentation and lots of duplicated effort. the simple act of
           smashing an arbitrary winner into a topic branch already started
           surfacing patches on dri-devel and sparking good cross driver team
           discussions
      
        Why gitlab?
      
         - it's not any more shit than any of the other CI
      
         - drm userspace uses it extensively for everything in userspace, we
           have a lot of people and experience with this, including
           integration of hw testing labs
      
         - media userspace like gstreamer is also on gitlab.fd.o, and there's
           discussion to extend this to the media subsystem in some fashion
      
        Can this be shared?
      
         - there's definitely a pile of code that could move to scripts/ if
           other subsystem adopt ci integration in upstream kernel git. other
           bits are more drm/gpu specific like the igt-gpu-tests/tools
           integration
      
         - docker images can be run locally or in other CI runners
      
        Will we regret this?
      
         - it's all in one directory, intentionally, for easy deletion
      
         - probably 1-2 years in upstream to see whether this is worth it or a
           Big Mistake. that's roughly what it took to _really_ roll out solid
           CI in the bigger userspace projects we have on gitlab.fd.o like
           mesa3d"
      
      * tag 'topic/drm-ci-2023-08-31-1' of git://anongit.freedesktop.org/drm/drm:
        drm: ci: docs: fix build warning - add missing escape
        drm: Add initial ci/ subdirectory
      1548b060
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2023-09-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e56b2b60
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Fix preemption delays in the SGX code, remove unnecessarily
        UAPI-exported code, fix a ld.lld linker (in)compatibility quirk and
        make the x86 SMP init code a bit more conservative to fix kexec()
        lockups"
      
      * tag 'x86-urgent-2023-09-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/sgx: Break up long non-preemptible delays in sgx_vepc_release()
        x86: Remove the arch_calc_vm_prot_bits() macro from the UAPI
        x86/build: Fix linker fill bytes quirk/incompatibility for ld.lld
        x86/smp: Don't send INIT to non-present and non-booted CPUs
      e56b2b60