Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5651260pxj; Wed, 23 Jun 2021 06:12:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOzRsAZSkYjbtEg0YHAEnoCjqPc0zJRmJVFOS7zcvs35urfBApPdolvFFS6vDqZ1HCxQyz X-Received: by 2002:a92:b07:: with SMTP id b7mr1648565ilf.132.1624453923606; Wed, 23 Jun 2021 06:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624453923; cv=none; d=google.com; s=arc-20160816; b=GuH+0zcK6M15HK/IuXeK2vLNZQgHx7PAgHj9dSEvTgQjmSKW9kR8j/Wch2X/1U1wTx WZ2hHV5mzhJO+odlE7bbzYZB9xWxaL3EGSA7K2y97zAv7ux3q1bmv8zn9y13AkwoAeYS MllNGbmKmsQX4iIWIWQekVj2pwbVDMX9p5OIfWwjP7Y72zraWffsUKaUrIeLoxz3e41K xZD1DqEqSBol0dIWiPY8Tg8utN3xlhLSWH8KeOsKr6WJsvNtBx69iT0U7I+q7MyHU7+S DBVZjmbNT3MtsuaBTx9ScjKSXhaXVykZgh/miHsj20+uzxGKlZorDhCzAUU7hUTGKwz0 i0vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=X0fsfcHKZT74HvXRviTlryAaKv2AtX1mjJYmSzENvUc=; b=t9ofdAkkR/nZu72RGhg8wxxyxL73NngIwHyOvF/wxnjYsDOCOaZisOVv+8Pmctekil eWbsDiu9lzpz719YAyWHLceagaH5UInhcx86HUQtVMCRFmbISo44R8MDJBk4SrWUZWdt cnCfIGw2smylHd6nlstPnGXXHpkbMAEt9ZO9sezrzFEGAUTk9dBPTXs6K5TwCn05VbAg 1sby3XH2XaWPugk9WcGWCHilAXb2TBFn/Y67cNV95dpB7aldnLTf2gaTEKf9u0Ppy2oK Dh8KdeXN3EGvmcYypnKg+hX0OEC68s3ojlofGrmgMEm3j/UBCVnBS+P9373c/7j7juks C3Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="MiT/3muh"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si12334267ioj.88.2021.06.23.06.11.51; Wed, 23 Jun 2021 06:12:03 -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=@linux.microsoft.com header.s=default header.b="MiT/3muh"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbhFWNNQ (ORCPT + 99 others); Wed, 23 Jun 2021 09:13:16 -0400 Received: from linux.microsoft.com ([13.77.154.182]:48892 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbhFWNNP (ORCPT ); Wed, 23 Jun 2021 09:13:15 -0400 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by linux.microsoft.com (Postfix) with ESMTPSA id B430320B6AEE; Wed, 23 Jun 2021 06:10:57 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B430320B6AEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1624453857; bh=X0fsfcHKZT74HvXRviTlryAaKv2AtX1mjJYmSzENvUc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MiT/3muhlL9+IGywtJkQ2n5Qc/WNSVUoWcjCorFidH/MWy3QWmvIl23/J4G5/Xksj /J6YvXcn5iJzTLaA04sU7h5hGWF2UPoHhSwdHUudQCH5yjI8O3ynqw97vBxgo3RxG7 fi+6Y1zPqIcY3IJ5ty7ftNtltnFmaHrCpv7ZF458= Received: by mail-pf1-f176.google.com with SMTP id i6so2303935pfq.1; Wed, 23 Jun 2021 06:10:57 -0700 (PDT) X-Gm-Message-State: AOAM531ZeHqYFzy9hVmntGjs32cow6pvKpMsFm8nRgJiZG6hTNZ/hp1i DQjMc0wsBKIjjzPAQQlIV5w/GUXRVoeYGGCQBZM= X-Received: by 2002:a05:6a00:17a5:b029:305:d4e8:7391 with SMTP id s37-20020a056a0017a5b0290305d4e87391mr6751150pfg.0.1624453857011; Wed, 23 Jun 2021 06:10:57 -0700 (PDT) MIME-Version: 1.0 References: <20210623105858.6978-1-mcroce@linux.microsoft.com> <20210623105858.6978-2-mcroce@linux.microsoft.com> In-Reply-To: From: Matteo Croce Date: Wed, 23 Jun 2021 15:10:21 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/6] block: add disk sequence number To: Christoph Hellwig Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe , Linux Kernel Mailing List , Lennart Poettering , Luca Boccassi , Alexander Viro , Damien Le Moal , Tejun Heo , "Javier Gonz??lez" , Niklas Cassel , Johannes Thumshirn , Hannes Reinecke , Matthew Wilcox , JeffleXu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 23, 2021 at 1:49 PM Christoph Hellwig wrote: > > On Wed, Jun 23, 2021 at 12:58:53PM +0200, Matteo Croce wrote: > > +void inc_diskseq(struct gendisk *disk) > > +{ > > + static atomic64_t diskseq; > > Please don't hide file scope variables in functions. > I just didn't want to clobber that file namespace, as that is the only point where it's used. > Can you explain a little more why we need a global sequence count vs > a per-disk one here? The point of the whole series is to have an unique sequence number for all the disks. Events can arrive to the userspace delayed or out-of-order, so this helps to correlate events to the disk. It might seem strange, but there isn't a way to do this yet, so I come up with a global, monotonically incrementing number. -- per aspera ad upstream