From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09158C433F5 for ; Mon, 13 Sep 2021 08:27:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0CE460FBF for ; Mon, 13 Sep 2021 08:27:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235987AbhIMI2d (ORCPT ); Mon, 13 Sep 2021 04:28:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234575AbhIMI2c (ORCPT ); Mon, 13 Sep 2021 04:28:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9BF506101C; Mon, 13 Sep 2021 08:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631521637; bh=eqrWVyssyPaYL1h0uEUiq3mr0e0gcIZLR2J4CDmYd5k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O2M5C8ancPZ3RkWUyhHTdq4b7hpjErQQhJUiplZtShVpMejS+kl4q9lKyvFVwYFEs b/y229gWQ6+AtQ2COXgfFepSZ+q2UefURrbEmm6ht0q6hvARxcWej8fUDAre/rSNnu 5wqgsXXGnv6oIncDC3aFvbm30bc8x1HXEEtrT0zJblzWjM973UNdFvBkjxFLx8lBx7 IAC51wKizMg2pdXiNbqDM515BOxU/V3fmt/4DDCC6JWmPnlWztCBuCQITBEHmoOO4z cx6zY/ynh3IRFrboezV1PiMO3SqPZLlag2AbEILF/wtDjpxx+t1swoF2wlPnOuKgO/ wMpb5L9OQBShA== Date: Mon, 13 Sep 2021 11:27:13 +0300 From: Leon Romanovsky To: Haakon Bugge Cc: Doug Ledford , Jason Gunthorpe , Christian Benvenuti , Dan Carpenter , OFED mailing list , Nelson Escobar Subject: Re: [PATCH rdma-rc] RDMA/usnic: Lock VF with mutex instead of spinlock Message-ID: References: <2a0e295786c127e518ebee8bb7cafcb819a625f6.1631520231.git.leonro@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Mon, Sep 13, 2021 at 08:17:00AM +0000, Haakon Bugge wrote: > > > > On 13 Sep 2021, at 10:04, Leon Romanovsky wrote: > > > > From: Leon Romanovsky > > > > Usnic VF doesn't need lock in atomic context to create QPs, so it is safe > > to use mutex instead of spinlock. Such change fixes the following smatch > > error. > > s/GFP_ATOMIC/GFP_KERNEL/ in find_free_vf_and_create_qp_grp() as well? Do you mean in usnic_uiom_get_dev_list()? That GFP_ATOMIC existed before my patch while we are holding usdev_lock mutex. Anyway, I prefer to touch that driver as less as possible. The allocations can continue to be with GFP_ATOMIC while we use mutex. It is bad thing, but not a necessary to fix bug. We just wasting atomic memory and instruct kernel do not sleep while doing allocations. Thanks