Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2681205ybl; Thu, 29 Aug 2019 11:23:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBhcf4bBcpl5k39sz5aXfiPc2P3NM6etMvWobXYD5lpvMy1T3oqU0+Oy98i0IkNQSLMPMt X-Received: by 2002:a17:90a:734a:: with SMTP id j10mr11367120pjs.63.1567103012662; Thu, 29 Aug 2019 11:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567103012; cv=none; d=google.com; s=arc-20160816; b=nMzihvgljAn9LjhMaNNK02szgecAIkNGHzw0wHVF04ugAY8GvojpMZssq1uG1yg4fK cNlbwz1ZbIk0BJcYw4w8MagG+3XlNWXH17lakGoFuFhV3I7CPbbfTtWYslWtJkDpzLpp rGZCDD0qlRnc9P5n2r/6mAbJ0QHw5XzzPBSnHnvErpU1Y2MJMH5u2PbcaKbYHWTiisZA l5toYYrb6Zsh4jvdtY08YRDLmyHysUfVHVr3pY/0j8aWcQ3xR5NjtAd6CUQMXEMutTXB nz3hLjPfIn4KVH4d4ub6JMvbJM8ru+O4DpuePcr0fi2b9QLuIhn2l81aKgQm382KACok DSfQ== 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=9wemDLG+al8uBFQtCufV5oYzqlZQzmNTZtOsaYBmOL4=; b=lVAnoNlhO9p4gsuFablAKk0ij+mflEn0bvrhWuN0HC3IqpgjS4nggMBhfKU2iafJMR XQmjrYt2aVUnmRckmw3XayLkddJ2878m+jlPJBOXiO2a2xeJJeGg+jQr+jAAobQfxMYN 3q2YYRJsJv5LTMxSRV6na9TctA718P1rD2C8UBfYuuEihmCE7vp6oga+TiWDp24kuD2D wqDbvFrl/32naTmPugI2L0lt8IsrXmvnytILetIosS77EYKVaXmeFO7IqOOVxfHZPcKZ P2VxEe7JEaR3CQWtYS2O8OS7OITt2fxEvwW3bdvT44OwvpOFmkUa69tZHvIq7wsLPcwp J2/w== 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 r8si2687131pgr.243.2019.08.29.11.23.16; Thu, 29 Aug 2019 11:23:32 -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 S1729403AbfH2SVM (ORCPT + 99 others); Thu, 29 Aug 2019 14:21:12 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52596 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729052AbfH2SVJ (ORCPT ); Thu, 29 Aug 2019 14:21:09 -0400 Received: by mail-wm1-f67.google.com with SMTP id t17so4705395wmi.2 for ; Thu, 29 Aug 2019 11:21:08 -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=9wemDLG+al8uBFQtCufV5oYzqlZQzmNTZtOsaYBmOL4=; b=mXix5R/GKhH05FxQiYlol0h1tWjIzt5XdJQ0MMUCI7ZstwYK6iNcBjk4rhx3juw+Xt sSujIkJNknqbTKOgrZoxrPJQ5f5Gt2q3ooastPNh5U684/KIDMpkit7xJRalb7eNm7Sd sVaxAOKly/ZaGLjXfqnClz7TBvfQC2F5iLkmROSSlrZF3uKsOfCvk7WibCKpOCphh/hB xJDlqpBukLX8j0yuY1F1tRXZ86Kblsjd+39lB2cl3H52aOeoksicjVuce4wXcEVP3VlZ r143+0osapSmwBqFdYnMj5s6p8GU99jh0ZcdurztswZOTYsOIONfaXlDJ6XN62GlzKXm 8f8w== X-Gm-Message-State: APjAAAWdG9wfSftwQrmMzFUV29m1HemipQqj5dQ8frSXUIuGYc0Ns8Rl c1MLtRF7z4giyY/uhDp7HANX2HfL X-Received: by 2002:a1c:2d4:: with SMTP id 203mr13320824wmc.105.1567102867216; Thu, 29 Aug 2019 11:21:07 -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 c187sm5655385wmd.39.2019.08.29.11.21.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 11:21:06 -0700 (PDT) Subject: Re: [PATCH v2 3/3] nvme: fire discovery log page change events to userspace To: Greg Kroah-Hartman , Christoph Hellwig Cc: linux-nvme@lists.infradead.org, Keith Busch , James Smart , linux-kernel@vger.kernel.org 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> From: Sagi Grimberg Message-ID: Date: Thu, 29 Aug 2019 11:21:02 -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: <20190826075916.GA30396@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>> You are correct that this information can be derived from sysfs, but the >>>> main reason why we add these here, is because in udev rule we can't >>>> just go ahead and start looking these up and parsing these.. >>>> >>>> We could send the discovery aen with NVME_CTRL_NAME and have >>>> then have systemd run something like: >>>> >>>> nvme connect-all -d nvme0 --sysfs >>>> >>>> and have nvme-cli retrieve all this stuff from sysfs? >>> >>> Actually that may be a problem. >>> >>> There could be a hypothetical case where after the event was fired >>> and before it was handled, the discovery controller went away and >>> came back again with a different controller instance, and the old >>> instance is now a different discovery controller. >>> >>> This is why we need this information in the event. And we verify this >>> information in sysfs in nvme-cli. >> >> Well, that must be a usual issue with uevents, right? Don't we usually >> have a increasing serial number for that or something? > > 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.