Received: by 10.192.165.156 with SMTP id m28csp1321071imm; Fri, 13 Apr 2018 18:16:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/VW6mysscp/dDhgPbo0t9ATYQ/wLO1ZomF9+R/+T7aKuqh3JWqwsvHBDCbpVgmIg6+2rOF X-Received: by 10.98.74.17 with SMTP id x17mr13420332pfa.91.1523668606229; Fri, 13 Apr 2018 18:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523668606; cv=none; d=google.com; s=arc-20160816; b=zo+/xGq18wb29jxyndHAEYT98PmL59aCiTlzjxEgUJvbSzXt2Oda5o/83YpJTAHbWj Olm2cTEiPNjXP7DOE3PpEyig76WgWYYmxMGOlWGBIsEzy1Lt1rT/p48ah3rrItJfXmC/ qV6AjhdV/5unJpQcjDltdXoBQW6lkdt2k8APJcLZIO2TeRVoczx1YU0Dd+Sm5o9RW/RK /oYKQnaJuJ2dH20U+RwlQGJgluyvei4jgtj2oOcc9OhN78BeVl+TgbxbweBn49RzMObs 8R2T1UWMQ7U69PEysBMt81XnjNlB2QJIOnSaqoukZHZQLh5rL7uv3Rk8hBMWY84vl0SW mxWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=JAqUqHZ9rXRrEkgj1Xh3Yh/Y9a7FwrcolL4WtaoW2A8=; b=kxedqZQQgi+dVpNRNFBor1fttGLgi1I4ifhIJQWvMTx0otb5j9FvsMTdZBI8ubkqDs LQ+kE6isR7f5Dwh0RraGloyGBkk9GNQM6X3qT1rEDBjXE/VLrW11xX09u4NBNVoYteGN 48EUA+liTw3Xpkg4LrBtWr4QB/GcuRcy4s4esv+k6eaLSA91dSEWPG8pWfT5KwTZDreD 3xiWqoqKgQS+p4YYT3raGtE2PXpWgYhRO0i0B8KGF36g1bziQTbVsYfhrZka01+nK1w6 UBLEt0oj35Bwh0G1G1q8Ees1PNexbHWKMVzwzJ0NMIEUhPuoGtnKC4iqcXLc/tsJgCJ5 VLYA== 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 f22si5648386pfd.123.2018.04.13.18.16.31; Fri, 13 Apr 2018 18:16:46 -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 S1751600AbeDNBPX (ORCPT + 99 others); Fri, 13 Apr 2018 21:15:23 -0400 Received: from mga04.intel.com ([192.55.52.120]:57230 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867AbeDNBPV (ORCPT ); Fri, 13 Apr 2018 21:15:21 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 18:15:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,446,1517904000"; d="scan'208";a="216496904" Received: from ssaleem-mobl4.amr.corp.intel.com (HELO ssaleem-mobl1) ([10.255.35.38]) by orsmga005.jf.intel.com with SMTP; 13 Apr 2018 18:15:18 -0700 Received: by ssaleem-mobl1 (sSMTP sendmail emulation); Fri, 13 Apr 2018 20:15:17 -0500 Date: Fri, 13 Apr 2018 20:15:17 -0500 From: Shiraz Saleem To: Dennis Dalessandro Cc: Jia-Ju Bai , faisal.latif@intel.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] infiniband: i40iw: Replace GFP_ATOMIC with GFP_KERNEL in i40iw_add_mqh_4 Message-ID: <20180414011517.GD18392@ssaleem-MOBL4.amr.corp.intel.com> References: <1523431945-3508-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 11, 2018 at 10:53:13AM -0400, Dennis Dalessandro wrote: > On 4/11/2018 3:32 AM, Jia-Ju Bai wrote: > > i40iw_add_mqh_4() is never called in atomic context, because it > > calls rtnl_lock() that can sleep. > > > > Despite never getting called from atomic context, > > i40iw_add_mqh_4() calls kzalloc() with GFP_ATOMIC, > > which does not sleep for allocation. > > GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, > > which can sleep and improve the possibility of sucessful allocation. > > Just a general comment. I don't know that this is the greatest idea. I can > imagine instances where sleeping is OK as far as how the code is written, > but for performance reasons you would rather fail than sleep. > > As to whether that is the case here I'll let the i40iw folks comment. > In this case, the changes Jia made look safe and not in the perf. path. Thanks! > > This is found by a static analysis tool named DCNS written by myself. > > And I also manually check it. > You should probably post a pointer to your tool. > > -Denny