Received: by 10.213.65.68 with SMTP id h4csp2109805imn; Sun, 8 Apr 2018 19:58:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx49XAYzudJPBgSU6eHN1rD6rdMtrWWRgV3Ss/pERgUBk2lx/XbfIIirjNfrg/ngeN2pxB8US X-Received: by 10.99.108.4 with SMTP id h4mr4842555pgc.368.1523242714581; Sun, 08 Apr 2018 19:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523242714; cv=none; d=google.com; s=arc-20160816; b=Bhm48FIwHQ7KjhJ1YgO2dhQ0q3Fcwc0YMoT1Zg4qVkNCYsPrF+m+zjs6T8IYGgheu3 pFN1GEua9K/MPpssXHDKVU/0ZurpPiVQItHDdZ6xqk9EnuH6jP0bT6M1dtTv9Hw1VtIU Vk7BbHf+gIzmraXupDhMsS+0nwqznjqe3UvD+WIq4CpDTrhCAMIVjdGzxJv8WdlUKE3S 5sJi6l3GD9sBRGsc63eH5dm04O8EKHgX+y3tpfwpY/QEGD8b+Q/mvO2LZPsF24J6154F D5PsVpcltQ0yTcwsswpJSdKyk/ywFh6H9KwN1MU5YgFnJUFugPXmQADj8lyzQPalajxs nkPQ== 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=Dmyd8pIkqslu39cEEG+KevbgCCTGAkcXYOFlkEdapf0=; b=1BKSsisa8PBSNvlGfABhKCs0JLVc1VyiedXOk7LTM7NnmvpEyQuvd6HOra2uCjpi5l kGiKAgfDxS8arUfYG6zXY5kLd2sbVTn4rVa+tQ5Tx3nbdLCo9BtFFlywR7ZKihMQjRhc 3xOxJf2YuCtMdbsmS62aj3FZq0WjpNK38LBihSRJuYjwogry5naRLb5X7CwnwQSQAQzz pJnWA506phdCA3F6ZjRKb4dEDcvSrBbt8CemWKOBYWKyfg+/ZnXsYyayt99Z5GcTxNmJ NtKwXyjZOgxY5uhbaEPI0ZDnXLJlbFhhqxyYzLnQ5tWGC5g6JAZC5ZwOcqr/sO35E0dA pRQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=bRHxnVkw; 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 m23si10466595pgn.239.2018.04.08.19.57.45; Sun, 08 Apr 2018 19:58:34 -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=bRHxnVkw; 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 S1755326AbeDIA00 (ORCPT + 98 others); Sun, 8 Apr 2018 20:26:26 -0400 Received: from mail-by2nam03on0131.outbound.protection.outlook.com ([104.47.42.131]:4960 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755311AbeDIA0U (ORCPT ); Sun, 8 Apr 2018 20:26: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=Dmyd8pIkqslu39cEEG+KevbgCCTGAkcXYOFlkEdapf0=; b=bRHxnVkwZyJfW5Cm58csI9C3XW2tIlgiV79ktl+2Ay5NjfoUosLPxpdmKBb0zZJdVDEkirNaFuk6K2ltYfnx5eNVzFShpaB769AafikWbhxdlS+2Z+gq/mh6eHgrW8ysP9Qh95w8cxh6XfzDHGLAgeT/yT435zBszcgU/E4TchY= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0725.namprd21.prod.outlook.com (10.167.107.167) 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:26:18 +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:26:18 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Trond Myklebust , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 148/161] SUNRPC: Don't call __UDPX_INC_STATS() from a preemptible context Thread-Topic: [PATCH AUTOSEL for 4.14 148/161] SUNRPC: Don't call __UDPX_INC_STATS() from a preemptible context Thread-Index: AQHTz5jDLWCZKInW00ScQYyJj6N5hQ== Date: Mon, 9 Apr 2018 00:21:54 +0000 Message-ID: <20180409001936.162706-148-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB0725;7:R0qNhvMYswxxzD+l9rNICfqEu9hEiYvjEsERr3SbdgnP/2Noqds6KLYvJ7kDyH4jVnRaial2B5H/kIOvcJwIGpSEprCOy2kyl9xtCfSG4hjon6bMZwbm7lTrVrEjSne0OMdG9seywBcCUnrPTdyimOPmAlEKKgUSIy4byWuiEjmYHoHAGotcHBvmarHLYXZ8/kYBMvxCd2Q4C/iSm5KXF+P2cB8uNw8FuMLKtAvMjqFrICZ2tlwz/u8aEV83xlrA;20:QleprY4A0oy73VYgePBKENag1Q9olTtZm6Nk0gio/DJzPtbHv9jzZwQ3xifxPwVvuMF7ug8vwnkZLO6Blv8XSPLONUB8swXSjB2DWvDYYRuC1dBjjz90sK7KqIlafOKW/k0g460GOjLLRM7ZhelfLEo9CgfURJq8OjCLlm7BOhA= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 3e12ba72-c572-4991-9058-08d59db08384 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0725; x-ms-traffictypediagnostic: DM5PR2101MB0725: 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)(5005006)(8121501046)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0725;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0725; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(346002)(366004)(376002)(396003)(39860400002)(199004)(189003)(51234002)(52314003)(6486002)(81166006)(26005)(6512007)(4326008)(6666003)(6436002)(81156014)(8676002)(97736004)(186003)(36756003)(72206003)(53936002)(107886003)(2906002)(86362001)(76176011)(110136005)(305945005)(10090500001)(486006)(3660700001)(102836004)(5660300001)(14454004)(476003)(86612001)(446003)(99286004)(68736007)(66066001)(11346002)(54906003)(2616005)(1076002)(7736002)(5250100002)(25786009)(8936002)(478600001)(2900100001)(2501003)(3280700002)(105586002)(59450400001)(316002)(106356001)(22452003)(6506007)(3846002)(10290500003)(6116002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0725;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: fnGJnutk61vAfQ7GLJPyGxv81m4iuB7eijqoqoOrKpy0871Wlgg3HQV5WqC7xhsYwhLqW7FXyie/flBN5E46yctLT0QlmIG4HOadHHpQGgF73TiF+dcsh3K2hYywJtryMsQ5xqrsJ9JZtDNtytkb5/cAGd4lQNzRvYXMEPVnY8E1boFGx36y87jQHAoGnSirb1pIdytZAEKbmcBuqz06otBWtsZ476wvSTUGfb9p0upt6XED1RGUzTQW4CY76pwIE6w3mzmMS/o4pOtTk1RDL2p4cwtCCRxk3QVK/0Jrxe9O9Dg8+0BYGM+VZwXLJSlCNKjTGYShHcqYH3vG/GwvFbMy+Q66jak5fxcGae8bgVtwSb1e+a42w4/XrAFAeH0sy/QHK/SjyInVbPLAmtQG6rCHoT00ZEv3Mcj3hTDd5Ok= 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: 3e12ba72-c572-4991-9058-08d59db08384 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:21:54.2686 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0725 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 8cb40f8ffa5b..30192abfdc3b 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1069,18 +1069,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