Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp42648lfe; Fri, 15 Apr 2022 18:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM5w9toIzN1TX8UVYO/jPxGXPZVPc6WiuOpvA+DwhWaHi5+89TFYBimd2Mc7pYedssT5sa X-Received: by 2002:a65:480a:0:b0:39c:c745:6f59 with SMTP id h10-20020a65480a000000b0039cc7456f59mr1235222pgs.33.1650072725455; Fri, 15 Apr 2022 18:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650072725; cv=none; d=google.com; s=arc-20160816; b=ZGVnTKTKnIiiSlVML20byKYAC92RZwRjI5nEJ1o5mY51zozFkXE8qGD3BOo81w0K34 ui/UOWEHEwsP52zvE93/RrOOOPNDZYZfn51LBFVppW/34xyXnSxKoNaiKnp3+KIvNMKG lfAlNjZjTMoEgFQoHPBpIHs/TjhMntc/7X6DEtnn10xJRXIJld/+QtnBALAYxnMpRt3+ 5xx5NI6iat07hn5FVapK+vBTfkGdnfDgzRYYC7yKh5PDhSpX0BHVwWRMjBKT2cbnFJAH QwmJ457crXs7ZxOdJOvvSfJash2lCj8cj6kskg9ug9kKHcTZJTOz9gl4mfkSQJFcDcaQ wMxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WVM+htEfNmHAQF7cqTufoGSsyBVU+M+E/RstzGcMmgg=; b=f7JTOYSYyCXtRPwd4Pg/sTx4nKwjhU5ncza0erul/76k08BvLT6nZE8NcNrTy9l3ai EpO0IRI1OcRsIx/Ea/yV5Um+q48TlZV+b+FQEK6Eqwr1bj/n1z6AfoRidYpX8x/7keEA rRlHrZid7gIUI66ITQGUzCm9ejXosrPyZ3jo5nbY1eH8dd81iKoV/cpwmPAbLAIT2qxB mMAz/R9mGSr3ioKa9hG1EPdyfz2BYB0arDTAAA62VLF/uJ5Ya6oq3TZ18/kBtd5RUxEK AiEx1Q49aMUStqRrE2BpLVK889ZpGJuBTGxmo6mMeSaO7NCdhXOMqvfiU/fgLrrdOvDe ruhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=halm7q+h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 63-20020a621742000000b0050605f7112bsi2784665pfx.130.2022.04.15.18.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=halm7q+h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2308146149; Fri, 15 Apr 2022 17:59:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348860AbiDOCuQ (ORCPT + 99 others); Thu, 14 Apr 2022 22:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348840AbiDOCtz (ORCPT ); Thu, 14 Apr 2022 22:49:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EFF0AA8891 for ; Thu, 14 Apr 2022 19:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649990843; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WVM+htEfNmHAQF7cqTufoGSsyBVU+M+E/RstzGcMmgg=; b=halm7q+h23zViZI16tBJeytPvN1q7TPBnWH+xQbsYVg4Es6wvguFsPtgMVRhhUTfCOOJBP q62yXCWpMYeAGMe3uOgUu5Sb6VM5OrltdqJ8l6lofqfxIzABJv4U0bQwMkFk11ZMbJwdJu D1ayFpTO4LKuFL5vjweFlCGmLVTLCG0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-513-iaIPJJVTOhuC1W0Do6YdZA-1; Thu, 14 Apr 2022 22:47:19 -0400 X-MC-Unique: iaIPJJVTOhuC1W0Do6YdZA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2F2D03C01C06; Fri, 15 Apr 2022 02:47:19 +0000 (UTC) Received: from dqiao.bos.com (unknown [10.22.8.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE218440ADA; Fri, 15 Apr 2022 02:47:18 +0000 (UTC) From: Donghai Qiao To: akpm@linux-foundation.org, sfr@canb.auug.org.au, arnd@arndb.de, peterz@infradead.org, heying24@huawei.com, andriy.shevchenko@linux.intel.com, axboe@kernel.dk, rdunlap@infradead.org, tglx@linutronix.de, gor@linux.ibm.com Cc: donghai.w.qiao@gmail.com, linux-kernel@vger.kernel.org, Donghai Qiao Subject: [PATCH 09/11] smp: replace smp_call_function_single_async with smp_xcall_private Date: Thu, 14 Apr 2022 22:46:59 -0400 Message-Id: <20220415024701.876364-10-dqiao@redhat.com> In-Reply-To: <20220415024701.876364-1-dqiao@redhat.com> References: <20220415024701.876364-1-dqiao@redhat.com> Reply-To: dqiao@redhat.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace smp_call_function_single_async with smp_xcall_private and modify all the invocations. Signed-off-by: Donghai Qiao --- arch/mips/kernel/process.c | 2 +- arch/mips/kernel/smp.c | 2 +- arch/s390/pci/pci_irq.c | 2 +- arch/x86/kernel/cpuid.c | 2 +- arch/x86/lib/msr-smp.c | 2 +- block/blk-mq.c | 2 +- drivers/clocksource/ingenic-timer.c | 2 +- drivers/cpuidle/coupled.c | 2 +- drivers/net/ethernet/cavium/liquidio/lio_core.c | 2 +- include/linux/smp.h | 3 --- kernel/debug/debug_core.c | 2 +- kernel/sched/core.c | 2 +- kernel/sched/fair.c | 2 +- net/core/dev.c | 2 +- 14 files changed, 13 insertions(+), 16 deletions(-) diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index c2d5f4bfe1f3..5a63adccdcaf 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -745,7 +745,7 @@ static void raise_backtrace(cpumask_t *mask) } csd = &per_cpu(backtrace_csd, cpu); - smp_call_function_single_async(cpu, csd); + smp_xcall_private(cpu, csd, XCALL_TYPE_ASYNC); } } diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index d5bb38bfaef5..6202e9c1ca0c 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -701,7 +701,7 @@ void tick_broadcast(const struct cpumask *mask) for_each_cpu(cpu, mask) { csd = &per_cpu(tick_broadcast_csd, cpu); - smp_call_function_single_async(cpu, csd); + smp_xcall_private(cpu, csd, XCALL_TYPE_ASYNC); } } diff --git a/arch/s390/pci/pci_irq.c b/arch/s390/pci/pci_irq.c index 325c42c6ddb4..37724c600d51 100644 --- a/arch/s390/pci/pci_irq.c +++ b/arch/s390/pci/pci_irq.c @@ -212,7 +212,7 @@ static void zpci_handle_fallback_irq(void) continue; INIT_CSD(&cpu_data->csd, zpci_handle_remote_irq, &cpu_data->scheduled); - smp_call_function_single_async(cpu, &cpu_data->csd); + smp_xcall_private(cpu, &cpu_data->csd, XCALL_TYPE_ASYNC); } } diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index 6f7b8cc1bc9f..3e75dfe07314 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c @@ -81,7 +81,7 @@ static ssize_t cpuid_read(struct file *file, char __user *buf, cmd.regs.eax = pos; cmd.regs.ecx = pos >> 32; - err = smp_call_function_single_async(cpu, &csd); + err = smp_xcall_private(cpu, &csd, XCALL_TYPE_ASYNC); if (err) break; wait_for_completion(&cmd.done); diff --git a/arch/x86/lib/msr-smp.c b/arch/x86/lib/msr-smp.c index 68170a28270f..8c6b85bdc2d3 100644 --- a/arch/x86/lib/msr-smp.c +++ b/arch/x86/lib/msr-smp.c @@ -178,7 +178,7 @@ int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) init_completion(&rv.done); rv.msr.msr_no = msr_no; - err = smp_call_function_single_async(cpu, &csd); + err = smp_xcall_private(cpu, &csd, XCALL_TYPE_ASYNC); if (!err) { wait_for_completion(&rv.done); err = rv.msr.err; diff --git a/block/blk-mq.c b/block/blk-mq.c index ed3ed86f7dd2..548960494d79 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1062,7 +1062,7 @@ static void blk_mq_complete_send_ipi(struct request *rq) list = &per_cpu(blk_cpu_done, cpu); if (llist_add(&rq->ipi_list, list)) { INIT_CSD(&rq->csd, __blk_mq_complete_request_remote, rq); - smp_call_function_single_async(cpu, &rq->csd); + smp_xcall_private(cpu, &rq->csd, XCALL_TYPE_ASYNC); } } diff --git a/drivers/clocksource/ingenic-timer.c b/drivers/clocksource/ingenic-timer.c index 24ed0f1f089b..30e437679ca9 100644 --- a/drivers/clocksource/ingenic-timer.c +++ b/drivers/clocksource/ingenic-timer.c @@ -121,7 +121,7 @@ static irqreturn_t ingenic_tcu_cevt_cb(int irq, void *dev_id) csd = &per_cpu(ingenic_cevt_csd, timer->cpu); csd->info = (void *) &timer->cevt; csd->func = ingenic_per_cpu_event_handler; - smp_call_function_single_async(timer->cpu, csd); + smp_xcall_private(timer->cpu, csd, XCALL_TYPE_ASYNC); } return IRQ_HANDLED; diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c index 74068742cef3..bec03fdc6edf 100644 --- a/drivers/cpuidle/coupled.c +++ b/drivers/cpuidle/coupled.c @@ -334,7 +334,7 @@ static void cpuidle_coupled_poke(int cpu) call_single_data_t *csd = &per_cpu(cpuidle_coupled_poke_cb, cpu); if (!cpumask_test_and_set_cpu(cpu, &cpuidle_coupled_poke_pending)) - smp_call_function_single_async(cpu, csd); + smp_xcall_private(cpu, csd, XCALL_TYPE_ASYNC); } /** diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c index 73cb03266549..ae97533c7f8b 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_core.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c @@ -729,7 +729,7 @@ static void liquidio_napi_drv_callback(void *arg) napi_schedule_irqoff(&droq->napi); } else { INIT_CSD(&droq->csd, napi_schedule_wrapper, &droq->napi); - smp_call_function_single_async(droq->cpu_id, &droq->csd); + smp_xcall_private(droq->cpu_id, &droq->csd, XCALL_TYPE_ASYNC); } } diff --git a/include/linux/smp.h b/include/linux/smp.h index 673192e2192e..de9b850722b3 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -206,9 +206,6 @@ extern unsigned int total_cpus; int smp_call_function_single(int cpuid, smp_call_func_t func, void *info, int wait); -#define smp_call_function_single_async(cpu, csd) \ - smp_xcall_private(cpu, csd, XCALL_TYPE_ASYNC) - /* * Cpus stopping functions in panic. All have default weak definitions. * Architecture-dependent code may override them. diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index da06a5553835..cb69113251c9 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -264,7 +264,7 @@ void __weak kgdb_roundup_cpus(void) continue; kgdb_info[cpu].rounding_up = true; - ret = smp_call_function_single_async(cpu, csd); + ret = smp_xcall_private(cpu, csd, XCALL_TYPE_ASYNC); if (ret) kgdb_info[cpu].rounding_up = false; } diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 417355fbe32d..610e02b4c598 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -836,7 +836,7 @@ void hrtick_start(struct rq *rq, u64 delay) if (rq == this_rq()) __hrtick_restart(rq); else - smp_call_function_single_async(cpu_of(rq), &rq->hrtick_csd); + smp_xcall_private(cpu_of(rq), &rq->hrtick_csd, XCALL_TYPE_ASYNC); } #else diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d4bd299d67ab..1b060a64cb93 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10461,7 +10461,7 @@ static void kick_ilb(unsigned int flags) * is idle. And the softirq performing nohz idle load balance * will be run before returning from the IPI. */ - smp_call_function_single_async(ilb_cpu, &cpu_rq(ilb_cpu)->nohz_csd); + smp_xcall_private(ilb_cpu, &cpu_rq(ilb_cpu)->nohz_csd, XCALL_TYPE_ASYNC); } /* diff --git a/net/core/dev.c b/net/core/dev.c index 8c6c08446556..0c8e18f6f53c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5788,7 +5788,7 @@ static void net_rps_send_ipi(struct softnet_data *remsd) struct softnet_data *next = remsd->rps_ipi_next; if (cpu_online(remsd->cpu)) - smp_call_function_single_async(remsd->cpu, &remsd->csd); + smp_xcall_private(remsd->cpu, &remsd->csd, XCALL_TYPE_ASYNC); remsd = next; } #endif -- 2.27.0