Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5593578pxj; Wed, 23 Jun 2021 04:59:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJh+ppA1PdzM7nKtcWrOTiw+nHY7vjhtq7CLcdDBrvmMXTKjMa0DIXh9R8Xm8YjLPUZn5C X-Received: by 2002:a05:6638:35a8:: with SMTP id v40mr8935525jal.108.1624449567376; Wed, 23 Jun 2021 04:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624449567; cv=none; d=google.com; s=arc-20160816; b=jMoAPYRlUimZooCTwV+WenpUamMSuLLUOgJoiwmlTi6CcLxM7CV0/DTArQAQUeFz0A YJiJaJc8T/y+zVB3lZQiWGf9O3n+LEGZjZm4/3uL1qBXog5w5+M775/NK1J64Xvs62IQ Oxyh6j8J2/sRkZtIu3RlJNt2Syhv63Wo2MLVvUHKa36e1m7+WvTLSVLdWNyKgTmnZLJA cnkLsL3//xen/M5Xvx0fhln4A/v/AL4vDTda34zwvUDe+dAzm5Vgc//ZvMIAX/8x9+Vt PCb3p4+4PEOyjUxWKZVmUMBABzmt673QSdvZ2MFXA0lpYDBMC1Mm67p17uSH2DjH2pss QR5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=if+5vcxnYg39PHn7QTmtFHoajkkKrnrnAav0TjgSnZ4=; b=JTgpyQR3fYefbx4vV4bCmrrTQDj3lnAvuxISR0D0ZxdIrlqWS6lTm0mEw5x+watDNb /jnr8pyLghx3PCXtFUvo3AV4RdkjNTRspYd3B8VJI1PA6qL08voKOxFty8RZ3HW3d0UY ptz7jINsOUajmbx5Wnh5B/pwnkbpN6+/cTpd2PGia9gnej8MB3wBQl8b9Sd6bLfKbSny tA3b06zXWSwzze7P3tWtl4mkLF2tHY8QOxoC2k9YGXQCCTRi8qk6uKcwtsiHejDMCSTC hdPx0GnaOz4JY74mJKXjhia11ku5yE3BD+EfLtrAXwqG5+FfezbNmOBFyhSx9JSBLDVA Ppnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=svVwbyrR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si9742819ili.36.2021.06.23.04.59.15; Wed, 23 Jun 2021 04:59:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=svVwbyrR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230298AbhFWMA7 (ORCPT + 99 others); Wed, 23 Jun 2021 08:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbhFWMA6 (ORCPT ); Wed, 23 Jun 2021 08:00:58 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ED8CC061574; Wed, 23 Jun 2021 04:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=if+5vcxnYg39PHn7QTmtFHoajkkKrnrnAav0TjgSnZ4=; b=svVwbyrReSA0bEdCFvAQL0nRR6 pd6rdU+J/z/Uh7KtI6XWF1ddX4S6fLjMN7Ru1DAXN7TxPiqkBI6iJXlTKRC7i9Q0dG5Q1dRIqm0xJ LQ6zjTzMlqnPtrU99PboitgP3+uHj+mBV3EuT0OaU+JZtX5RQ4nYXI+OvgwRRJ65Rzn8aPH4n7Vib DaoFcSDaxmxLSFRhBD/L7bCK+CadMc7hL7T4zLFHNvI2R26zNrnzLsVyTfAEX6//KSbZ81KmCOPey +gJJZpDjgOvNbPHrZ5O1J5lC6I2Du2zRvDe33C6lDrZvo7m0Ahc1MlYNrFoGJN0IWDvrrZpByPx5+ QUIeC9nQ==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lw1Vw-00FO5h-Jw; Wed, 23 Jun 2021 11:58:01 +0000 Date: Wed, 23 Jun 2021 12:57:52 +0100 From: Christoph Hellwig To: Matteo Croce Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe , linux-kernel@vger.kernel.org, Lennart Poettering , Luca Boccassi , Alexander Viro , Damien Le Moal , Tejun Heo , Javier Gonz??lez , Niklas Cassel , Johannes Thumshirn , Hannes Reinecke , Matthew Wilcox , Christoph Hellwig , JeffleXu Subject: Re: [PATCH v3 6/6] loop: increment sequence number Message-ID: References: <20210623105858.6978-1-mcroce@linux.microsoft.com> <20210623105858.6978-7-mcroce@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210623105858.6978-7-mcroce@linux.microsoft.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 23, 2021 at 12:58:58PM +0200, Matteo Croce wrote: > From: Matteo Croce > > On a very loaded system, if there are many events queued up from multiple > attach/detach cycles, it's impossible to match them up with the > LOOP_CONFIGURE or LOOP_SET_FD call, since we don't know where the position > of our own association in the queue is[1]. > Not even an empty uevent queue is a reliable indication that we already > received the uevent we were waiting for, since with multi-partition block > devices each partition's event is queued asynchronously and might be > delivered later. > > Increment the disk sequence number when setting or changing the backing > file, so the userspace knows which backing file generated the event: Instead of manually incrementing the sequence here, can we make loop generate the DISK_EVENT_MEDIA_CHANGE event on a backing device (aka media) change?