Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3446186imm; Tue, 29 May 2018 07:24:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLwR8MlNqswWCVuw0sjhg8ivnCNIvwQoJuNjjvAqBcLGtmYzAoeVcwRYKJO3vjQwN/jOdTe X-Received: by 2002:a63:b145:: with SMTP id g5-v6mr9341459pgp.164.1527603869444; Tue, 29 May 2018 07:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527603869; cv=none; d=google.com; s=arc-20160816; b=GWyg1xkbGgVe6R1Wnow2awmXDWPyeZXG+unyCnTaRnN16DvGGgumnbh9VWt5Nv/Zxd IY3jP+BDmm+N535tMS7l7VPVh7FU0QXL+oDRr0kVnrS8P6/ZeJ4tACFsXAjAseVsZXbM Lq9gP6NybQATVj4XKOz+vl0aBxN6QFj+JvgAzdr86F7g54Bs7kstQ3Gq53nPJK2U6p/d rQccIE3iDx0Qiueouudn7b0dJNuBBShfzRDWvOYwtDCGb7BzsNNT4GgxiuTtEKrSJzpu 1bi/eWeY2e7zJpHUOqOc6zFT2EbEJA/3W2xltk6QAj/aT9i+cH9GyXFeXRrxrcP727gu TRXg== 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:arc-authentication-results; bh=lH9KOJ5G4uAB1lIE3UsY85aRNN/odVunTvURQfibRQY=; b=UQMTrTYzBRZbdtFjXJxqJuXwjcBVWdT3eowBlSS3KxZoixGSjnwqJv7gF56qzmPsXH 3jWtBOSQB5Hsh2WzV+dojXqGVD8CqAPX6WPbgUyOsujBMKs1oVXp3SqNd7EtxQJ7+1x2 D/AOz2LbCKUTiBASFl+aH55i7HSm1GL+ybWAA4miD3jRVIlk+oMPSsXVGyBIYKR1LTo2 00DUst+t4vDRIQTB/I5yvBAXzRBz1dmjIePP/U/s/q9g9AR85D+yj/kEw7YN3f+PvPRR NRgz0N07sRac79hm2xKq1XjMvgan+6Y+1nvASExCcvoyoMMd47JJIrEvechgxA2tCnRO AlSw== 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 a11-v6si25740945pgt.680.2018.05.29.07.24.14; Tue, 29 May 2018 07:24:29 -0700 (PDT) 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 S935354AbeE2OW5 (ORCPT + 99 others); Tue, 29 May 2018 10:22:57 -0400 Received: from smtp4.ccs.ornl.gov ([160.91.203.40]:38208 "EHLO smtp4.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935325AbeE2OWq (ORCPT ); Tue, 29 May 2018 10:22:46 -0400 Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id 15F2110052DA; Tue, 29 May 2018 10:22:07 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 145352C1; Tue, 29 May 2018 10:22:07 -0400 (EDT) From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , NeilBrown Cc: Linux Kernel Mailing List , Lustre Development List , Dmitry Eremin , James Simmons Subject: [PATCH v2 25/25] staging: lustre: ptlrpc: use current CPU instead of hardcoded 0 Date: Tue, 29 May 2018 10:22:05 -0400 Message-Id: <1527603725-30560-26-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1527603725-30560-1-git-send-email-jsimmons@infradead.org> References: <1527603725-30560-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Eremin fix crash if CPU 0 disabled. Signed-off-by: Dmitry Eremin Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8710 Reviewed-on: https://review.whamcloud.com/23305 Reviewed-by: Doug Oucharek Reviewed-by: Andreas Dilger Signed-off-by: James Simmons --- Changelog: v1) New patch to address crash in ptlrpc drivers/staging/lustre/lustre/ptlrpc/service.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index 3fd8c74..8e74a45 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -421,7 +421,7 @@ static void ptlrpc_at_timer(struct timer_list *t) * there are. */ /* weight is # of HTs */ - if (cpumask_weight(topology_sibling_cpumask(0)) > 1) { + if (cpumask_weight(topology_sibling_cpumask(smp_processor_id())) > 1) { /* depress thread factor for hyper-thread */ factor = factor - (factor >> 1) + (factor >> 3); } @@ -2221,15 +2221,16 @@ static int ptlrpc_hr_main(void *arg) struct ptlrpc_hr_thread *hrt = arg; struct ptlrpc_hr_partition *hrp = hrt->hrt_partition; LIST_HEAD(replies); - char threadname[20]; int rc; - snprintf(threadname, sizeof(threadname), "ptlrpc_hr%02d_%03d", - hrp->hrp_cpt, hrt->hrt_id); unshare_fs_struct(); rc = cfs_cpt_bind(ptlrpc_hr.hr_cpt_table, hrp->hrp_cpt); if (rc != 0) { + char threadname[20]; + + snprintf(threadname, sizeof(threadname), "ptlrpc_hr%02d_%03d", + hrp->hrp_cpt, hrt->hrt_id); CWARN("Failed to bind %s on CPT %d of CPT table %p: rc = %d\n", threadname, hrp->hrp_cpt, ptlrpc_hr.hr_cpt_table, rc); } @@ -2528,7 +2529,7 @@ int ptlrpc_hr_init(void) init_waitqueue_head(&ptlrpc_hr.hr_waitq); - weight = cpumask_weight(topology_sibling_cpumask(0)); + weight = cpumask_weight(topology_sibling_cpumask(smp_processor_id())); cfs_percpt_for_each(hrp, i, ptlrpc_hr.hr_partitions) { hrp->hrp_cpt = i; -- 1.8.3.1