Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/frederic/linux-dynticks.git
  • Loading branch information
sfrothwell committed Dec 18, 2024
2 parents 1e903a6 + fc7d29f commit e6dc627
Show file tree
Hide file tree
Showing 50 changed files with 340 additions and 231 deletions.
9 changes: 9 additions & 0 deletions Documentation/arch/arm64/asymmetric-32bit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,12 @@ asymmetric system, a broken guest at EL1 could still attempt to execute
mode will return to host userspace with an ``exit_reason`` of
``KVM_EXIT_FAIL_ENTRY`` and will remain non-runnable until successfully
re-initialised by a subsequent ``KVM_ARM_VCPU_INIT`` operation.

NOHZ FULL
---------

Nohz full CPUs are not a desirable fallback target to run 32bits el0
applications. If present, a set of housekeeping CPUs that can do
the job instead is preferred. Otherwise 32-bit EL0 is not supported.
Should the need arise, appropriate support can be introduced in the
future.
10 changes: 4 additions & 6 deletions arch/arm/common/bL_switcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,11 @@ static struct task_struct *bL_switcher_thread_create(int cpu, void *arg)
{
struct task_struct *task;

task = kthread_create_on_node(bL_switcher_thread, arg,
cpu_to_node(cpu), "kswitcher_%d", cpu);
if (!IS_ERR(task)) {
kthread_bind(task, cpu);
wake_up_process(task);
} else
task = kthread_run_on_cpu(bL_switcher_thread, arg,
cpu, "kswitcher_%d");
if (IS_ERR(task))
pr_err("%s failed for CPU %d\n", __func__, cpu);

return task;
}

Expand Down
1 change: 1 addition & 0 deletions arch/arm64/include/asm/cpufeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ static inline bool supports_clearbhb(int scope)
}

const struct cpumask *system_32bit_el0_cpumask(void);
const struct cpumask *fallback_32bit_el0_cpumask(void);
DECLARE_STATIC_KEY_FALSE(arm64_mismatched_32bit_el0);

static inline bool system_supports_32bit_el0(void)
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ task_cpu_possible_mask(struct task_struct *p)
}
#define task_cpu_possible_mask task_cpu_possible_mask

const struct cpumask *task_cpu_fallback_mask(struct task_struct *p);

void verify_cpu_asid_bits(void);
void post_ttbr_update_workaround(void);

Expand Down
17 changes: 16 additions & 1 deletion arch/arm64/kernel/cpufeature.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include <linux/cpu.h>
#include <linux/kasan.h>
#include <linux/percpu.h>
#include <linux/sched/isolation.h>

#include <asm/cpu.h>
#include <asm/cpufeature.h>
Expand Down Expand Up @@ -1640,6 +1641,17 @@ const struct cpumask *system_32bit_el0_cpumask(void)
return cpu_possible_mask;
}

const struct cpumask *task_cpu_fallback_mask(struct task_struct *p)
{
if (!static_branch_unlikely(&arm64_mismatched_32bit_el0))
return housekeeping_cpumask(HK_TYPE_TICK);

if (!is_compat_thread(task_thread_info(p)))
return housekeeping_cpumask(HK_TYPE_TICK);

return system_32bit_el0_cpumask();
}

static int __init parse_32bit_el0_param(char *str)
{
allow_mismatched_32bit_el0 = true;
Expand Down Expand Up @@ -3741,7 +3753,10 @@ static int enable_mismatched_32bit_el0(unsigned int cpu)
static int lucky_winner = -1;

struct cpuinfo_arm64 *info = &per_cpu(cpu_data, cpu);
bool cpu_32bit = id_aa64pfr0_32bit_el0(info->reg_id_aa64pfr0);
bool cpu_32bit = false;

if (id_aa64pfr0_32bit_el0(info->reg_id_aa64pfr0) && housekeeping_cpu(cpu, HK_TYPE_TICK))
cpu_32bit = true;

if (cpu_32bit) {
cpumask_set_cpu(cpu, cpu_32bit_el0_mask);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kvm/i8254.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags)
pid_nr = pid_vnr(pid);
put_pid(pid);

pit->worker = kthread_create_worker(0, "kvm-pit/%d", pid_nr);
pit->worker = kthread_run_worker(0, "kvm-pit/%d", pid_nr);
if (IS_ERR(pit->worker))
goto fail_kthread;

Expand Down
2 changes: 1 addition & 1 deletion crypto/crypto_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ struct crypto_engine *crypto_engine_alloc_init_and_set(struct device *dev,
crypto_init_queue(&engine->queue, qlen);
spin_lock_init(&engine->queue_lock);

engine->kworker = kthread_create_worker(0, "%s", engine->name);
engine->kworker = kthread_run_worker(0, "%s", engine->name);
if (IS_ERR(engine->kworker)) {
dev_err(dev, "failed to create crypto request pump task\n");
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/cpufreq/cppc_cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static void __init cppc_freq_invariance_init(void)
if (fie_disabled)
return;

kworker_fie = kthread_create_worker(0, "cppc_fie");
kworker_fie = kthread_run_worker(0, "cppc_fie");
if (IS_ERR(kworker_fie)) {
pr_warn("%s: failed to create kworker_fie: %ld\n", __func__,
PTR_ERR(kworker_fie));
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_vblank_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ int drm_vblank_worker_init(struct drm_vblank_crtc *vblank)

INIT_LIST_HEAD(&vblank->pending_work);
init_waitqueue_head(&vblank->work_wait_queue);
worker = kthread_create_worker(0, "card%d-crtc%d",
worker = kthread_run_worker(0, "card%d-crtc%d",
vblank->dev->primary->index,
vblank->pipe);
if (IS_ERR(worker))
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ static int live_parallel_switch(void *arg)
if (!data[n].ce[0])
continue;

worker = kthread_create_worker(0, "igt/parallel:%s",
worker = kthread_run_worker(0, "igt/parallel:%s",
data[n].ce[0]->engine->name);
if (IS_ERR(worker)) {
err = PTR_ERR(worker);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gt/selftest_execlists.c
Original file line number Diff line number Diff line change
Expand Up @@ -3574,7 +3574,7 @@ static int smoke_crescendo(struct preempt_smoke *smoke, unsigned int flags)
arg[id].batch = NULL;
arg[id].count = 0;

worker[id] = kthread_create_worker(0, "igt/smoke:%d", id);
worker[id] = kthread_run_worker(0, "igt/smoke:%d", id);
if (IS_ERR(worker[id])) {
err = PTR_ERR(worker[id]);
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gt/selftest_hangcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ static int __igt_reset_engines(struct intel_gt *gt,
threads[tmp].engine = other;
threads[tmp].flags = flags;

worker = kthread_create_worker(0, "igt/%s",
worker = kthread_run_worker(0, "igt/%s",
other->name);
if (IS_ERR(worker)) {
err = PTR_ERR(worker);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gt/selftest_slpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ static int live_slpc_tile_interaction(void *arg)
return -ENOMEM;

for_each_gt(gt, i915, i) {
threads[i].worker = kthread_create_worker(0, "igt/slpc_parallel:%d", gt->info.id);
threads[i].worker = kthread_run_worker(0, "igt/slpc_parallel:%d", gt->info.id);

if (IS_ERR(threads[i].worker)) {
ret = PTR_ERR(threads[i].worker);
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/i915/selftests/i915_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ static int mock_breadcrumbs_smoketest(void *arg)
for (n = 0; n < ncpus; n++) {
struct kthread_worker *worker;

worker = kthread_create_worker(0, "igt/%d", n);
worker = kthread_run_worker(0, "igt/%d", n);
if (IS_ERR(worker)) {
ret = PTR_ERR(worker);
ncpus = n;
Expand Down Expand Up @@ -1645,7 +1645,7 @@ static int live_parallel_engines(void *arg)
for_each_uabi_engine(engine, i915) {
struct kthread_worker *worker;

worker = kthread_create_worker(0, "igt/parallel:%s",
worker = kthread_run_worker(0, "igt/parallel:%s",
engine->name);
if (IS_ERR(worker)) {
err = PTR_ERR(worker);
Expand Down Expand Up @@ -1806,7 +1806,7 @@ static int live_breadcrumbs_smoketest(void *arg)
unsigned int i = idx * ncpus + n;
struct kthread_worker *worker;

worker = kthread_create_worker(0, "igt/%d.%d", idx, n);
worker = kthread_run_worker(0, "igt/%d.%d", idx, n);
if (IS_ERR(worker)) {
ret = PTR_ERR(worker);
goto out_flush;
Expand Down Expand Up @@ -3219,7 +3219,7 @@ static int perf_parallel_engines(void *arg)

memset(&engines[idx].p, 0, sizeof(engines[idx].p));

worker = kthread_create_worker(0, "igt:%s",
worker = kthread_run_worker(0, "igt:%s",
engine->name);
if (IS_ERR(worker)) {
err = PTR_ERR(worker);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/disp/msm_disp_snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int msm_disp_snapshot_init(struct drm_device *drm_dev)

mutex_init(&kms->dump_mutex);

kms->dump_worker = kthread_create_worker(0, "%s", "disp_snapshot");
kms->dump_worker = kthread_run_worker(0, "%s", "disp_snapshot");
if (IS_ERR(kms->dump_worker))
DRM_ERROR("failed to create disp state task\n");

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/msm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int msm_atomic_init_pending_timer(struct msm_pending_timer *timer,
timer->kms = kms;
timer->crtc_idx = crtc_idx;

timer->worker = kthread_create_worker(0, "atomic-worker-%d", crtc_idx);
timer->worker = kthread_run_worker(0, "atomic-worker-%d", crtc_idx);
if (IS_ERR(timer->worker)) {
int ret = PTR_ERR(timer->worker);
timer->worker = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/msm_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
gpu->funcs = funcs;
gpu->name = name;

gpu->worker = kthread_create_worker(0, "gpu-worker");
gpu->worker = kthread_run_worker(0, "gpu-worker");
if (IS_ERR(gpu->worker)) {
ret = PTR_ERR(gpu->worker);
gpu->worker = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/msm_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ int msm_drm_kms_init(struct device *dev, const struct drm_driver *drv)
/* initialize event thread */
ev_thread = &priv->event_thread[drm_crtc_index(crtc)];
ev_thread->dev = ddev;
ev_thread->worker = kthread_create_worker(0, "crtc_event:%d", crtc->base.id);
ev_thread->worker = kthread_run_worker(0, "crtc_event:%d", crtc->base.id);
if (IS_ERR(ev_thread->worker)) {
ret = PTR_ERR(ev_thread->worker);
DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/chips-media/wave5/wave5-vpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static int wave5_vpu_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to get irq resource, falling back to polling\n");
hrtimer_init(&dev->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
dev->hrtimer.function = &wave5_vpu_timer_callback;
dev->worker = kthread_create_worker(0, "vpu_irq_thread");
dev->worker = kthread_run_worker(0, "vpu_irq_thread");
if (IS_ERR(dev->worker)) {
dev_err(&pdev->dev, "failed to create vpu irq worker\n");
ret = PTR_ERR(dev->worker);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static int mv88e6xxx_irq_poll_setup(struct mv88e6xxx_chip *chip)
kthread_init_delayed_work(&chip->irq_poll_work,
mv88e6xxx_irq_poll);

chip->kworker = kthread_create_worker(0, "%s", dev_name(chip->dev));
chip->kworker = kthread_run_worker(0, "%s", dev_name(chip->dev));
if (IS_ERR(chip->kworker))
return PTR_ERR(chip->kworker);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ice/ice_dpll.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ static int ice_dpll_init_worker(struct ice_pf *pf)
struct kthread_worker *kworker;

kthread_init_delayed_work(&d->work, ice_dpll_periodic_work);
kworker = kthread_create_worker(0, "ice-dplls-%s",
kworker = kthread_run_worker(0, "ice-dplls-%s",
dev_name(ice_pf_to_dev(pf)));
if (IS_ERR(kworker))
return PTR_ERR(kworker);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ice/ice_gnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static struct gnss_serial *ice_gnss_struct_init(struct ice_pf *pf)
pf->gnss_serial = gnss;

kthread_init_delayed_work(&gnss->read_work, ice_gnss_read);
kworker = kthread_create_worker(0, "ice-gnss-%s", dev_name(dev));
kworker = kthread_run_worker(0, "ice-gnss-%s", dev_name(dev));
if (IS_ERR(kworker)) {
kfree(gnss);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ice/ice_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3080,7 +3080,7 @@ static int ice_ptp_init_work(struct ice_pf *pf, struct ice_ptp *ptp)
/* Allocate a kworker for handling work required for the ports
* connected to the PTP hardware clock.
*/
kworker = kthread_create_worker(0, "ice-ptp-%s",
kworker = kthread_run_worker(0, "ice-ptp-%s",
dev_name(ice_pf_to_dev(pf)));
if (IS_ERR(kworker))
return PTR_ERR(kworker);
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/chrome/cros_ec_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ static int cros_ec_spi_devm_high_pri_alloc(struct device *dev,
int err;

ec_spi->high_pri_worker =
kthread_create_worker(0, "cros_ec_spi_high_pri");
kthread_run_worker(0, "cros_ec_spi_high_pri");

if (IS_ERR(ec_spi->high_pri_worker)) {
err = PTR_ERR(ec_spi->high_pri_worker);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ptp/ptp_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,

if (ptp->info->do_aux_work) {
kthread_init_delayed_work(&ptp->aux_work, ptp_aux_kworker);
ptp->kworker = kthread_create_worker(0, "ptp%d", ptp->index);
ptp->kworker = kthread_run_worker(0, "ptp%d", ptp->index);
if (IS_ERR(ptp->kworker)) {
err = PTR_ERR(ptp->kworker);
pr_err("failed to create ptp aux_worker %d\n", err);
Expand Down
7 changes: 2 additions & 5 deletions drivers/scsi/bnx2fc/bnx2fc_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2610,14 +2610,11 @@ static int bnx2fc_cpu_online(unsigned int cpu)

p = &per_cpu(bnx2fc_percpu, cpu);

thread = kthread_create_on_node(bnx2fc_percpu_io_thread,
(void *)p, cpu_to_node(cpu),
"bnx2fc_thread/%d", cpu);
thread = kthread_create_on_cpu(bnx2fc_percpu_io_thread,
(void *)p, cpu, "bnx2fc_thread/%d");
if (IS_ERR(thread))
return PTR_ERR(thread);

/* bind thread to the cpu */
kthread_bind(thread, cpu);
p->iothread = thread;
wake_up_process(thread);
return 0;
Expand Down
7 changes: 2 additions & 5 deletions drivers/scsi/bnx2i/bnx2i_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,11 @@ static int bnx2i_cpu_online(unsigned int cpu)

p = &per_cpu(bnx2i_percpu, cpu);

thread = kthread_create_on_node(bnx2i_percpu_io_thread, (void *)p,
cpu_to_node(cpu),
"bnx2i_thread/%d", cpu);
thread = kthread_create_on_cpu(bnx2i_percpu_io_thread, (void *)p,
cpu, "bnx2i_thread/%d");
if (IS_ERR(thread))
return PTR_ERR(thread);

/* bind thread to the cpu */
kthread_bind(thread, cpu);
p->iothread = thread;
wake_up_process(thread);
return 0;
Expand Down
6 changes: 2 additions & 4 deletions drivers/scsi/qedi/qedi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,13 +1961,11 @@ static int qedi_cpu_online(unsigned int cpu)
struct qedi_percpu_s *p = this_cpu_ptr(&qedi_percpu);
struct task_struct *thread;

thread = kthread_create_on_node(qedi_percpu_io_thread, (void *)p,
cpu_to_node(cpu),
"qedi_thread/%d", cpu);
thread = kthread_create_on_cpu(qedi_percpu_io_thread, (void *)p,
cpu, "qedi_thread/%d");
if (IS_ERR(thread))
return PTR_ERR(thread);

kthread_bind(thread, cpu);
p->iothread = thread;
wake_up_process(thread);
return 0;
Expand Down
6 changes: 2 additions & 4 deletions drivers/soc/fsl/qbman/qman_test_stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,12 @@ static int on_all_cpus(int (*fn)(void))
.fn = fn,
.started = ATOMIC_INIT(0)
};
struct task_struct *k = kthread_create(bstrap_fn, &bstrap,
"hotpotato%d", cpu);
struct task_struct *k = kthread_run_on_cpu(bstrap_fn, &bstrap,
cpu, "hotpotato%d");
int ret;

if (IS_ERR(k))
return -ENOMEM;
kthread_bind(k, cpu);
wake_up_process(k);
/*
* If we call kthread_stop() before the "wake up" has had an
* effect, then the thread may exit with -EINTR without ever
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ static int spi_init_queue(struct spi_controller *ctlr)
ctlr->busy = false;
ctlr->queue_empty = true;

ctlr->kworker = kthread_create_worker(0, dev_name(&ctlr->dev));
ctlr->kworker = kthread_run_worker(0, dev_name(&ctlr->dev));
if (IS_ERR(ctlr->kworker)) {
dev_err(&ctlr->dev, "failed to create message pump kworker\n");
return PTR_ERR(ctlr->kworker);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/typec/tcpm/tcpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -7635,7 +7635,7 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
mutex_init(&port->lock);
mutex_init(&port->swap_lock);

port->wq = kthread_create_worker(0, dev_name(dev));
port->wq = kthread_run_worker(0, dev_name(dev));
if (IS_ERR(port->wq))
return ERR_CAST(port->wq);
sched_set_fifo(port->wq->task);
Expand Down
2 changes: 1 addition & 1 deletion drivers/vdpa/vdpa_sim/vdpa_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr,
dev = &vdpasim->vdpa.dev;

kthread_init_work(&vdpasim->work, vdpasim_work_fn);
vdpasim->worker = kthread_create_worker(0, "vDPA sim worker: %s",
vdpasim->worker = kthread_run_worker(0, "vDPA sim worker: %s",
dev_attr->name);
if (IS_ERR(vdpasim->worker))
goto err_iommu;
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/watchdog_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ int __init watchdog_dev_init(void)
{
int err;

watchdog_kworker = kthread_create_worker(0, "watchdogd");
watchdog_kworker = kthread_run_worker(0, "watchdogd");
if (IS_ERR(watchdog_kworker)) {
pr_err("Failed to create watchdog kworker\n");
return PTR_ERR(watchdog_kworker);
Expand Down
Loading

0 comments on commit e6dc627

Please sign in to comment.