30 Dec, 2020

1 commit

  • commit cf48647243cc28d15280600292db5777592606c5 upstream.

    Sequence counters with an associated write serialization lock are called
    seqcount_LOCKNAME_t. Fix the documentation accordingly.

    While at it, remove a paragraph that inappropriately discussed a
    seqlock.h implementation detail.

    Fixes: 6dd699b13d53 ("seqlock: seqcount_LOCKNAME_t: Standardize naming convention")
    Signed-off-by: Ahmed S. Darwish
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20201206162143.14387-2-a.darwish@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Ahmed S. Darwish
     

29 Oct, 2020

1 commit

  • There are several warnings caused by a recent change
    224ec489d3cd ("lockdep/Documention: Recursive read lock detection reasoning")

    Those are reported by htmldocs build:

    Documentation/locking/lockdep-design.rst:429: WARNING: Definition list ends without a blank line; unexpected unindent.
    Documentation/locking/lockdep-design.rst:452: WARNING: Block quote ends without a blank line; unexpected unindent.
    Documentation/locking/lockdep-design.rst:453: WARNING: Unexpected indentation.
    Documentation/locking/lockdep-design.rst:453: WARNING: Blank line required after table.
    Documentation/locking/lockdep-design.rst:454: WARNING: Block quote ends without a blank line; unexpected unindent.
    Documentation/locking/lockdep-design.rst:455: WARNING: Unexpected indentation.
    Documentation/locking/lockdep-design.rst:455: WARNING: Blank line required after table.
    Documentation/locking/lockdep-design.rst:456: WARNING: Block quote ends without a blank line; unexpected unindent.
    Documentation/locking/lockdep-design.rst:457: WARNING: Unexpected indentation.
    Documentation/locking/lockdep-design.rst:457: WARNING: Blank line required after table.

    Besides the reported issues, there are some missing blank
    lines that ended producing wrong html output, and some
    literals are not properly identified.

    Also, the symbols used at the irq enabled/disable table
    are not displayed as expected, as they're not literals.
    Also, on another table they're using a different notation.

    Fixes: 224ec489d3cd ("lockdep/Documention: Recursive read lock detection reasoning")
    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/3b9431ac5c01e38111cd59928a93e7259ab7db0f.1603791716.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

10 Sep, 2020

1 commit

  • Latch sequence counters are a multiversion concurrency control mechanism
    where the seqcount_t counter even/odd value is used to switch between
    two copies of protected data. This allows the seqcount_t read path to
    safely interrupt its write side critical section (e.g. from NMIs).

    Initially, latch sequence counters were implemented as a single write
    function above plain seqcount_t: raw_write_seqcount_latch(). The read
    side was expected to use plain seqcount_t raw_read_seqcount().

    A specialized latch read function, raw_read_seqcount_latch(), was later
    added. It became the standardized way for latch read paths. Due to the
    dependent load, it has one read memory barrier less than the plain
    seqcount_t raw_read_seqcount() API.

    Only raw_write_seqcount_latch() and raw_read_seqcount_latch() should be
    used with latch sequence counters. Having *unique* read and write path
    APIs means that latch sequence counters are actually a data type of
    their own -- just inappropriately overloading plain seqcount_t.

    Introduce seqcount_latch_t. This adds type-safety and ensures that only
    the correct latch-safe APIs are to be used.

    Not to break bisection, let the latch APIs also accept plain seqcount_t
    or seqcount_raw_spinlock_t. After converting all call sites to
    seqcount_latch_t, only that new data type will be allowed.

    References: 9b0fd802e8c0 ("seqcount: Add raw_write_seqcount_latch()")
    References: 7fc26327b756 ("seqlock: Introduce raw_read_seqcount_latch()")
    References: aadd6e5caaac ("time/sched_clock: Use raw_read_seqcount_latch()")
    Signed-off-by: Ahmed S. Darwish
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/20200827114044.11173-4-a.darwish@linutronix.de

    Ahmed S. Darwish
     

26 Aug, 2020

2 commits

  • This patch add the documentation piece for the reasoning of deadlock
    detection related to recursive read lock. The following sections are
    added:

    * Explain what is a recursive read lock, and what deadlock cases
    they could introduce.

    * Introduce the notations for different types of dependencies, and
    the definition of strong paths.

    * Proof for a closed strong path is both sufficient and necessary
    for deadlock detections with recursive read locks involved. The
    proof could also explain why we call the path "strong"

    Signed-off-by: Boqun Feng
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/20200807074238.1632519-3-boqun.feng@gmail.com

    Boqun Feng
     
  • Fix issues with local_locks documentation:

    - fix function names, local_lock.h has local_unlock_irqrestore(), not
    local_lock_irqrestore()

    - fix mapping table, local_unlock_irqrestore() maps to
    local_irq_restore(), not _save()

    Signed-off-by: Marta Rybczynska
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Will Deacon
    Link: https://lkml.kernel.org/r/CAApg2=SKxQ3Sqwj6TZnV-0x0cKLXFKDaPvXT4N15MPDMKq724g@mail.gmail.com

    Marta Rybczynska
     

14 Aug, 2020

2 commits

  • Pull documentation fixes from Jonathan Corbet:
    "A handful of obvious fixes that wandered in during the merge window"

    * tag 'docs-5.9-2' of git://git.lwn.net/linux:
    Documentation/locking/locktypes: fix the typo
    doc/zh_CN: resolve undefined label warning in admin-guide index
    doc/zh_CN: fix title heading markup in admin-guide cpu-load
    docs: remove the 2.6 "Upgrading I2C Drivers" guide
    docs: Correct the release date of 5.2 stable
    mailmap: Update comments for with format and more detalis
    docs: cdrom: Fix a typo and rst markup
    Doc: admin-guide: use correct legends in kernel-parameters.txt
    Documentation/features: refresh RISC-V arch support files
    documentation: coccinelle: Improve command example for make C={1,2}
    Core-api: Documentation: Replace deprecated :c:func: Usage
    Dev-tools: Documentation: Replace deprecated :c:func: Usage
    Filesystems: Documentation: Replace deprecated :c:func: Usage
    docs: trace: fix a typo

    Linus Torvalds
     
  • We have three categories locks, not two.

    Signed-off-by: Huang Shijie
    Acked-by: Will Deacon
    Link: https://lore.kernel.org/r/20200813060220.18199-1-sjhuang@iluvatar.ai
    Signed-off-by: Jonathan Corbet

    Huang Shijie
     

11 Aug, 2020

1 commit

  • Pull locking updates from Thomas Gleixner:
    "A set of locking fixes and updates:

    - Untangle the header spaghetti which causes build failures in
    various situations caused by the lockdep additions to seqcount to
    validate that the write side critical sections are non-preemptible.

    - The seqcount associated lock debug addons which were blocked by the
    above fallout.

    seqcount writers contrary to seqlock writers must be externally
    serialized, which usually happens via locking - except for strict
    per CPU seqcounts. As the lock is not part of the seqcount, lockdep
    cannot validate that the lock is held.

    This new debug mechanism adds the concept of associated locks.
    sequence count has now lock type variants and corresponding
    initializers which take a pointer to the associated lock used for
    writer serialization. If lockdep is enabled the pointer is stored
    and write_seqcount_begin() has a lockdep assertion to validate that
    the lock is held.

    Aside of the type and the initializer no other code changes are
    required at the seqcount usage sites. The rest of the seqcount API
    is unchanged and determines the type at compile time with the help
    of _Generic which is possible now that the minimal GCC version has
    been moved up.

    Adding this lockdep coverage unearthed a handful of seqcount bugs
    which have been addressed already independent of this.

    While generally useful this comes with a Trojan Horse twist: On RT
    kernels the write side critical section can become preemtible if
    the writers are serialized by an associated lock, which leads to
    the well known reader preempts writer livelock. RT prevents this by
    storing the associated lock pointer independent of lockdep in the
    seqcount and changing the reader side to block on the lock when a
    reader detects that a writer is in the write side critical section.

    - Conversion of seqcount usage sites to associated types and
    initializers"

    * tag 'locking-urgent-2020-08-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits)
    locking/seqlock, headers: Untangle the spaghetti monster
    locking, arch/ia64: Reduce header dependencies by moving XTP bits into the new header
    x86/headers: Remove APIC headers from
    seqcount: More consistent seqprop names
    seqcount: Compress SEQCNT_LOCKNAME_ZERO()
    seqlock: Fold seqcount_LOCKNAME_init() definition
    seqlock: Fold seqcount_LOCKNAME_t definition
    seqlock: s/__SEQ_LOCKDEP/__SEQ_LOCK/g
    hrtimer: Use sequence counter with associated raw spinlock
    kvm/eventfd: Use sequence counter with associated spinlock
    userfaultfd: Use sequence counter with associated spinlock
    NFSv4: Use sequence counter with associated spinlock
    iocost: Use sequence counter with associated spinlock
    raid5: Use sequence counter with associated spinlock
    vfs: Use sequence counter with associated spinlock
    timekeeping: Use sequence counter with associated raw spinlock
    xfrm: policy: Use sequence counters with associated lock
    netfilter: nft_set_rbtree: Use sequence counter with associated rwlock
    netfilter: conntrack: Use sequence counter with associated spinlock
    sched: tasks: Use sequence counter with associated spinlock
    ...

    Linus Torvalds
     

05 Aug, 2020

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "It's been a busy cycle for documentation - hopefully the busiest for a
    while to come. Changes include:

    - Some new Chinese translations

    - Progress on the battle against double words words and non-HTTPS
    URLs

    - Some block-mq documentation

    - More RST conversions from Mauro. At this point, that task is
    essentially complete, so we shouldn't see this kind of churn again
    for a while. Unless we decide to switch to asciidoc or
    something...:)

    - Lots of typo fixes, warning fixes, and more"

    * tag 'docs-5.9' of git://git.lwn.net/linux: (195 commits)
    scripts/kernel-doc: optionally treat warnings as errors
    docs: ia64: correct typo
    mailmap: add entry for
    doc/zh_CN: add cpu-load Chinese version
    Documentation/admin-guide: tainted-kernels: fix spelling mistake
    MAINTAINERS: adjust kprobes.rst entry to new location
    devices.txt: document rfkill allocation
    PCI: correct flag name
    docs: filesystems: vfs: correct flag name
    docs: filesystems: vfs: correct sync_mode flag names
    docs: path-lookup: markup fixes for emphasis
    docs: path-lookup: more markup fixes
    docs: path-lookup: fix HTML entity mojibake
    CREDITS: Replace HTTP links with HTTPS ones
    docs: process: Add an example for creating a fixes tag
    doc/zh_CN: add Chinese translation prefer section
    doc/zh_CN: add clearing-warn-once Chinese version
    doc/zh_CN: add admin-guide index
    doc:it_IT: process: coding-style.rst: Correct __maybe_unused compiler label
    futex: MAINTAINERS: Re-add selftests directory
    ...

    Linus Torvalds
     

04 Aug, 2020

1 commit

  • Pull locking updates from Ingo Molnar:

    - LKMM updates: mostly documentation changes, but also some new litmus
    tests for atomic ops.

    - KCSAN updates: the most important change is that GCC 11 now has all
    fixes in place to support KCSAN, so GCC support can be enabled again.
    Also more annotations.

    - futex updates: minor cleanups and simplifications

    - seqlock updates: merge preparatory changes/cleanups for the
    'associated locks' facilities.

    - lockdep updates:
    - simplify IRQ trace event handling
    - add various new debug checks
    - simplify header dependencies, split out ,
    decouple lockdep from other low level headers some more
    - fix NMI handling

    - misc cleanups and smaller fixes

    * tag 'locking-core-2020-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (60 commits)
    kcsan: Improve IRQ state trace reporting
    lockdep: Refactor IRQ trace events fields into struct
    seqlock: lockdep assert non-preemptibility on seqcount_t write
    lockdep: Add preemption enabled/disabled assertion APIs
    seqlock: Implement raw_seqcount_begin() in terms of raw_read_seqcount()
    seqlock: Add kernel-doc for seqcount_t and seqlock_t APIs
    seqlock: Reorder seqcount_t and seqlock_t API definitions
    seqlock: seqcount_t latch: End read sections with read_seqcount_retry()
    seqlock: Properly format kernel-doc code samples
    Documentation: locking: Describe seqlock design and usage
    locking/qspinlock: Do not include atomic.h from qspinlock_types.h
    locking/atomic: Move ATOMIC_INIT into linux/types.h
    lockdep: Move list.h inclusion into lockdep.h
    locking/lockdep: Fix TRACE_IRQFLAGS vs. NMIs
    futex: Remove unused or redundant includes
    futex: Consistently use fshared as boolean
    futex: Remove needless goto's
    futex: Remove put_futex_key()
    rwsem: fix commas in initialisation
    docs: locking: Replace HTTP links with HTTPS ones
    ...

    Linus Torvalds
     

29 Jul, 2020

2 commits

  • A sequence counter write side critical section must be protected by some
    form of locking to serialize writers. If the serialization primitive is
    not disabling preemption implicitly, preemption has to be explicitly
    disabled before entering the write side critical section.

    There is no built-in debugging mechanism to verify that the lock used
    for writer serialization is held and preemption is disabled. Some usage
    sites like dma-buf have explicit lockdep checks for the writer-side
    lock, but this covers only a small portion of the sequence counter usage
    in the kernel.

    Add new sequence counter types which allows to associate a lock to the
    sequence counter at initialization time. The seqcount API functions are
    extended to provide appropriate lockdep assertions depending on the
    seqcount/lock type.

    For sequence counters with associated locks that do not implicitly
    disable preemption, preemption protection is enforced in the sequence
    counter write side functions. This removes the need to explicitly add
    preempt_disable/enable() around the write side critical sections: the
    write_begin/end() functions for these new sequence counter types
    automatically do this.

    Introduce the following seqcount types with associated locks:

    seqcount_spinlock_t
    seqcount_raw_spinlock_t
    seqcount_rwlock_t
    seqcount_mutex_t
    seqcount_ww_mutex_t

    Extend the seqcount read and write functions to branch out to the
    specific seqcount_LOCKTYPE_t implementation at compile-time. This avoids
    kernel API explosion per each new seqcount_LOCKTYPE_t added. Add such
    compile-time type detection logic into a new, internal, seqlock header.

    Document the proper seqcount_LOCKTYPE_t usage, and rationale, at
    Documentation/locking/seqlock.rst.

    If lockdep is disabled, this lock association is compiled out and has
    neither storage size nor runtime overhead.

    Signed-off-by: Ahmed S. Darwish
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/20200720155530.1173732-10-a.darwish@linutronix.de

    Ahmed S. Darwish
     
  • Proper documentation for the design and usage of sequence counters and
    sequential locks does not exist. Complete the seqlock.h documentation as
    follows:

    - Divide all documentation on a seqcount_t vs. seqlock_t basis. The
    description for both mechanisms was intermingled, which is incorrect
    since the usage constrains for each type are vastly different.

    - Add an introductory paragraph describing the internal design of, and
    rationale for, sequence counters.

    - Document seqcount_t writer non-preemptibility requirement, which was
    not previously documented anywhere, and provide a clear rationale.

    - Provide template code for seqcount_t and seqlock_t initialization
    and reader/writer critical sections.

    - Recommend using seqlock_t by default. It implicitly handles the
    serialization and non-preemptibility requirements of writers.

    At seqlock.h:

    - Remove references to brlocks as they've long been removed from the
    kernel.

    - Remove references to gcc-3.x since the kernel's minimum supported
    gcc version is 4.9.

    References: 0f6ed63b1707 ("no need to keep brlock macros anymore...")
    References: 6ec4476ac825 ("Raise gcc version requirement to 4.9")
    Signed-off-by: Ahmed S. Darwish
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/20200720155530.1173732-2-a.darwish@linutronix.de

    Ahmed S. Darwish
     

17 Jul, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/20200713115728.33905-1-grandmaster@al2klimov.de

    Alexander A. Klimov
     

13 Jul, 2020

3 commits

  • Drop the doubled word "up".

    Signed-off-by: Randy Dunlap
    Cc: Jonathan Corbet
    Cc: linux-doc@vger.kernel.org
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Will Deacon
    Link: https://lore.kernel.org/r/20200703213649.30948-3-rdunlap@infradead.org
    Signed-off-by: Jonathan Corbet

    Randy Dunlap
     
  • Change the phrase "at at least" to "to at least" to be more
    readable.

    Signed-off-by: Randy Dunlap
    Cc: Jonathan Corbet
    Cc: linux-doc@vger.kernel.org
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Will Deacon
    Link: https://lore.kernel.org/r/20200703213649.30948-2-rdunlap@infradead.org
    Signed-off-by: Jonathan Corbet

    Randy Dunlap
     
  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Link: https://lore.kernel.org/r/20200713115728.33905-1-grandmaster@al2klimov.de
    Signed-off-by: Jonathan Corbet

    Alexander A. Klimov
     

30 Jun, 2020

1 commit


02 Jun, 2020

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "A fair amount of stuff this time around, dominated by yet another
    massive set from Mauro toward the completion of the RST conversion. I
    *really* hope we are getting close to the end of this. Meanwhile,
    those patches reach pretty far afield to update document references
    around the tree; there should be no actual code changes there. There
    will be, alas, more of the usual trivial merge conflicts.

    Beyond that we have more translations, improvements to the sphinx
    scripting, a number of additions to the sysctl documentation, and lots
    of fixes"

    * tag 'docs-5.8' of git://git.lwn.net/linux: (130 commits)
    Documentation: fixes to the maintainer-entry-profile template
    zswap: docs/vm: Fix typo accept_threshold_percent in zswap.rst
    tracing: Fix events.rst section numbering
    docs: acpi: fix old http link and improve document format
    docs: filesystems: add info about efivars content
    Documentation: LSM: Correct the basic LSM description
    mailmap: change email for Ricardo Ribalda
    docs: sysctl/kernel: document unaligned controls
    Documentation: admin-guide: update bug-hunting.rst
    docs: sysctl/kernel: document ngroups_max
    nvdimm: fixes to maintainter-entry-profile
    Documentation/features: Correct RISC-V kprobes support entry
    Documentation/features: Refresh the arch support status files
    Revert "docs: sysctl/kernel: document ngroups_max"
    docs: move locking-specific documents to locking/
    docs: move digsig docs to the security book
    docs: move the kref doc into the core-api book
    docs: add IRQ documentation at the core-api book
    docs: debugging-via-ohci1394.txt: add it to the core-api book
    docs: fix references for ipmi.rst file
    ...

    Linus Torvalds
     

28 May, 2020

1 commit

  • preempt_disable() and local_irq_disable/save() are in principle per CPU big
    kernel locks. This has several downsides:

    - The protection scope is unknown

    - Violation of protection rules is hard to detect by instrumentation

    - For PREEMPT_RT such sections, unless in low level critical code, can
    violate the preemptability constraints.

    To address this PREEMPT_RT introduced the concept of local_locks which are
    strictly per CPU.

    The lock operations map to preempt_disable(), local_irq_disable/save() and
    the enabling counterparts on non RT enabled kernels.

    If lockdep is enabled local locks gain a lock map which tracks the usage
    context. This will catch cases where an area is protected by
    preempt_disable() but the access also happens from interrupt context. local
    locks have identified quite a few such issues over the years, the most
    recent example is:

    b7d5dc21072cd ("random: add a spinlock_t to struct batched_entropy")

    Aside of the lockdep coverage this also improves code readability as it
    precisely annotates the protection scope.

    PREEMPT_RT substitutes these local locks with 'sleeping' spinlocks to
    protect such sections while maintaining preemtability and CPU locality.

    local locks can replace:

    - preempt_enable()/disable() pairs
    - local_irq_disable/enable() pairs
    - local_irq_save/restore() pairs

    They are also used to replace code which implicitly disables preemption
    like:

    - get_cpu()/put_cpu()
    - get_cpu_var()/put_cpu_var()

    with PREEMPT_RT friendly constructs.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Ingo Molnar
    Acked-by: Peter Zijlstra
    Link: https://lore.kernel.org/r/20200527201119.1692513-2-bigeasy@linutronix.de

    Thomas Gleixner
     

16 May, 2020

1 commit

  • Several files under Documentation/*.txt describe some type of
    locking API. Move them to locking/ subdir and add to the
    locking/index.rst index file.

    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/dd833a10bbd0b2c1461d78913f5ec28a7e27f00b.1588345503.git.mchehab+huawei@kernel.org
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

05 May, 2020

1 commit


28 Mar, 2020

2 commits

  • Minor editorial fixes:
    - remove 'enabled' from PREEMPT_RT enabled kernels for consistency
    - add some periods for consistency
    - add "'" for possessive CPU's
    - spell out interrupts

    [ tglx: Picked up Paul's suggestions ]

    Signed-off-by: Randy Dunlap
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Paul E. McKenney
    Link: https://lkml.kernel.org/r/ac615f36-0b44-408d-aeab-d76e4241add4@infradead.org

    Randy Dunlap
     
  • The documentation of rw_semaphores is wrong as it claims that the non-owner
    reader release is not supported by RT. That's just history biased memory
    distortion.

    Split the 'Owner semantics' section up and add separate sections for
    semaphore and rw_semaphore to reflect reality.

    Aside of that the following updates are done:

    - Add pseudo code to document the spinlock state preserving mechanism on
    PREEMPT_RT

    - Wordsmith the bitspinlock and lock nesting sections

    Co-developed-by: Paul McKenney
    Signed-off-by: Paul McKenney
    Signed-off-by: Thomas Gleixner
    Acked-by: Sebastian Andrzej Siewior
    Link: https://lkml.kernel.org/r/87wo78y5yy.fsf@nanos.tec.linutronix.de

    Thomas Gleixner
     

21 Mar, 2020

1 commit


06 Feb, 2020

1 commit

  • Commit 2e4f5382d12a ("locking/doc: Rename LOCK/UNLOCK to
    ACQUIRE/RELEASE") has not appied to 'spinlock.rst'. This commit updates
    the doc for the change.

    Signed-off-by: SeongJae Park
    Link: https://lore.kernel.org/r/20200131205237.29535-2-sj38.park@gmail.com
    Signed-off-by: Jonathan Corbet

    SeongJae Park
     

20 Dec, 2019

1 commit


14 Sep, 2019

1 commit


17 Jul, 2019

1 commit


15 Jul, 2019

2 commits

  • The locking directory is part of the Kernel API bookset. Add
    it to the index file.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Convert the locking documents to ReST and add them to the
    kernel development book where it belongs.

    Most of the stuff here is just to make Sphinx to properly
    parse the text file, as they're already in good shape,
    not requiring massive changes in order to be parsed.

    The conversion is actually:
    - add blank lines and identation in order to identify paragraphs;
    - fix tables markups;
    - add some lists markups;
    - mark literal blocks;
    - adjust title markups.

    At its new index.rst, let's add a :orphan: while this is not linked to
    the main index.rst file, in order to avoid build warnings.

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Federico Vaga

    Mauro Carvalho Chehab
     

03 Jun, 2019

2 commits

  • The irq usage and lock dependency rules that if violated a deacklock may
    happen are explained in more detail.

    Signed-off-by: Yuyang Du
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: bvanassche@acm.org
    Cc: frederic@kernel.org
    Cc: ming.lei@redhat.com
    Cc: will.deacon@arm.com
    Link: https://lkml.kernel.org/r/20190506081939.74287-17-duyuyang@gmail.com
    Signed-off-by: Ingo Molnar

    Yuyang Du
     
  • More words are added to lockdep design document regarding key concepts,
    which should help people without lockdep experience read and understand
    lockdep reports.

    Signed-off-by: Yuyang Du
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: bvanassche@acm.org
    Cc: frederic@kernel.org
    Cc: ming.lei@redhat.com
    Cc: will.deacon@arm.com
    Link: https://lkml.kernel.org/r/20190506081939.74287-3-duyuyang@gmail.com
    Signed-off-by: Ingo Molnar

    Yuyang Du
     

05 Mar, 2019

1 commit


25 Oct, 2018

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "This is a fairly typical cycle for documentation. There's some welcome
    readability improvements for the formatted output, some LICENSES
    updates including the addition of the ISC license, the removal of the
    unloved and unmaintained 00-INDEX files, the deprecated APIs document
    from Kees, more MM docs from Mike Rapoport, and the usual pile of typo
    fixes and corrections"

    * tag 'docs-4.20' of git://git.lwn.net/linux: (41 commits)
    docs: Fix typos in histogram.rst
    docs: Introduce deprecated APIs list
    kernel-doc: fix declaration type determination
    doc: fix a typo in adding-syscalls.rst
    docs/admin-guide: memory-hotplug: remove table of contents
    doc: printk-formats: Remove bogus kobject references for device nodes
    Documentation: preempt-locking: Use better example
    dm flakey: Document "error_writes" feature
    docs/completion.txt: Fix a couple of punctuation nits
    LICENSES: Add ISC license text
    LICENSES: Add note to CDDL-1.0 license that it should not be used
    docs/core-api: memory-hotplug: add some details about locking internals
    docs/core-api: rename memory-hotplug-notifier to memory-hotplug
    docs: improve readability for people with poorer eyesight
    yama: clarify ptrace_scope=2 in Yama documentation
    docs/vm: split memory hotplug notifier description to Documentation/core-api
    docs: move memory hotplug description into admin-guide/mm
    doc: Fix acronym "FEKEK" in ecryptfs
    docs: fix some broken documentation references
    iommu: Fix passthrough option documentation
    ...

    Linus Torvalds
     

02 Oct, 2018

1 commit

  • Fix incorrect line number in example output

    Signed-off-by: Andrew Murray
    Cc: Jiri Kosina
    Cc: Jonathan Corbet
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-doc@vger.kernel.org
    Link: http://lkml.kernel.org/r/1538391663-54524-1-git-send-email-andrew.murray@arm.com
    Signed-off-by: Ingo Molnar

    Andrew Murray
     

10 Sep, 2018

1 commit

  • This is a respin with a wider audience (all that get_maintainer returned)
    and I know this spams a *lot* of people. Not sure what would be the correct
    way, so my apologies for ruining your inbox.

    The 00-INDEX files are supposed to give a summary of all files present
    in a directory, but these files are horribly out of date and their
    usefulness is brought into question. Often a simple "ls" would reveal
    the same information as the filenames are generally quite descriptive as
    a short introduction to what the file covers (it should not surprise
    anyone what Documentation/sched/sched-design-CFS.txt covers)

    A few years back it was mentioned that these files were no longer really
    needed, and they have since then grown further out of date, so perhaps
    it is time to just throw them out.

    A short status yields the following _outdated_ 00-INDEX files, first
    counter is files listed in 00-INDEX but missing in the directory, last
    is files present but not listed in 00-INDEX.

    List of outdated 00-INDEX:
    Documentation: (4/10)
    Documentation/sysctl: (0/1)
    Documentation/timers: (1/0)
    Documentation/blockdev: (3/1)
    Documentation/w1/slaves: (0/1)
    Documentation/locking: (0/1)
    Documentation/devicetree: (0/5)
    Documentation/power: (1/1)
    Documentation/powerpc: (0/5)
    Documentation/arm: (1/0)
    Documentation/x86: (0/9)
    Documentation/x86/x86_64: (1/1)
    Documentation/scsi: (4/4)
    Documentation/filesystems: (2/9)
    Documentation/filesystems/nfs: (0/2)
    Documentation/cgroup-v1: (0/2)
    Documentation/kbuild: (0/4)
    Documentation/spi: (1/0)
    Documentation/virtual/kvm: (1/0)
    Documentation/scheduler: (0/2)
    Documentation/fb: (0/1)
    Documentation/block: (0/1)
    Documentation/networking: (6/37)
    Documentation/vm: (1/3)

    Then there are 364 subdirectories in Documentation/ with several files that
    are missing 00-INDEX alltogether (and another 120 with a single file and no
    00-INDEX).

    I don't really have an opinion to whether or not we /should/ have 00-INDEX,
    but the above 00-INDEX should either be removed or be kept up to date. If
    we should keep the files, I can try to keep them updated, but I rather not
    if we just want to delete them anyway.

    As a starting point, remove all index-files and references to 00-INDEX and
    see where the discussion is going.

    Signed-off-by: Henrik Austad
    Acked-by: "Paul E. McKenney"
    Just-do-it-by: Steven Rostedt
    Reviewed-by: Jens Axboe
    Acked-by: Paul Moore
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mark Brown
    Acked-by: Mike Rapoport
    Cc: [Almost everybody else]
    Signed-off-by: Jonathan Corbet

    Henrik Austad
     

03 Jul, 2018

2 commits

  • The current Wound-Wait mutex algorithm is actually not Wound-Wait but
    Wait-Die. Implement also Wound-Wait as a per-ww-class choice. Wound-Wait
    is, contrary to Wait-Die a preemptive algorithm and is known to generate
    fewer backoffs. Testing reveals that this is true if the
    number of simultaneous contending transactions is small.
    As the number of simultaneous contending threads increases, Wait-Wound
    becomes inferior to Wait-Die in terms of elapsed time.
    Possibly due to the larger number of held locks of sleeping transactions.

    Update documentation and callers.

    Timings using git://people.freedesktop.org/~thomash/ww_mutex_test
    tag patch-18-06-15

    Each thread runs 100000 batches of lock / unlock 800 ww mutexes randomly
    chosen out of 100000. Four core Intel x86_64:

    Algorithm #threads Rollbacks time
    Wound-Wait 4 ~100 ~17s.
    Wait-Die 4 ~150000 ~19s.
    Wound-Wait 16 ~360000 ~109s.
    Wait-Die 16 ~450000 ~82s.

    Cc: Ingo Molnar
    Cc: Jonathan Corbet
    Cc: Gustavo Padovan
    Cc: Maarten Lankhorst
    Cc: Sean Paul
    Cc: David Airlie
    Cc: Davidlohr Bueso
    Cc: "Paul E. McKenney"
    Cc: Josh Triplett
    Cc: Thomas Gleixner
    Cc: Kate Stewart
    Cc: Philippe Ombredanne
    Cc: Greg Kroah-Hartman
    Cc: linux-doc@vger.kernel.org
    Cc: linux-media@vger.kernel.org
    Cc: linaro-mm-sig@lists.linaro.org
    Co-authored-by: Peter Zijlstra
    Signed-off-by: Thomas Hellstrom
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Ingo Molnar

    Thomas Hellstrom
     
  • Make the WW mutex code more readable by adding comments, splitting up
    functions and pointing out that we're actually using the Wait-Die
    algorithm.

    Cc: Ingo Molnar
    Cc: Jonathan Corbet
    Cc: Gustavo Padovan
    Cc: Maarten Lankhorst
    Cc: Sean Paul
    Cc: David Airlie
    Cc: Davidlohr Bueso
    Cc: "Paul E. McKenney"
    Cc: Josh Triplett
    Cc: Thomas Gleixner
    Cc: Kate Stewart
    Cc: Philippe Ombredanne
    Cc: Greg Kroah-Hartman
    Cc: linux-doc@vger.kernel.org
    Cc: linux-media@vger.kernel.org
    Cc: linaro-mm-sig@lists.linaro.org
    Co-authored-by: Thomas Hellstrom
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Hellstrom
    Acked-by: Ingo Molnar

    Peter Ziljstra
     

21 Feb, 2018

1 commit


14 Feb, 2018

1 commit

  • Add section about annotations that can be used to perform additional runtime
    checking of locking correctness: assert that certain locks are held and
    prevent accidental unlocking.

    Signed-off-by: Juri Lelli
    Acked-by: Peter Zijlstra (Intel)
    Cc: Jonathan Corbet
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-doc@vger.kernel.org
    Link: http://lkml.kernel.org/r/20180213185519.18186-3-juri.lelli@redhat.com
    Signed-off-by: Ingo Molnar

    Juri Lelli