Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1643261ybv; Sun, 23 Feb 2020 11:30:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwzvIT6GdMe5QqcKBgbmETHEse1jbniZCo1wUMNHWfrmrjT9tFvMbrjNDASQhlQAlyIEuue X-Received: by 2002:aca:f354:: with SMTP id r81mr9630911oih.90.1582486248317; Sun, 23 Feb 2020 11:30:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582486248; cv=none; d=google.com; s=arc-20160816; b=W54Shh0pItVBP7iPvYPSqkdicJY9F0UWr1hvbbm0JDbAL9WUUI4drptSl0++bCodhr ZpEC1pcVT0r2WQB0xFlfhY94EBYB9ru+o9DL/VtGcMX6bJe1gpTywygF4JpoWa3ugPGg lf9uVdAdqBdUtMNuCNUnCzbsvPDqXz/VyeT9UtNIIN8qOLI8Jrz9+UY9ESmrJGMJSiFl jB7U1+N1oWnC0oNpxT7n3GyFMXEqvOQMIpTP3XRf3iF8FOr37K0/de0IEYInJ/vDFI6G vrPnAVDqQ/HCf7F8Yu9C/cka+GZu+eHsYYrI5E56JRHa1GUpIztU7GsB422csf4bKbpz JLUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=S/gt1ClZDBx2EHcg5TZExEAPmoTedVh+52lP9/6aLUE=; b=LJbAuVDQsMa5thiQoZpVTyMkm9wFTq0W01qf1foqJb8nAIPn7l1Bvbd54Cuj4A2Hqa 5f3lrDgLwYLoMTmn5HAwryEX+ikMAhVUJcy5WtFVqW12vFjBHm5ZjkG3Pdk2pXbZeTGK rM9e0Ln/yrQfE0LznwW/Da3eGyxBCRzeebxkMRhf5sluoA2s4sisUcmlaKhn9yMindHo 7kVsBBr/NUc0X7BSwkGOoeKAA8YOVIAG/ue8z0g8hI6yDeHA3+hi47/TuVxno8nBqYah wZjGf3qE++4eFpMEhBBr0Rupc94VUf3aX0YbpwwRJUAzunMMJF/3pP4IlnuGb2f2PP8w z2Bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a205si4291355oif.159.2020.02.23.11.30.36; Sun, 23 Feb 2020 11:30:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbgBWTaR (ORCPT + 99 others); Sun, 23 Feb 2020 14:30:17 -0500 Received: from foss.arm.com ([217.140.110.172]:51484 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727306AbgBWTaN (ORCPT ); Sun, 23 Feb 2020 14:30:13 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E9F53FEC; Sun, 23 Feb 2020 11:30:12 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 11AE13F6CF; Sun, 23 Feb 2020 11:30:11 -0800 (PST) From: Qais Yousef To: Thomas Gleixner Cc: "Paul E . McKenney" , Qais Yousef , Davidlohr Bueso , Josh Triplett , linux-kernel@vger.kernel.org Subject: [PATCH v3 13/15] torture: Replace cpu_up/down with add/remove_cpu Date: Sun, 23 Feb 2020 19:29:40 +0000 Message-Id: <20200223192942.18420-14-qais.yousef@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200223192942.18420-1-qais.yousef@arm.com> References: <20200223192942.18420-1-qais.yousef@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The core device API performs extra housekeeping bits that are missing from directly calling cpu_up/down. See commit a6717c01ddc2 ("powerpc/rtas: use device model APIs and serialization during LPM") for an example description of what might go wrong. This also prepares to make cpu_up/down a private interface for anything but the cpu subsystem. Signed-off-by: Qais Yousef CC: Davidlohr Bueso CC: "Paul E. McKenney" CC: Josh Triplett CC: linux-kernel@vger.kernel.org --- kernel/torture.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/torture.c b/kernel/torture.c index 7c13f5558b71..a479689eac73 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -97,7 +97,7 @@ bool torture_offline(int cpu, long *n_offl_attempts, long *n_offl_successes, torture_type, cpu); starttime = jiffies; (*n_offl_attempts)++; - ret = cpu_down(cpu); + ret = remove_cpu(cpu); if (ret) { if (verbose) pr_alert("%s" TORTURE_FLAG @@ -148,7 +148,7 @@ bool torture_online(int cpu, long *n_onl_attempts, long *n_onl_successes, torture_type, cpu); starttime = jiffies; (*n_onl_attempts)++; - ret = cpu_up(cpu); + ret = add_cpu(cpu); if (ret) { if (verbose) pr_alert("%s" TORTURE_FLAG @@ -192,17 +192,18 @@ torture_onoff(void *arg) for_each_online_cpu(cpu) maxcpu = cpu; WARN_ON(maxcpu < 0); - if (!IS_MODULE(CONFIG_TORTURE_TEST)) + if (!IS_MODULE(CONFIG_TORTURE_TEST)) { for_each_possible_cpu(cpu) { if (cpu_online(cpu)) continue; - ret = cpu_up(cpu); + ret = add_cpu(cpu); if (ret && verbose) { pr_alert("%s" TORTURE_FLAG "%s: Initial online %d: errno %d\n", __func__, torture_type, cpu, ret); } } + } if (maxcpu == 0) { VERBOSE_TOROUT_STRING("Only one CPU, so CPU-hotplug testing is disabled"); -- 2.17.1