Received: by 10.213.65.68 with SMTP id h4csp2137309imn; Sun, 8 Apr 2018 20:39:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/XEQ84zM+2r25ciGkrPTlJ9yIxTFHl21BTpdEZNtgdTJkOQXwHkMCUjz3u42kSi5GONyED X-Received: by 2002:a17:902:8685:: with SMTP id g5-v6mr1616824plo.46.1523245150759; Sun, 08 Apr 2018 20:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523245150; cv=none; d=google.com; s=arc-20160816; b=mAyqrNQFgvMJSahEET5xGhIT9EynEwv6tLAntVl3GpmxPfBmd0sE4c04LPewatrJeB b1oe+48IStIbbaUL1/Bc+hukwWOSvLCUOntMbFCrcNeiUvvD7avXBCxQkcSqewfO3ehA 04IkILVDj+k4TmCXYDsZ6YTJuPTlSIkOtWBuPNq3gnrQEFdIc34DnPfce1ZL/Rtblp8o ysMTkqyIcquzJX3lLqUr8YtGb/Azb2G/D2PXlxKAj49NTF+pqYYkzm7kQ4r4HdnpIiC0 sbhcTBUgIklzR+eNyg0pwNaYglfWsuF3hHiKYgLu0HB3yMjEByZCtQ39HU4eOOeWbwIi +HmQ== 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 :spamdiagnosticmetadata: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=rW/beMzn6Lhgz4SArzGgzjjRsdCfyC4ZkrAc2Etp224=; b=qzwNpzyYDo3pej9Ynpo8yrkJhUyUTTyYxX8HE/XZWthHMmQzuTmbN1gmU41cScjnYS BWDEC8A/J0NKnuMyCfZJaW2mjIr0TBbyidWhxOMO7rgOypT0uKVG8u0mEBq7TiNX8W0h oEEuHmfwMyTgIxelop1Xo2eSToRY72Eu6+jhCcSI5tjLcaTINCEj/XNtElm2U7tK2Y2G 3xaYkM8EIW5WEqd9O9L3P4+z+WQcic1YWVUmbszhlTz6ISaJTrdDaGamnMHiu3m5TPiq +dBpLo0g3GzOA7Xm5irbab1IvIg584H2aHZibJYhobmuexVwiUPos//N1g0kWgyEO3/f wGdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=BP1w7e6Q; 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 e98-v6si7630122plb.273.2018.04.08.20.38.33; Sun, 08 Apr 2018 20:39:10 -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=BP1w7e6Q; 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 S1754610AbeDIDdL (ORCPT + 99 others); Sun, 8 Apr 2018 23:33:11 -0400 Received: from mail-bn3nam01on0108.outbound.protection.outlook.com ([104.47.33.108]:54803 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754449AbeDIAVU (ORCPT ); Sun, 8 Apr 2018 20:21:20 -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=rW/beMzn6Lhgz4SArzGgzjjRsdCfyC4ZkrAc2Etp224=; b=BP1w7e6Qu9I7Gapj2tR/z3RR72ZVu9wXHI+dzSPlok0X41v02jdnllklZqc3Gz2fiT9e/K+8ggXx4+Ux179I8BMjjHihU1YtM10dAIAmLUGg6Bh8A7NQdm9nBQFMBXkI0+rsruBY+nCfs+3QPf81WuRylzENzl2WzkDi0apq/zc= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1125.namprd21.prod.outlook.com (52.132.130.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:21:14 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:21:14 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Trond Myklebust , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 176/189] SUNRPC: Don't call __UDPX_INC_STATS() from a preemptible context Thread-Topic: [PATCH AUTOSEL for 4.15 176/189] SUNRPC: Don't call __UDPX_INC_STATS() from a preemptible context Thread-Index: AQHTz5hgNkKA6xQ9ekKk8G6oLPoI6g== Date: Mon, 9 Apr 2018 00:19:08 +0000 Message-ID: <20180409001637.162453-176-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB1125;7:gXeDg2QkvXORTUKW5CzBbzo2vcu2aZEwpUhl4VRmzshha9mXu31PQRXdvSN8ZKIinr6bHKXMcZkCjqq/ubPLEroYy4PsIjQzHhz2t+Fx0sCKCjSzcgA0Ixc1yH0ELrEx8fBrBt1CJBrtlOFZKlGOKIJjElW5fVojNVqf95F/o6LN9ZifZky21GvjgjMNE4H3oHDZuM/yBgJdT553qGYzlscf/xvdqCcZXXvWHY+qX6zqAAoICfpxQj57mlWDNDMD;20:7II3UvLDwYsPomFpiNyNhVGu4pCLKBRl9ZyjkLIeGEoMFh/zpiszEcSvy5yuPdpLq89+lGnIn6eeYedYXT8WovQ6Zq+OGo4ftwZv6TM8ucLKAY8iT+VwqSzEv0hqs3LAVEXj4BzGwHs29ibAhmni5HbxzLnUQPAPdowINGMnXus= X-MS-Office365-Filtering-Correlation-Id: b9968f6d-4ca2-4255-d84b-08d59dafcdc9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB1125; x-ms-traffictypediagnostic: DM5PR2101MB1125: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1125;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1125; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(396003)(39380400002)(39860400002)(346002)(52314003)(199004)(189003)(51234002)(105586002)(7736002)(8676002)(97736004)(81166006)(59450400001)(106356001)(81156014)(305945005)(14454004)(66066001)(1076002)(102836004)(5250100002)(478600001)(2501003)(2900100001)(22452003)(72206003)(68736007)(26005)(86362001)(575784001)(8936002)(76176011)(6506007)(6116002)(6486002)(186003)(5660300001)(3660700001)(316002)(54906003)(110136005)(25786009)(2906002)(10090500001)(6512007)(3280700002)(6666003)(10290500003)(53936002)(99286004)(86612001)(3846002)(6436002)(486006)(4326008)(2616005)(11346002)(107886003)(36756003)(476003)(446003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1125;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: WzgN0IPKhnr2dm1eYTrNnczRsZfcQ6N3QQswEKUi1QWf3cqvDGbsB1kGV32Bvw6aO5fyeqR7427/9uN97QGq0jZz+POzVWMqXVz2narsgzm768tjpFxipp19VrtjrZsdtcCCC+3D2rZrCBSgG6jV/56GV89pLYyq6YvQ11jPKQDILkan6VufH1NQqJl5Y77TYuPDcDkxhEkcnA94XCT2thbRh7xIhh+bcYOqB5Uk7G56oLDj5urPgiFSRUZptDUHSv+UHs/qGpzOgILutG++ZtnbqpspQCi3w7JdUnAcrXst2g/x5VYk7p+MlsLpITIn4R0mTE5Fz5sxl5g/5Uim1V+UBXorGHSlotfozDP77Dxu4fFdo639AkELFjKGnSoDVRH1qcxML9Glj4EmTbFKmzH7LWcJ0mLB8yWCH2ZUFsY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: b9968f6d-4ca2-4255-d84b-08d59dafcdc9 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:19:08.1427 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1125 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust [ Upstream commit 0afa6b4412988019db14c6bfb8c6cbdf120ca9ad ] Calling __UDPX_INC_STATS() from a preemptible context leads to a warning of the form: BUG: using __this_cpu_add() in preemptible [00000000] code: kworker/u5:0/3= 1 caller is xs_udp_data_receive_workfn+0x194/0x270 CPU: 1 PID: 31 Comm: kworker/u5:0 Not tainted 4.15.0-rc8-00076-g90ea9f1 #2 Workqueue: xprtiod xs_udp_data_receive_workfn Call Trace: dump_stack+0x85/0xc1 check_preemption_disabled+0xce/0xe0 xs_udp_data_receive_workfn+0x194/0x270 process_one_work+0x318/0x620 worker_thread+0x20a/0x390 ? process_one_work+0x620/0x620 kthread+0x120/0x130 ? __kthread_bind_mask+0x60/0x60 ret_from_fork+0x24/0x30 Since we're taking a spinlock in those functions anyway, let's fix the issue by moving the call so that it occurs under the spinlock. Reported-by: kernel test robot Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- net/sunrpc/xprtsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 6d0cc3b8f932..33e2baebdca7 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1070,18 +1070,18 @@ static void xs_udp_data_read_skb(struct rpc_xprt *x= prt, =20 /* Suck it into the iovec, verify checksum if not done by hw. */ if (csum_partial_copy_to_xdr(&rovr->rq_private_buf, skb)) { - __UDPX_INC_STATS(sk, UDP_MIB_INERRORS); spin_lock(&xprt->recv_lock); + __UDPX_INC_STATS(sk, UDP_MIB_INERRORS); goto out_unpin; } =20 - __UDPX_INC_STATS(sk, UDP_MIB_INDATAGRAMS); =20 spin_lock_bh(&xprt->transport_lock); xprt_adjust_cwnd(xprt, task, copied); spin_unlock_bh(&xprt->transport_lock); spin_lock(&xprt->recv_lock); xprt_complete_rqst(task, copied); + __UDPX_INC_STATS(sk, UDP_MIB_INDATAGRAMS); out_unpin: xprt_unpin_rqst(rovr); out_unlock: --=20 2.15.1