Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp138355rdh; Tue, 13 Feb 2024 11:46:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWHx3YmIjVDQzoCucCCB1BUTqwdO/6qh40ikarIB1lV8P0jpFE80CIFXmBiRH/iJ/JBy34xDcZHOtsGb8gBh9GLfOj2fRKCf71H6auZ7w== X-Google-Smtp-Source: AGHT+IFSp0NbRDOnMgOQUJYBKUZrLWuz4HjTeiC6nFsdd45hXtITxZRegwrWBJHuJWcK+kBq00A2 X-Received: by 2002:a17:903:11c6:b0:1d8:ffe8:125c with SMTP id q6-20020a17090311c600b001d8ffe8125cmr632163plh.24.1707853609802; Tue, 13 Feb 2024 11:46:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707853609; cv=pass; d=google.com; s=arc-20160816; b=MXk6Q8IUD4iAlnSTQGka6GAeGC5cR7/KpdUTymJ3lmLaxUFoNp8xFHhyChP1vEO/iG n4AlO+uVhYSUb97gwhtHiWkjgX7PPXX5SN7yYHfuRn21RoAuTRLxDZjhzXms+uAlEi6E FI07mlw1vY7eN2euH3YfsI9mDHp6Acv6Pz48pjeqSz1SZZyQSbKs26MJFVdJIjFoanJJ B3Zq+qypfwoG74L2sB2y4g8BbaQAVsJ3NzpNVe5od53RtLzaXVjDdF/6YWQVhV5krDPO kg49i/B5OFQtu3KZ6giQEIh8n8NJVJ5VHtgoGyW9tj9x7rZxUV+3vOenvkQefcyepqq6 alAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=BEsKIEOxAUpODhAeNBNqEi1gm8n9sY2nnlfeW1I8un0=; fh=ugK1Dpgb4bkZyWKbZRvrJtvV0Z416c72SWJyeuE9o3Y=; b=QYnRNLsrPxcLvUn3o/hzjNQVIby3OJrbzGaPP34O8XWhQSEgoSu+AL5nwUtlso+5+u F9DZaB0hhxxs+4Uc8CZtJ8B/MP+YlLC3Cb4NBqm/wsRZOJnrtwf1cnknChZtA76YV5D/ ZOZG0ZgJaU26Y3TRRCM3V2BHLrZa9gqnU38HpHn+xYY9ec87MepxWUCUXEvRtYF4X8H0 dey1zYfrkcKImdIVhCCMIo0vZgVZX4Lzunm9PWJAvsQ+KDCqmW/kxv/Gu5+YKFiiegwr k0mUtfFi0mmu8dyvEGJFfhReFap4xFANqp1yvNYoFQdatCVm2SBLOlD/Xw5TkviQtKPY ZROw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Joyk1+7c; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64189-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWZHHzx3TzdcNKnS8p+ejkiqMT7GJyxtX8Czy/+EhJlkTo3TVfk6l18V0wNNF+1PC0AbTEZdNoyDk8qf/o6twyidkieyKETrhyUKcRk0w== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e12-20020a170903240c00b001db4cc8eec5si530564plo.83.2024.02.13.11.46.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 11:46:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64189-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Joyk1+7c; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64189-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1C6BA28AA4A for ; Tue, 13 Feb 2024 19:46:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19A7060B90; Tue, 13 Feb 2024 19:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Joyk1+7c" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F2686089E; Tue, 13 Feb 2024 19:45:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707853558; cv=none; b=qhvPKtrjyDu5ksMUqs9BXZFBM5JD2HaHcX6UqXFQ5csBMb7JEz8Zkoj0lGPvuIzlY2IicGEeEWGzkdxRNnU1ktVhhDnYMsqVs9OjcNL8JgW/OZSNcy7eZ3AbjtRL1WptXdpobGxUfH7V2WzXNXCmbBlz/X8Vfd4ry20Os5ZjW1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707853558; c=relaxed/simple; bh=WqPW2wosKK+QvQBbaPKSnDNPFyjxQDlHQS+8p1UqimA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=ZTP6Ff1RFzpPZKFmgslmRzQDAm8SiyyXUVcoftI3X86vV/8hHc3um1j8wdlOBiu/0OMreR2dg55HL60iSJOAL/XChbAjKgQTHxmKGMzZI2NY1KIS54ldP8r0zxienwhr7i+OilVP9ZJ5GUEZjXgqbS+QwBIRnCD+d6ILqlSV9e8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Joyk1+7c; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D1C6C43394; Tue, 13 Feb 2024 19:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707853557; bh=WqPW2wosKK+QvQBbaPKSnDNPFyjxQDlHQS+8p1UqimA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Joyk1+7cLubMET3MgM9ZGOQIKH4vVDJAn/+pfdOm8wTA26Xx1skYGHM7tYt+UVKxk OG4RzVv9+xZgqq0rhwrffVr3GJvoDE8JSyV24DcoCDWjJ3m9o8wocdd0yq0Kw477MU naAXhqU5rrlrjSNWa67lCiGrinFrkakctSZfZEEVAGSHRTEeMTKbgiqOD9Np3wEwqE Q+DXyEq8kIcqYzZd4LcLXLtkFeFbFAjpwFqNuBpI14GwEtaBqiv9RNoZtydcLlGSmh ISY5LXqnwcZ15oJgF1IBh2S8uAyoBXFkkFes6QgNoqb5U9AsheurPGa0Ok2Ai1PHJs xi4gdZBIPdLig== Date: Tue, 13 Feb 2024 13:45:56 -0600 From: Bjorn Helgaas To: Leon Romanovsky Cc: Kuppuswamy Sathyanarayanan , Jim Harris , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Gunthorpe , Alex Williamson , Pierre =?utf-8?Q?Cr=C3=A9gut?= Subject: Re: [PATCH v2 1/2] PCI/IOV: Revert "PCI/IOV: Serialize sysfs sriov_numvfs reads vs writes" Message-ID: <20240213194556.GA1219770@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240213174602.GD52640@unreal> On Tue, Feb 13, 2024 at 07:46:02PM +0200, Leon Romanovsky wrote: > On Tue, Feb 13, 2024 at 09:59:54AM -0600, Bjorn Helgaas wrote: > ... > > I guess that means that if we apply this revert, the problem Pierre > > reported will return. Obviously the deadlock is more important than > > the inconsistency Pierre observed, but from the user's point of view > > this will look like a regression. > > > > Maybe listening to netlink and then looking at sysfs isn't the > > "correct" way to do this, but I don't want to just casually break > > existing user code. If we do contemplate doing the revert, at the > > very least we should include specific details about what the user code > > *should* do instead, at the level of the actual commands to use > > instead of "ip monitor dev; cat ${path}/device/sriov_numvfs". > > udevadm monitor will do the trick. > > Another possible solution is to refactor the code to make sure that > .probe on VFs happens only after sriov_numvfs is updated. I like the idea of refactoring it so as to preserve the existing ordering while also fixing the deadlock. If, in addition, we want to update the sriov_numvfs documentation to recommend "udevadm monitor" + /sys/.../sriov_numvfs, that's fine, too, but I don't really like the idea of merging a patch and forcing users to update their code. So I'll table the v2 series for now and watch for a v3 with the refactoring. Bjorn