Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1087762ybl; Fri, 30 Aug 2019 11:38:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqye3FMdSKgc1p7w0ze/qozT7+n62Y7vfIxaVuNf4HU1c0jtktSa3x+qpa57T7zD6jDOyve9 X-Received: by 2002:a17:902:a2:: with SMTP id a31mr5894730pla.339.1567190337535; Fri, 30 Aug 2019 11:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567190337; cv=none; d=google.com; s=arc-20160816; b=Osip0BGdsAoDbF/lWviP3t/xxdC4sadIZZ6jvTVngwQwiO3HddL7SjbdSzRQ0bnEmf 5MykJ9kTU3pY27Ed8xRu4s/MyXMHHPFUf1GcFa1o+w4jP5q//E+guGzB8lTVNXteSugS RfPveelnFIWDCVG7RZFKXc5q0lyUFMGjtODi1yUnJ0cQvnprQIHNk0AOI4uff9RE35T0 T62dpUJCG2rBPkGP9IrDEEfEqK53U5PAdA+uAKTsxMpYnM/uIwjtTtTH0TJFiYUv+2L4 LEoO5e8qEM5oNdz6pg4PqbaCT8u4RXEz1BW/VE4ZzPjqsYqY7fmf34LBHOetvJ+y0pjl xiiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=zFvchfg+nfsCoDewMw9H5TfKo6aLBXeRTQaXaNc+Pts=; b=rzogionZEhcc1IyMIRFHrUY3YUV/ssmeQFo6S4KemjX/bP7YKBw8dwwX6B5BUD7Rva dtxaYBuKyMgC+TTsGuRbM5UzI/CDLqjjSarchZ50QsIW2eUhnf1ToUOpUzpQobbWokRB 8u8cs9hpyCt/oSQIR8HJlrX0AtA4Jvmk2uz9X6XoYzwuKaT5j+q/SA+0ws1LMMaH4oW7 rJI2potucVlhdohIoS7Ff4q5R3pFP9vD2CLatIAESRysBkmyCcs6xvVCbFKTw+fymuFi M3Q/zlm4K7xxOSW+Wvs++YWY8boVDSr5t6umJggRyhPGHDFWS3dMY1rf7d2OSlEbL43Z S74g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Ikb0+wyU; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si1727148pfo.167.2019.08.30.11.38.40; Fri, 30 Aug 2019 11:38:57 -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=@broadcom.com header.s=google header.b=Ikb0+wyU; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728031AbfH3Sg2 (ORCPT + 99 others); Fri, 30 Aug 2019 14:36:28 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:39981 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727930AbfH3Sg1 (ORCPT ); Fri, 30 Aug 2019 14:36:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id w10so3946987pgj.7 for ; Fri, 30 Aug 2019 11:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=zFvchfg+nfsCoDewMw9H5TfKo6aLBXeRTQaXaNc+Pts=; b=Ikb0+wyUjuqA7LjN6wXC6fetcE3CYhjhVggxBoUqWIpS3f08zNmc+cwRrqE75xzKUg So2TGRiXjGmmNCCWM5iJKYZx51m0qm8+s6IUPUnrY8F33/4rjK144u8SHUjzsgDkiNBI D7CNJAba/FabcETkoXXQZ6Tum/wUwrvC8CWe8= 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-transfer-encoding :content-language; bh=zFvchfg+nfsCoDewMw9H5TfKo6aLBXeRTQaXaNc+Pts=; b=VuvcDqDZIMD1PbXqZWUB81XR1v+oqHFYIquVBzMmkS1P2nHLREUyIekFcPBc5AM8ej 19B942Qf9fsSL7NY+G4GDM29wMm5ON+TjL1PG8ub1qNgmZhLI53E05feECBuef6CeSH9 BA8TFffB+6YZigOQgz5tA7AADOJUqbadUYeRebffPui6ipBipGSs/mj9MKc4TDlk2Dlw /20DGwzyf8DR1nqls/XiZnbccAsudacn827bXcFWXsSmUVVVVYWoibv3k0BhYA8dz5XA aW93E1uo4V0woLZS8OLxNT1ek/y+4VCg4Ufy0rkGqJIoux4AEfSJGIIZJvsgkD5iHWXg 6V7g== X-Gm-Message-State: APjAAAXWRYhSzoprnjhWtGW3rqhOPJzy7/dcvPf+iq9iY8PlfpoaAuhA B1vJZoqR+1tKwnlboYV52tDbxA== X-Received: by 2002:aa7:8a98:: with SMTP id a24mr16690672pfc.101.1567190187123; Fri, 30 Aug 2019 11:36:27 -0700 (PDT) Received: from [10.69.45.46] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id l7sm6635079pff.35.2019.08.30.11.36.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Aug 2019 11:36:26 -0700 (PDT) Subject: Re: [PATCH v2 3/3] nvme: fire discovery log page change events to userspace To: Sagi Grimberg , 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> From: James Smart Message-ID: <3c58613f-9380-6887-434a-0db31136e7aa@broadcom.com> Date: Fri, 30 Aug 2019 11:36:25 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <4555a281-3cbc-0890-ce85-385c06ca912b@grimberg.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/2019 11:08 AM, Sagi Grimberg wrote: > >>>> 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. -- james