17 Aug, 2022

1 commit

  • [ Upstream commit 9c9b26b0df270d4f9246e483a44686fca951a29c ]

    The csdlock_debug kernel-boot parameter is parsed by the
    early_param() function csdlock_debug(). If set, csdlock_debug()
    invokes static_branch_enable() to enable csd_lock_wait feature, which
    triggers a panic on arm64 for kernels built with CONFIG_SPARSEMEM=y and
    CONFIG_SPARSEMEM_VMEMMAP=n.

    With CONFIG_SPARSEMEM_VMEMMAP=n, __nr_to_section is called in
    static_key_enable() and returns NULL, resulting in a NULL dereference
    because mem_section is initialized only later in sparse_init().

    This is also a problem for powerpc because early_param() functions
    are invoked earlier than jump_label_init(), also resulting in
    static_key_enable() failures. These failures cause the warning "static
    key 'xxx' used before call to jump_label_init()".

    Thus, early_param is too early for csd_lock_wait to run
    static_branch_enable(), so changes it to __setup to fix these.

    Fixes: 8d0968cc6b8f ("locking/csd_lock: Add boot parameter for controlling CSD lock debugging")
    Cc: stable@vger.kernel.org
    Reported-by: Chen jingwen
    Signed-off-by: Chen Zhongjin
    Signed-off-by: Paul E. McKenney
    Signed-off-by: Sasha Levin

    Chen Zhongjin
     

20 Apr, 2022

1 commit

  • commit 9e949a3886356fe9112c6f6f34a6e23d1d35407f upstream.

    The check in flush_smp_call_function_queue() for callbacks that are sent
    to offline CPUs currently checks whether the queue is empty.

    However, flush_smp_call_function_queue() has just deleted all the
    callbacks from the queue and moved all the entries into a local list.
    This checks would only be positive if some callbacks were added in the
    short time after llist_del_all() was called. This does not seem to be
    the intention of this check.

    Change the check to look at the local list to which the entries were
    moved instead of the queue from which all the callbacks were just
    removed.

    Fixes: 8d056c48e4862 ("CPU hotplug, smp: flush any pending IPI callbacks before CPU offline")
    Signed-off-by: Nadav Amit
    Signed-off-by: Thomas Gleixner
    Link: https://lore.kernel.org/r/20220319072015.1495036-1-namit@vmware.com
    Signed-off-by: Greg Kroah-Hartman

    Nadav Amit
     

11 Aug, 2021

1 commit

  • Fix the following warnings:

    kernel/smp.c:1189: warning: cannot understand function prototype: 'struct smp_call_on_cpu_struct '
    kernel/smp.c:788: warning: No description found for return value of 'smp_call_function_single_async'
    kernel/smp.c:990: warning: Function parameter or member 'wait' not described in 'smp_call_function_many'
    kernel/smp.c:990: warning: Excess function parameter 'flags' description in 'smp_call_function_many'
    kernel/smp.c:1198: warning: Function parameter or member 'work' not described in 'smp_call_on_cpu_struct'
    kernel/smp.c:1198: warning: Function parameter or member 'done' not described in 'smp_call_on_cpu_struct'
    kernel/smp.c:1198: warning: Function parameter or member 'func' not described in 'smp_call_on_cpu_struct'
    kernel/smp.c:1198: warning: Function parameter or member 'data' not described in 'smp_call_on_cpu_struct'
    kernel/smp.c:1198: warning: Function parameter or member 'ret' not described in 'smp_call_on_cpu_struct'
    kernel/smp.c:1198: warning: Function parameter or member 'cpu' not described in 'smp_call_on_cpu_struct'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Thomas Gleixner
    Link: https://lore.kernel.org/r/20210810225051.3938-1-rdunlap@infradead.org

    Randy Dunlap
     

06 May, 2021

1 commit

  • As of commit 966a967116e6 ("smp: Avoid using two cache lines for struct
    call_single_data"), the smp code prefers 32-byte aligned call_single_data
    objects for performance reasons, but the block layer includes an instance
    of this structure in the main 'struct request' that is more senstive
    to size than to performance here, see 4ccafe032005 ("block: unalign
    call_single_data in struct request").

    The result is a violation of the calling conventions that clang correctly
    points out:

    block/blk-mq.c:630:39: warning: passing 8-byte aligned argument to 32-byte aligned parameter 2 of 'smp_call_function_single_async' may result in an unaligned pointer access [-Walign-mismatch]
    smp_call_function_single_async(cpu, &rq->csd);

    It does seem that the usage of the call_single_data without cache line
    alignment should still be allowed by the smp code, so just change the
    function prototype so it accepts both, but leave the default alignment
    unchanged for the other users. This seems better to me than adding
    a local hack to shut up an otherwise correct warning in the caller.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Jens Axboe
    Link: https://lkml.kernel.org/r/20210505211300.3174456-1-arnd@kernel.org

    Arnd Bergmann
     

06 Mar, 2021

7 commits

  • There's a non-trivial conflict between the parallel TLB flush
    framework and the IPI flush debugging code - merge them
    manually.

    Conflicts:
    kernel/smp.c

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Call the generic send_call_function_single_ipi() function, which
    will avoid the IPI when @last_cpu is idle.

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Simplify the code and avoid having an additional function on the stack
    by inlining on_each_cpu_cond() and on_each_cpu().

    Suggested-by: Peter Zijlstra
    Signed-off-by: Nadav Amit
    [ Minor edits. ]
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/20210220231712.2475218-10-namit@vmware.com

    Nadav Amit
     
  • Currently, on_each_cpu() and similar functions do not exploit the
    potential of concurrency: the function is first executed remotely and
    only then it is executed locally. Functions such as TLB flush can take
    considerable time, so this provides an opportunity for performance
    optimization.

    To do so, modify smp_call_function_many_cond(), to allows the callers to
    provide a function that should be executed (remotely/locally), and run
    them concurrently. Keep other smp_call_function_many() semantic as it is
    today for backward compatibility: the called function is not executed in
    this case locally.

    smp_call_function_many_cond() does not use the optimized version for a
    single remote target that smp_call_function_single() implements. For
    synchronous function call, smp_call_function_single() keeps a
    call_single_data (which is used for synchronization) on the stack.
    Interestingly, it seems that not using this optimization provides
    greater performance improvements (greater speedup with a single remote
    target than with multiple ones). Presumably, holding data structures
    that are intended for synchronization on the stack can introduce
    overheads due to TLB misses and false-sharing when the stack is used for
    other purposes.

    Signed-off-by: Nadav Amit
    Signed-off-by: Ingo Molnar
    Reviewed-by: Dave Hansen
    Link: https://lore.kernel.org/r/20210220231712.2475218-2-namit@vmware.com

    Nadav Amit
     
  • In order to help identifying problems with IPI handling and remote
    function execution add some more data to IPI debugging code.

    There have been multiple reports of CPUs looping long times (many
    seconds) in smp_call_function_many() waiting for another CPU executing
    a function like tlb flushing. Most of these reports have been for
    cases where the kernel was running as a guest on top of KVM or Xen
    (there are rumours of that happening under VMWare, too, and even on
    bare metal).

    Finding the root cause hasn't been successful yet, even after more than
    2 years of chasing this bug by different developers.

    Commit:

    35feb60474bf4f7 ("kernel/smp: Provide CSD lock timeout diagnostics")

    tried to address this by adding some debug code and by issuing another
    IPI when a hang was detected. This helped mitigating the problem
    (the repeated IPI unlocks the hang), but the root cause is still unknown.

    Current available data suggests that either an IPI wasn't sent when it
    should have been, or that the IPI didn't result in the target CPU
    executing the queued function (due to the IPI not reaching the CPU,
    the IPI handler not being called, or the handler not seeing the queued
    request).

    Try to add more diagnostic data by introducing a global atomic counter
    which is being incremented when doing critical operations (before and
    after queueing a new request, when sending an IPI, and when dequeueing
    a request). The counter value is stored in percpu variables which can
    be printed out when a hang is detected.

    The data of the last event (consisting of sequence counter, source
    CPU, target CPU, and event type) is stored in a global variable. When
    a new event is to be traced, the data of the last event is stored in
    the event related percpu location and the global data is updated with
    the new event's data. This allows to track two events in one data
    location: one by the value of the event data (the event before the
    current one), and one by the location itself (the current event).

    A typical printout with a detected hang will look like this:

    csd: Detected non-responsive CSD lock (#1) on CPU#1, waiting 5000000003 ns for CPU#06 scf_handler_1+0x0/0x50(0xffffa2a881bb1410).
    csd: CSD lock (#1) handling prior scf_handler_1+0x0/0x50(0xffffa2a8813823c0) request.
    csd: cnt(00008cc): ffff->0000 dequeue (src cpu 0 == empty)
    csd: cnt(00008cd): ffff->0006 idle
    csd: cnt(0003668): 0001->0006 queue
    csd: cnt(0003669): 0001->0006 ipi
    csd: cnt(0003e0f): 0007->000a queue
    csd: cnt(0003e10): 0001->ffff ping
    csd: cnt(0003e71): 0003->0000 ping
    csd: cnt(0003e72): ffff->0006 gotipi
    csd: cnt(0003e73): ffff->0006 handle
    csd: cnt(0003e74): ffff->0006 dequeue (src cpu 0 == empty)
    csd: cnt(0003e7f): 0004->0006 ping
    csd: cnt(0003e80): 0001->ffff pinged
    csd: cnt(0003eb2): 0005->0001 noipi
    csd: cnt(0003eb3): 0001->0006 queue
    csd: cnt(0003eb4): 0001->0006 noipi
    csd: cnt now: 0003f00

    The idea is to print only relevant entries. Those are all events which
    are associated with the hang (so sender side events for the source CPU
    of the hanging request, and receiver side events for the target CPU),
    and the related events just before those (for adding data needed to
    identify a possible race). Printing all available data would be
    possible, but this would add large amounts of data printed on larger
    configurations.

    Signed-off-by: Juergen Gross
    [ Minor readability edits. Breaks col80 but is far more readable. ]
    Signed-off-by: Ingo Molnar
    Tested-by: Paul E. McKenney
    Link: https://lore.kernel.org/r/20210301101336.7797-4-jgross@suse.com

    Juergen Gross
     
  • In order to be able to easily add more CSD lock debugging data to
    struct call_function_data->csd move the call_single_data_t element
    into a sub-structure.

    Signed-off-by: Juergen Gross
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/20210301101336.7797-3-jgross@suse.com

    Juergen Gross
     
  • Currently CSD lock debugging can be switched on and off via a kernel
    config option only. Unfortunately there is at least one problem with
    CSD lock handling pending for about 2 years now, which has been seen
    in different environments (mostly when running virtualized under KVM
    or Xen, at least once on bare metal). Multiple attempts to catch this
    issue have finally led to introduction of CSD lock debug code, but
    this code is not in use in most distros as it has some impact on
    performance.

    In order to be able to ship kernels with CONFIG_CSD_LOCK_WAIT_DEBUG
    enabled even for production use, add a boot parameter for switching
    the debug functionality on. This will reduce any performance impact
    of the debug coding to a bare minimum when not being used.

    Signed-off-by: Juergen Gross
    [ Minor edits. ]
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/20210301101336.7797-2-jgross@suse.com

    Juergen Gross
     

17 Feb, 2021

1 commit

  • send_call_function_single_ipi() may wake an idle CPU without sending an
    IPI. The woken up CPU will process the SMP-functions in
    flush_smp_call_function_from_idle(). Any raised softirq from within the
    SMP-function call will not be processed.
    Should the CPU have no tasks assigned, then it will go back to idle with
    pending softirqs and the NOHZ will rightfully complain.

    Process pending softirqs on return from flush_smp_call_function_queue().

    Fixes: b2a02fc43a1f4 ("smp: Optimize send_call_function_single_ipi()")
    Reported-by: Jens Axboe
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Link: https://lkml.kernel.org/r/20210123201027.3262800-2-bigeasy@linutronix.de

    Sebastian Andrzej Siewior
     

27 Nov, 2020

1 commit


24 Nov, 2020

1 commit


19 Oct, 2020

1 commit

  • Pull RCU changes from Ingo Molnar:

    - Debugging for smp_call_function()

    - RT raw/non-raw lock ordering fixes

    - Strict grace periods for KASAN

    - New smp_call_function() torture test

    - Torture-test updates

    - Documentation updates

    - Miscellaneous fixes

    [ This doesn't actually pull the tag - I've dropped the last merge from
    the RCU branch due to questions about the series. - Linus ]

    * tag 'core-rcu-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (77 commits)
    smp: Make symbol 'csd_bug_count' static
    kernel/smp: Provide CSD lock timeout diagnostics
    smp: Add source and destination CPUs to __call_single_data
    rcu: Shrink each possible cpu krcp
    rcu/segcblist: Prevent useless GP start if no CBs to accelerate
    torture: Add gdb support
    rcutorture: Allow pointer leaks to test diagnostic code
    rcutorture: Hoist OOM registry up one level
    refperf: Avoid null pointer dereference when buf fails to allocate
    rcutorture: Properly synchronize with OOM notifier
    rcutorture: Properly set rcu_fwds for OOM handling
    torture: Add kvm.sh --help and update help message
    rcutorture: Add CONFIG_PROVE_RCU_LIST to TREE05
    torture: Update initrd documentation
    rcutorture: Replace HTTP links with HTTPS ones
    locktorture: Make function torture_percpu_rwsem_init() static
    torture: document --allcpus argument added to the kvm.sh script
    rcutorture: Output number of elapsed grace periods
    rcutorture: Remove KCSAN stubs
    rcu: Remove unused "cpu" parameter from rcu_report_qs_rdp()
    ...

    Linus Torvalds
     

17 Oct, 2020

1 commit

  • Fix multiple occurrences of duplicated words in kernel/.

    Fix one typo/spello on the same line as a duplicate word. Change one
    instance of "the the" to "that the". Otherwise just drop one of the
    repeated words.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Link: https://lkml.kernel.org/r/98202fa6-8919-ef63-9efe-c0fad5ca7af1@infradead.org
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

05 Sep, 2020

3 commits

  • The sparse tool complains as follows:

    kernel/smp.c:107:10: warning:
    symbol 'csd_bug_count' was not declared. Should it be static?

    Because variable is not used outside of smp.c, this commit marks it
    static.

    Reported-by: Hulk Robot
    Signed-off-by: Wei Yongjun
    Signed-off-by: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Sebastian Andrzej Siewior

    Wei Yongjun
     
  • This commit causes csd_lock_wait() to emit diagnostics when a CPU
    fails to respond quickly enough to one of the smp_call_function()
    family of function calls. These diagnostics are enabled by a new
    CSD_LOCK_WAIT_DEBUG Kconfig option that depends on DEBUG_KERNEL.

    This commit was inspired by an earlier patch by Josef Bacik.

    [ paulmck: Fix for syzbot+0f719294463916a3fc0e@syzkaller.appspotmail.com ]
    [ paulmck: Fix KASAN use-after-free issue reported by Qian Cai. ]
    [ paulmck: Fix botched nr_cpu_ids comparison per Dan Carpenter. ]
    [ paulmck: Apply Peter Zijlstra feedback. ]
    Link: https://lore.kernel.org/lkml/00000000000042f21905a991ecea@google.com
    Link: https://lore.kernel.org/lkml/0000000000002ef21705a9933cf3@google.com
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Sebastian Andrzej Siewior
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit adds a destination CPU to __call_single_data, and is inspired
    by an earlier commit by Peter Zijlstra. This version adds #ifdef to
    permit use by 32-bit systems and supplying the destination CPU for all
    smp_call_function*() requests, not just smp_call_function_single().

    If need be, 32-bit systems could be accommodated by shrinking the flags
    field to 16 bits (the atomic_t variant is currently unused) and by
    providing only eight bits for CPU on such systems.

    It is not clear that the addition of the fields to __call_single_node
    are really needed.

    [ paulmck: Apply Boqun Feng feedback on 32-bit builds. ]
    Link: https://lore.kernel.org/lkml/20200615164048.GC2531@hirez.programming.kicks-ass.net/
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Sebastian Andrzej Siewior
    Cc: Frederic Weisbecker
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

22 Jul, 2020

1 commit

  • The get_option() maybe return 0, it means that the nr_cpus is
    not initialized. Then we will use the stale nr_cpus to initialize
    the nr_cpu_ids. So fix it.

    Signed-off-by: Muchun Song
    Signed-off-by: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/r/20200716070457.53255-1-songmuchun@bytedance.com

    Muchun Song
     

28 Jun, 2020

1 commit

  • Instead of relying on BUG_ON() to ensure the various data structures
    line up, use a bunch of horrible unions to make it all automatic.

    Much of the union magic is to ensure irq_work and smp_call_function do
    not (yet) see the members of their respective data structures change
    name.

    Suggested-by: Linus Torvalds
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Reviewed-by: Frederic Weisbecker
    Link: https://lkml.kernel.org/r/20200622100825.844455025@infradead.org

    Peter Zijlstra
     

04 Jun, 2020

1 commit

  • Pull scheduler updates from Ingo Molnar:
    "The changes in this cycle are:

    - Optimize the task wakeup CPU selection logic, to improve
    scalability and reduce wakeup latency spikes

    - PELT enhancements

    - CFS bandwidth handling fixes

    - Optimize the wakeup path by remove rq->wake_list and replacing it
    with ->ttwu_pending

    - Optimize IPI cross-calls by making flush_smp_call_function_queue()
    process sync callbacks first.

    - Misc fixes and enhancements"

    * tag 'sched-core-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
    irq_work: Define irq_work_single() on !CONFIG_IRQ_WORK too
    sched/headers: Split out open-coded prototypes into kernel/sched/smp.h
    sched: Replace rq::wake_list
    sched: Add rq::ttwu_pending
    irq_work, smp: Allow irq_work on call_single_queue
    smp: Optimize send_call_function_single_ipi()
    smp: Move irq_work_run() out of flush_smp_call_function_queue()
    smp: Optimize flush_smp_call_function_queue()
    sched: Fix smp_call_function_single_async() usage for ILB
    sched/core: Offload wakee task activation if it the wakee is descheduling
    sched/core: Optimize ttwu() spinning on p->on_cpu
    sched: Defend cfs and rt bandwidth quota against overflow
    sched/cpuacct: Fix charge cpuacct.usage_sys
    sched/fair: Replace zero-length array with flexible-array
    sched/pelt: Sync util/runnable_sum with PELT window when propagating
    sched/cpuacct: Use __this_cpu_add() instead of this_cpu_ptr()
    sched/fair: Optimize enqueue_task_fair()
    sched: Make scheduler_ipi inline
    sched: Clean up scheduler_ipi()
    sched/core: Simplify sched_init()
    ...

    Linus Torvalds
     

02 Jun, 2020

1 commit


28 May, 2020

6 commits

  • Move the prototypes for sched_ttwu_pending() and send_call_function_single_ipi()
    into the newly created kernel/sched/smp.h header, to make sure they are all
    the same, and to architectures happy that use -Wmissing-prototypes.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • The recent commit: 90b5363acd47 ("sched: Clean up scheduler_ipi()")
    got smp_call_function_single_async() subtly wrong. Even though it will
    return -EBUSY when trying to re-use a csd, that condition is not
    atomic and still requires external serialization.

    The change in ttwu_queue_remote() got this wrong.

    While on first reading ttwu_queue_remote() has an atomic test-and-set
    that appears to serialize the use, the matching 'release' is not in
    the right place to actually guarantee this serialization.

    The actual race is vs the sched_ttwu_pending() call in the idle loop;
    that can run the wakeup-list without consuming the CSD.

    Instead of trying to chain the lists, merge them.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/20200526161908.129371594@infradead.org

    Peter Zijlstra
     
  • Currently irq_work_queue_on() will issue an unconditional
    arch_send_call_function_single_ipi() and has the handler do
    irq_work_run().

    This is unfortunate in that it makes the IPI handler look at a second
    cacheline and it misses the opportunity to avoid the IPI. Instead note
    that struct irq_work and struct __call_single_data are very similar in
    layout, so use a few bits in the flags word to encode a type and stick
    the irq_work on the call_single_queue list.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/20200526161908.011635912@infradead.org

    Peter Zijlstra
     
  • Just like the ttwu_queue_remote() IPI, make use of _TIF_POLLING_NRFLAG
    to avoid sending IPIs to idle CPUs.

    [ mingo: Fix UP build bug. ]

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/20200526161907.953304789@infradead.org

    Peter Zijlstra
     
  • This ensures flush_smp_call_function_queue() is strictly about
    call_single_queue.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/20200526161907.895109676@infradead.org

    Peter Zijlstra
     
  • The call_single_queue can contain (two) different callbacks,
    synchronous and asynchronous. The current interrupt handler runs them
    in-order, which means that remote CPUs that are waiting for their
    synchronous call can be delayed by running asynchronous callbacks.

    Rework the interrupt handler to first run the synchonous callbacks.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/20200526161907.836818381@infradead.org

    Peter Zijlstra
     

19 Apr, 2020

1 commit


25 Mar, 2020

1 commit


06 Mar, 2020

1 commit

  • Previously we will raise an warning if we want to insert a csd object
    which is with the LOCK flag set, and if it happens we'll also wait for
    the lock to be released. However, this operation does not match
    perfectly with how the function is named - the name with "_async"
    suffix hints that this function should not block, while we will.

    This patch changed this behavior by simply return -EBUSY instead of
    waiting, at the meantime we allow this operation to happen without
    warning the user to change this into a feature when the caller wants
    to "insert a csd object, if it's there, just wait for that one".

    This is pretty safe because in flush_smp_call_function_queue() for
    async csd objects (where csd->flags&SYNC is zero) we'll first do the
    unlock then we call the csd->func(). So if we see the csd->flags&LOCK
    is true in smp_call_function_single_async(), then it's guaranteed that
    csd->func() will be called after this smp_call_function_single_async()
    returns -EBUSY.

    Update the comment of the function too to refect this.

    Signed-off-by: Peter Xu
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Link: https://lkml.kernel.org/r/20191216213125.9536-2-peterx@redhat.com

    Peter Xu
     

28 Jan, 2020

1 commit


25 Jan, 2020

3 commits

  • The allocation mask is no longer used by on_each_cpu_cond() and
    on_each_cpu_cond_mask() and can be removed.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra (Intel)
    Link: https://lore.kernel.org/r/20200117090137.1205765-4-bigeasy@linutronix.de

    Sebastian Andrzej Siewior
     
  • on_each_cpu_cond_mask() allocates a new CPU mask. The newly allocated
    mask is a subset of the provided mask based on the conditional function.

    This memory allocation can be avoided by extending smp_call_function_many()
    with the conditional function and performing the remote function call based
    on the mask and the conditional function.

    Rename smp_call_function_many() to smp_call_function_many_cond() and add
    the smp_cond_func_t argument. If smp_cond_func_t is provided then it is
    used before invoking the function. Provide smp_call_function_many() with
    cond_func set to NULL. Let on_each_cpu_cond_mask() use
    smp_call_function_many_cond().

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra (Intel)
    Link: https://lore.kernel.org/r/20200117090137.1205765-3-bigeasy@linutronix.de

    Sebastian Andrzej Siewior
     
  • Use a typdef for the conditional function instead defining it each time in
    the function prototype.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra (Intel)
    Link: https://lore.kernel.org/r/20200117090137.1205765-2-bigeasy@linutronix.de

    Sebastian Andrzej Siewior
     

20 Jul, 2019

1 commit

  • It's clearly documented that smp function calls cannot be invoked from
    softirq handling context. Unfortunately nothing enforces that or emits a
    warning.

    A single function call can be invoked from softirq context only via
    smp_call_function_single_async().

    The only legit context is task context, so add a warning to that effect.

    Reported-by: luferry
    Signed-off-by: Peter Zijlstra
    Signed-off-by: Thomas Gleixner
    Link: https://lkml.kernel.org/r/20190718160601.GP3402@hirez.programming.kicks-ass.net

    Peter Zijlstra
     

23 Jun, 2019

2 commits

  • The return value is fixed. Remove it and amend the callers.

    [ tglx: Fixup arm/bL_switcher and powerpc/rtas ]

    Signed-off-by: Nadav Amit
    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Dave Hansen
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Andrew Morton
    Link: https://lkml.kernel.org/r/20190613064813.8102-2-namit@vmware.com

    Nadav Amit
     
  • cfd_data is marked as shared, but although it hold pointers to shared
    data structures, it is private per core.

    Signed-off-by: Nadav Amit
    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Dave Hansen
    Cc: Rik van Riel
    Link: https://lkml.kernel.org/r/20190613064813.8102-8-namit@vmware.com

    Nadav Amit
     

21 May, 2019

1 commit

  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner