Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4029085yba; Mon, 29 Apr 2019 12:31:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPRxvdEWkadNXd5O58JuMqLKy399zBIT5a44sv94us+OmPQTnLMr9eDVfoaEk6p4Km7g7q X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr10901402plt.157.1556566261830; Mon, 29 Apr 2019 12:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556566261; cv=none; d=google.com; s=arc-20160816; b=wzxnPPD+mQ/TKUroDEbd+UlhIBTYv+ZVBEtmv6HnOjwNDyjpQOUajj9WRJi8T3+Aa8 iyNyMnNRoLL9/kd+sBBz3XmS1ByMdqvImVTX9cWYPsLtrlpY7G4ZMUrfipvBL/W2qheN iVOX7FG9PSW//rCy7nJ5GBcePvZ4GgieKCHtyzGAeGVAXTD3HaGIJpA22AIn/u9rOidt EijoMmpENwMxJhqB1wMejcu+dcDtgxIufI6pZupL/yT0AbYv6SuNRwsqr4fsZgXxEMEO p5ghps2gz9hf58+mlk3Lz89GPmu7njHM6WqyG+A0QxSuOmrokdAxc99DDi2ERwclsS7q nIcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=z0SbUdCmljVej5WrouVvowNPCwLdyoY/7i4BqzA7D8w=; b=kJGum8OahvHiU8T4LLA6kRCSzWnW7v4XMsddJbPCT2Hjgr8mNTwPxJ4me2lyJ0mUhd JMkOnZkbFwP+8Q9kmxu8BCkF7/5kkoE6hcV6I15yP2xWfFcX6iHWPZCku9kxdb1BKGpV VJA2XrFYzHGk3Eq6WkPRHzMjSTJmz1naLmW0F7dFvUL0Wrx1YVJ5PLxJzJZs1vRk+jYo YIbsnSl1A73RG68X75BM9w0t9wJEdfgzxGEGXs1HID1KevIg3422xqtcgPyK3G7P99mP bBSVnbhrJOUkphE20NFps+sEAg09aZNHMIPZw2fVPwmQGu/74XC0QudHtt3rtdERfhjg GM9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=TeDqsy9X; 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 f14si16041058pgg.336.2019.04.29.12.30.46; Mon, 29 Apr 2019 12:31:01 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=TeDqsy9X; 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 S1729315AbfD2T3T (ORCPT + 99 others); Mon, 29 Apr 2019 15:29:19 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:39720 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728928AbfD2T3S (ORCPT ); Mon, 29 Apr 2019 15:29:18 -0400 Received: by mail-pg1-f195.google.com with SMTP id l18so5634426pgj.6 for ; Mon, 29 Apr 2019 12:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=z0SbUdCmljVej5WrouVvowNPCwLdyoY/7i4BqzA7D8w=; b=TeDqsy9XMhyATE2qQx9WlzpgVVq0T7CVOONq967YT3CvH0mEmtolvjGE9kJgU/cgYU 775P7gEHPzjxaK64n/BHIPsCEJ8FXrjBqGL2pORt1p1ksc2ycBk/GwyBhFi2ZYhlpMnh i4ZBzRRY0nCe7ZzT3UUi1Kv9ORMZDABigBBC0H0FscGeqNWREoXs9UC8ZR+bT0gwdOI2 x7STEigDlhJOH9LelrVMkVs3Eg+LPIB+J0vR8Kl2xU7xAwiRDUCiqjk0AIbkJTgdL2DK ykW0Mu9p/0VL9Rjj28erwH0qI2qERVwEtc6GxwlpWeic9CAO/etUy8h532Td7nbDZ5GV FLsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=z0SbUdCmljVej5WrouVvowNPCwLdyoY/7i4BqzA7D8w=; b=H3tPGwLj0tVpmdANAi+xHQu635ApIdyxHsNB7wUhDSXczOvoa5WnL4kx/v/85ZHZfL 2r2eQUz6rX2Kztjvuj1ZBvezQ+PdezhmqZrchw3qAosysxvehpczz5lUeOZm/CukpQXx HxDXMe55cvM7D3G2TlTgl+vPG4p5jH/9VJ7aislsSa0GycGI5msRD/8JmaBcV9jquFit I5+zrJNGPXYimIT0Eg7h6/pk3IOMNe1a5dNBbpc+PcsG6WKi2FoUGxPdkH7Grgd0MPLX G3b+u/IOrZG5wboJmgcRchULEu8nTOaOL8PW3a9Hsi1iB9J5CewkjoKBLBkqaNmBpVsg wlRQ== X-Gm-Message-State: APjAAAXjJ69YA4cq7F6GAR+MhTaJCgHy2X/IYWSfKFoVca+el+U7dV0F E7NcGArDrmoGoOjLJrdoc3SsRQ== X-Received: by 2002:a62:864a:: with SMTP id x71mr3258049pfd.228.1556566158309; Mon, 29 Apr 2019 12:29:18 -0700 (PDT) Received: from cakuba ([2607:fb90:cd6:ddfd:e8f2:447f:e2a6:2cf0]) by smtp.gmail.com with ESMTPSA id 15sm5496317pfy.88.2019.04.29.12.29.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Apr 2019 12:29:17 -0700 (PDT) Date: Mon, 29 Apr 2019 12:29:10 -0700 From: Jakub Kicinski To: Moshe Shemesh Cc: "David S. Miller" , Jiri Pirko , Saeed Mahameed , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] devlink: Change devlink health locking mechanism Message-ID: <20190429122910.668028b1@cakuba> In-Reply-To: <1556530905-9908-1-git-send-email-moshe@mellanox.com> References: <1556530905-9908-1-git-send-email-moshe@mellanox.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 Apr 2019 12:41:45 +0300, Moshe Shemesh wrote: > The devlink health reporters create/destroy and user commands currently > use the devlink->lock as a locking mechanism. Different reporters have > different rules in the driver and are being created/destroyed during > different stages of driver load/unload/running. So during execution of a > reporter recover the flow can go through another reporter's destroy and > create. Such flow leads to deadlock trying to lock a mutex already > held. > > With the new locking mechanism the different reporters share mutex lock > only to protect access to shared reporters list. > Added refcount per reporter, to protect the reporters from destroy while > being used. > > Signed-off-by: Moshe Shemesh Acked-by: Jakub Kicinski Thanks!