From patchwork Tue Mar 28 08:34:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 75906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2061211vqo; Tue, 28 Mar 2023 01:41:57 -0700 (PDT) X-Google-Smtp-Source: AK7set+16MRmf+n2Af4QGDd/u70l3DNockgkCQrbOzi43Mo3DU+wNY0uyk8v0yJmDeeHUkOFkbfI X-Received: by 2002:a05:6a20:4c29:b0:da:3bce:75e2 with SMTP id fm41-20020a056a204c2900b000da3bce75e2mr10518991pzb.2.1679992916982; Tue, 28 Mar 2023 01:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679992916; cv=none; d=google.com; s=arc-20160816; b=Q0BFZg3D2xYSw4Ohct+/1SsI13M6VCxgTtF/p/y63fREbRqv0wrH8KMFKIJywkuHea ZjDH7MAKB9WV7grP1kji1DCXsaK5pVA3afX/8IkjL12UPnRgZlRAoskKOVCnHfih4XwT 7wZ9xr58mMxNjMkmE+W+ABnNkRK5eoN5L8nYW0rZDii7KpilM0HFT+tebcw09xJaZA3q TaKJJNTKBUxV4p41xrnBvCdVCB+zXCc1i/XqUlBGq8REM6owVqMmicKLpaEesPOektEZ ZMNXqKvOY16OtsXCYiboKHLrHI6UFnK0gKbLyC6opGm2t2+EQPFWOrXEWDm9MlSG+U9K mdbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Uj3Gz9DQvbGioAeN5LafCO6bBWg9r/sA+4PyB9L7G3s=; b=hLk6GIZ1c1mwyxDCZKZ4rIdgOhHjxwTixiT2ztcB+W2PuHsrJwkIHZFTmUUAooisrz tgMqQUGcK/GYOuBaxrSPOs0RJriehkwkgSde8kgiQLxGD/ReLa7MXednkTiDRCiPfFto G9rvXrnmd7qxiraVedZTPocz5hCave+7fJy39Pr/cplrkTvS6Fi35jrcT0GJ8PeJ5dkV 8LV+UNRJMAO4pvgRlBneVNaS6fb6GMuq++6IbjShVMRHia3WzyWUJGfg5h//aShJ8B+w BUx2fd2b/sJJ1pkFYlZtf1CHuNapjHoMp54lfwVjgTfLIWJTmj2E/x8emVbjshloyhMB oASg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Djw0WY+j; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a191-20020a6390c8000000b00502f1a79abbsi29149419pge.619.2023.03.28.01.41.44; Tue, 28 Mar 2023 01:41:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Djw0WY+j; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232477AbjC1IfS (ORCPT + 99 others); Tue, 28 Mar 2023 04:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232345AbjC1Iew (ORCPT ); Tue, 28 Mar 2023 04:34:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16B2C49E9; Tue, 28 Mar 2023 01:34:51 -0700 (PDT) Date: Tue, 28 Mar 2023 08:34:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1679992487; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uj3Gz9DQvbGioAeN5LafCO6bBWg9r/sA+4PyB9L7G3s=; b=Djw0WY+jpTx+2J8yMwnbzJlCJneo0RSRFMz1JNNaowlqLuEXrg+VRKw04wEnrrr13aVrn4 Pcc2AgyTNILa5YUK/2NeZhavr9v7WWkopCrTGV7qEmsd9h9JpYbFHiwkO1fNfQ7WZJZeFb 97ha2r5NP3smMnJSHLExe99QvnzCO5Oe2B8FlEyAv5Hn91nHig+pXNJmzss7YTSl/aTrCW 8sx/AYQ2qV3H+iq9bnlQ7/1QmWgfR3ixI9/+3hXclh486Bk520x+z8WfJaj+lbFnPdfB2d oReSOcZ8sRE/tu88FXvooUe2zVXIAtSC8PGTPlc6hNpvTWI6tcbDWeZFaAYEow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1679992487; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uj3Gz9DQvbGioAeN5LafCO6bBWg9r/sA+4PyB9L7G3s=; b=pV9eOMJvFElNoRSHdm5rWChGY+RONdT/wA3ERMCL5QN/n0ft23mIBnAInDU8mJegW/60gy nenAaCnsf2rLRpDg== From: "tip-bot2 for Paul E. McKenney" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] locking/csd_lock: Remove per-CPU data indirection from CSD lock debugging Cc: "Paul E. McKenney" , "Peter Zijlstra (Intel)" , Juergen Gross , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230321005516.50558-3-paulmck@kernel.org> References: <20230321005516.50558-3-paulmck@kernel.org> MIME-Version: 1.0 Message-ID: <167999248708.5837.15614730966447536861.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760938696069069685?= X-GMAIL-MSGID: =?utf-8?q?1761600252505444369?= The following commit has been merged into the smp/core branch of tip: Commit-ID: 6366d062e7f97499409979f23f4107a6c45edb04 Gitweb: https://git.kernel.org/tip/6366d062e7f97499409979f23f4107a6c45edb04 Author: Paul E. McKenney AuthorDate: Mon, 20 Mar 2023 17:55:15 -07:00 Committer: Peter Zijlstra CommitterDate: Fri, 24 Mar 2023 11:01:26 +01:00 locking/csd_lock: Remove per-CPU data indirection from CSD lock debugging The diagnostics added by this commit were extremely useful in one instance: a5aabace5fb8 ("locking/csd_lock: Add more data to CSD lock debugging") However, they have not seen much action since, and there have been some concerns expressed that the complexity is not worth the benefit. Therefore, manually revert the following commit preparatory commit: de7b09ef658d ("locking/csd_lock: Prepare more CSD lock debugging") Signed-off-by: Paul E. McKenney Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juergen Gross Link: https://lore.kernel.org/r/20230321005516.50558-3-paulmck@kernel.org --- kernel/smp.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 038d666..7a85bcd 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -31,12 +31,8 @@ #define CSD_TYPE(_csd) ((_csd)->node.u_flags & CSD_FLAG_TYPE_MASK) -struct cfd_percpu { - call_single_data_t csd; -}; - struct call_function_data { - struct cfd_percpu __percpu *pcpu; + call_single_data_t __percpu *csd; cpumask_var_t cpumask; cpumask_var_t cpumask_ipi; }; @@ -59,8 +55,8 @@ int smpcfd_prepare_cpu(unsigned int cpu) free_cpumask_var(cfd->cpumask); return -ENOMEM; } - cfd->pcpu = alloc_percpu(struct cfd_percpu); - if (!cfd->pcpu) { + cfd->csd = alloc_percpu(call_single_data_t); + if (!cfd->csd) { free_cpumask_var(cfd->cpumask); free_cpumask_var(cfd->cpumask_ipi); return -ENOMEM; @@ -75,7 +71,7 @@ int smpcfd_dead_cpu(unsigned int cpu) free_cpumask_var(cfd->cpumask); free_cpumask_var(cfd->cpumask_ipi); - free_percpu(cfd->pcpu); + free_percpu(cfd->csd); return 0; } @@ -730,7 +726,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask, cpumask_clear(cfd->cpumask_ipi); for_each_cpu(cpu, cfd->cpumask) { - call_single_data_t *csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd; + call_single_data_t *csd = per_cpu_ptr(cfd->csd, cpu); if (cond_func && !cond_func(cpu, info)) continue; @@ -774,7 +770,7 @@ static void smp_call_function_many_cond(const struct cpumask *mask, for_each_cpu(cpu, cfd->cpumask) { call_single_data_t *csd; - csd = &per_cpu_ptr(cfd->pcpu, cpu)->csd; + csd = per_cpu_ptr(cfd->csd, cpu); csd_lock_wait(csd); } }