Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1228315ybl; Fri, 30 Aug 2019 14:08:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqysawEEA6+fMjJBmui7QpD6leq5o+uwtBp/pT+vv0iYwGnAhpX7fKN9RY0B2Y/glpEBdxZ+ X-Received: by 2002:a17:90a:c08f:: with SMTP id o15mr546968pjs.31.1567199303982; Fri, 30 Aug 2019 14:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567199303; cv=none; d=google.com; s=arc-20160816; b=nkEtjpLNo/1XXeZdcxsTgpt/XktuNSQInx56zswVt0kb1b/pMk3Ku6xPWd+3soLvyC 0OPeOjybMFu6CDLnFH7CLZdhEIAN9G9prtBW8Usvh679bwTUgfr+4KhFkFQs6rEOpJBA gQYhHsOjGUl8kFV80wUiGCThVkQgObsGqKzn0T6x38xgDV2sGkYeiCn7DDokPX0LyqPR 6L40zv0e0xKzOc47JS4S7YkHiHVFdOQB/k9evh3F31NwvgoxD1YRlbIlrJ2v2Eurgc30 1geZntdnOCwfcx6Xceo+T+PMkLJk9CGmChNwNZ+t92Q/1zRRk+1Wys72eL/G4CMvqGaC O3mQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=w4hvEqHJLEa1mvGULDNj9eO45SqJ3qnxmWk/VetQNSk=; b=KhYry7DmOF7eLChSEGUsvmTZsf0Zbo1AYPuUo6GOEnNfvbmn3D/THR50nG6gbe8njl clnV3u7Ke4RH7ZtKE8zjvzYP7im3jL0BmQL7HzlRPyZ0Hiwsq+uh0Zv5o9ncOJH17qWH +mF5RFvS0EhBAyKGxJNy30VH4qd6DsmZnKHKpq3x4wvXvsf/r/XsnK98mru+Of/tEulW zKiOk/2wur4nxmZSNm0lmZBnnPd+G986ltXPyuTkhs0FPODnT3nSfuDrEsqt3CV/lk8o rsIe3+F0pGOK8JDEebrrDu/iQdiPm+HeUUcL1zX9yHMiOK83/H8+M4AZAIyf4f3w3Wrd mJIg== 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 f9si5161419pgm.59.2019.08.30.14.08.08; Fri, 30 Aug 2019 14:08:23 -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 S1728148AbfH3VHM (ORCPT + 99 others); Fri, 30 Aug 2019 17:07:12 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46518 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbfH3VHL (ORCPT ); Fri, 30 Aug 2019 17:07:11 -0400 Received: by mail-wr1-f67.google.com with SMTP id h7so6911467wrt.13 for ; Fri, 30 Aug 2019 14:07:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=w4hvEqHJLEa1mvGULDNj9eO45SqJ3qnxmWk/VetQNSk=; b=nJ3dUc18kw/5S+lDtVVnK10jMBCLxIzgSJubSsEGYDz4aqBTqtiMdEIrPs2q5Rio4r HnQltW+apF8oNAqQeYHSdS/0Qs9HztFn488Bhp3smaqbpJBNTAA24jsDf/LsYh5OQVtr YtMkecba+aK1I2S2jyslg+nqIuSS0z4P2FIH0aw363tu1F9eqA6iKqVm2hdgki0Rd02i BFD/ZjieKyraTZwpsgZ/mlWQb/KFymwr7UDo3sAW8lMjRRNpLI7FDhfldSIlX1uTidLk lqtu7ko3+M9IzPPuywI3sY9uhYgPrgBn6t+1IXMUF4TcXnR4i9Mw8ZfrTsZIQcRRVa7e Eepw== X-Gm-Message-State: APjAAAVLEOW0XC/MhoiK+zvzwZhGsr9GxY4jT/eyC9oE0X3OvFzaVDms YceQOapwtFnfZx9ICGXADDk= X-Received: by 2002:adf:dc43:: with SMTP id m3mr5271653wrj.118.1567199229860; Fri, 30 Aug 2019 14:07:09 -0700 (PDT) Received: from ?IPv6:2600:1700:65a0:78e0:514:7862:1503:8e4d? ([2600:1700:65a0:78e0:514:7862:1503:8e4d]) by smtp.gmail.com with ESMTPSA id w13sm16030538wre.44.2019.08.30.14.07.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Aug 2019 14:07:09 -0700 (PDT) Subject: Re: [PATCH v2 3/3] nvme: fire discovery log page change events to userspace To: James Smart , Christoph Hellwig Cc: Greg Kroah-Hartman , linux-nvme@lists.infradead.org, Keith Busch , linux-kernel@vger.kernel.org, Hannes Reinecke References: <20190712180211.26333-1-sagi@grimberg.me> <20190712180211.26333-4-sagi@grimberg.me> <20190822002328.GP9511@lst.de> <205d06ab-fedc-739d-323f-b358aff2cbfe@grimberg.me> <20190826065639.GA11036@lst.de> <20190826075916.GA30396@kroah.com> <20190830055514.GC8492@lst.de> <4555a281-3cbc-0890-ce85-385c06ca912b@grimberg.me> <3c58613f-9380-6887-434a-0db31136e7aa@broadcom.com> From: Sagi Grimberg Message-ID: Date: Fri, 30 Aug 2019 14:07:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <3c58613f-9380-6887-434a-0db31136e7aa@broadcom.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> Yes we do, userspace should use it to order events.  Does udev not >>>>> handle that properly today? >>>> >>>> The problem is not ordering of events, its really about the fact that >>>> the chardev can be removed and reallocated for a different controller >>>> (could be a completely different discovery controller) by the time >>>> that userspace handles the event. >>> >>> The same is generally true for lot of kernel devices.  We could reduce >>> the chance by using the idr cyclic allocator. >> >> Well, it was raised by Hannes and James, so I'll ask them respond here >> because I don't mind having it this way. I personally think that this >> is a better approach than having a cyclic idr allocator. In general, I >> don't necessarily think that this is a good idea to have cyclic >> controller enumerations if we don't absolutely have to... > > We hit it right and left without the cyclic allocator, but that won't > necessarily remove it. > > Perhaps we should have had a unique token assigned to the controller, > and have the event pass the name and the token.  The cli would then, if > the token is present, validate it via an ioctl before proceeding with > other ioctls. > > Where all the connection arguments were added we due to the reuse issue > and then solving the question of how to verify and/or lookup the desired > controller, by using the shotgun approach rather than being very > pointed, which is what the name/token would do. This unique token is: trtype:traddr:trsvcid:host-traddr ...