Received: by 10.213.65.68 with SMTP id h4csp1857401imn; Mon, 19 Mar 2018 15:24:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELteKKS2ATEEPNzb+5GJKPjsKQ8eD9iZptx7yv/4oiZZA4zSOZ9t9hK47lbAAj4yr5WTMJCe X-Received: by 2002:a17:902:5489:: with SMTP id e9-v6mr6152974pli.306.1521498279571; Mon, 19 Mar 2018 15:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521498279; cv=none; d=google.com; s=arc-20160816; b=wKQqn/Y/QrCxvCAekyzoKcRh2cH/dJLb97HOTLq63RK1WYnRt8VM1w6DRpD7sRZ0Dz A9k9XL9osjD5NlUDmpibrwacwdIZQosYO21AfrenWxEo9WXxlITvVHSjziWwOasa/Zq7 xM/Kf/KBMxGUR2VV6xJ14GaLrllZjmCMcjpHpIBs7mSZHKQJQoJsWwyeKryblpiBUfJr i68wc/d/Cf2C4cNPibFIFEwUlTF0UXNxxx675onFCzaSz2KEq/JpsShb+CJvs/GB8zyz XSTHL6VWt1VGQpBaUezBH8F5CVrSrzXVImepkUhe3zlOKx/2ZFPz6sHrhxn7hmGxg6MV 66sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=RBcRX6pRmv001DFYD0mhbWlf+R8FJ6Iu31dgtNiiCpg=; b=spRNz017e5vLXghFBz0nxNS+uecYTD0dZ2jP3O+UNAWh6zJg6P//7akdB9GSRekxdv /ld4R7UuNC75e9RMxLBxAhHSxfl2lgKjAkKQcQxen4AUwOyN0GbHOd3GZ42+W+uiL6QQ Bxm2IuzX1AhWGdJ8cHIOnMhCz8wZONPuK1EGmtPGVdcmtcs38y7mYtaJaPGQdijVfccT HLkNfsf6IeCnq8f5RQXNsk6hyQsJxOWpXztdxVee7/+0ZTF7YmAX7iC6R1AF0kQ6MmA2 f0KnRc7olQIunlMC/meQAGOt6JrEItB8t5uFnMD3gNJUrtW+ci1IHXMfsOsO5JOxJxAA 0e6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=MQZkxpfX; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si174116pgv.74.2018.03.19.15.24.10; Mon, 19 Mar 2018 15:24:39 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=MQZkxpfX; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933904AbeCSPtL (ORCPT + 99 others); Mon, 19 Mar 2018 11:49:11 -0400 Received: from mail-co1nam03hn0231.outbound.protection.outlook.com ([104.47.40.231]:31040 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933765AbeCSPsy (ORCPT ); Mon, 19 Mar 2018 11:48:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RBcRX6pRmv001DFYD0mhbWlf+R8FJ6Iu31dgtNiiCpg=; b=MQZkxpfXKT6XpV+/P30vIKv7fuFFEWoJ9PN6Yn9+5YXVsgIwFKUDLZcc1FKe+5z5Ib1kvtkfPO1Rln1SKNreWlyXwG4Y/vhl1xE/X+KQqnMaAXx3B0U/96ZdQN/8DYvlO0gORYdqyOGZdA8+o7GoqqXCG5tt13k8TRy1YrtbbAQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0936.namprd21.prod.outlook.com (52.132.131.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.609.2; Mon, 19 Mar 2018 15:48:52 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:48:52 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: NeilBrown , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 067/124] staging: lustre: disable preempt while sampling processor id. Thread-Topic: [PATCH AUTOSEL for 4.15 067/124] staging: lustre: disable preempt while sampling processor id. Thread-Index: AQHTv5mwxkDvAm2gK0+I0+b/zxmAJQ== Date: Mon, 19 Mar 2018 15:48:13 +0000 Message-ID: <20180319154645.11350-67-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0936;7:ZbcTiI7tGTSUrXNgvm3CTwbcn2L1Myas+NcBPOe+vbrGmFVYPWIjw8/ZhWZnfqX0utgGfqNlTTyT/WULrJLFSykeNIrQAp1sd1aPXl5Fx+Ipg5/I6DzBr9zoKY1GoM9cOaBxmE+9SivkSdf6B/M2AED6LBd7Yki7WBlAUuBNjanxzXXYUYrfcpDPqbCnyIDaDj8H2ZqS/jr/1pkuCWoVHKmIlQdJbJBoWKw+0j6S7UN5OBrGDAFEfMrMQ5TGpQlq;20:Rv5Cpg+cneX2Gejwwr0YNjAUmN+A8j1ebLOoO7FWs37J2AtMZ6JTyLANo79To8z8SKz0D3oFehxwIG+lMwtK1RNkgFkgWJbV+jWFra8FUggUDfWNulXs1/g31y1IOC6L55BPArOiYMQyRvP5GzC/DJyHCU9aE9VUUpgMPZIwz/4= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8c4460eb-f314-4782-34a6-08d58db0ea60 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0936; x-ms-traffictypediagnostic: DM5PR2101MB0936: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231221)(944501300)(52105095)(6055026)(61426038)(61427038)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:DM5PR2101MB0936;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0936; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:SPM;SFS:(10019020)(39380400002)(346002)(39860400002)(366004)(376002)(396003)(199004)(189003)(2900100001)(3280700002)(2950100002)(10290500003)(66066001)(106356001)(76176011)(86612001)(6666003)(478600001)(5250100002)(6512007)(6486002)(107886003)(36756003)(97736004)(72206003)(25786009)(6436002)(53936002)(7736002)(2501003)(54906003)(110136005)(105586002)(10090500001)(2906002)(86362001)(305945005)(5660300001)(316002)(8676002)(6346003)(1076002)(3846002)(3660700001)(81156014)(4326008)(14454004)(26005)(6116002)(102836004)(8936002)(81166006)(6506007)(186003)(22452003)(59450400001)(99286004)(68736007)(22906009)(13693001);DIR:OUT;SFP:1501;SCL:5;SRVR:DM5PR2101MB0936;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: hAT9Xm+jPTJORGxJHjMXFMQCxbHhtbc6ffL9uiGJmUotQsFTBr/dBO2OXfBI5Kj88tIWZdxx3fwYbC5ZL0Zt9ABIJak3BYodNHfyMxh5g0yhFAboNFvuG5392GxqopWAGTErl0DUqmDsUuOMfQYQGEa2Zfnz0c8kmo7sJQeA695YHPPrab0uGWwkbYQ4w4RN3c/TPhhAhslfB2XHffGJW1sNEVoNZbSeAZXA1DeejbXq/CzQz40ltKMOKR9iN3pCnwNmRnJ/hr9ojcA0NtlkLSKgEx8LO2QCPJUKQBoMwMAQsrydOQbpROUnn47R6M+lcsd9rg5pGAJhcHt3P1ui2e4hhxmOY36+CWOhOfszxYmUH3RaZ8RHSiIcdFCwlklkR3De1A0YzzX0QlrMeRCOBxFl3NvHRab68mawIAcIEqVHNog+1GeG0CWl2Y0TYLFWcj+Q5dhSfsbRpcgU8syZr6AZxn+47DCtt8zsArpeIjez02AAs+KAZimZ34pk46oV spamdiagnosticoutput: 1:22 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c4460eb-f314-4782-34a6-08d58db0ea60 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:48:13.5652 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0936 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: NeilBrown [ Upstream commit dbeccabf5294e80f7cc9ee566746c42211bed736 ] Calling smp_processor_id() without disabling preemption triggers a warning (if CONFIG_DEBUG_PREEMPT). I think the result of cfs_cpt_current() is only used as a hint for load balancing, rather than as a precise and stable indicator of the current CPU. So it doesn't need to be called with preemption disabled. So disable preemption inside cfs_cpt_current() to silence the warning. Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers= /staging/lustre/lnet/libcfs/linux/linux-cpu.c index 51823ce71773..a013f7eb208f 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c @@ -529,19 +529,20 @@ EXPORT_SYMBOL(cfs_cpt_spread_node); int cfs_cpt_current(struct cfs_cpt_table *cptab, int remap) { - int cpu =3D smp_processor_id(); - int cpt =3D cptab->ctb_cpu2cpt[cpu]; + int cpu; + int cpt; =20 - if (cpt < 0) { - if (!remap) - return cpt; + preempt_disable(); + cpu =3D smp_processor_id(); + cpt =3D cptab->ctb_cpu2cpt[cpu]; =20 + if (cpt < 0 && remap) { /* don't return negative value for safety of upper layer, * instead we shadow the unknown cpu to a valid partition ID */ cpt =3D cpu % cptab->ctb_nparts; } - + preempt_enable(); return cpt; } EXPORT_SYMBOL(cfs_cpt_current); --=20 2.14.1