Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp870773rdb; Fri, 26 Jan 2024 13:27:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2XPR65DhudcnvaQZFslNWBZgcecNazqT61VDOJcxSFzhdoMPYTMQLMuRVyFsl3Pqd9vbu X-Received: by 2002:aa7:d4d4:0:b0:55b:7fd6:4daa with SMTP id t20-20020aa7d4d4000000b0055b7fd64daamr802253edr.8.1706304458475; Fri, 26 Jan 2024 13:27:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706304458; cv=pass; d=google.com; s=arc-20160816; b=m1jXVwlCpilG96XtqJ+MP2Dm1Z5M2HD0Tq4gHBaiQFD9gllleN60P+KypWSpqh5vhG 83PeKkpXJz4QWI39VZWvIb+Gp3rpijQU95h6mJvmYCoebtHAxvZKD5TRPI/scSsH2SX0 G90zyl2KvIfiDdcT++BNLJycOA8heepqdEIo1JjywWP6aIhdwVIKVV3xjpdTCuqEMI38 Y3XtuGBgYDMCRVCY5wULOAAPgbu7MK3M5gp+Eqq12qpnPeZiuumdZem/wlIJxjSYBpSI m+45hqF1vKiZC4Tc50GDAZX0d1GXin9VJmsanKly8MJn3Zcj/iCEcsYN0LeKoMsD5v5P nh3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=W9qsQxTUKxAU6w/pC8q4nunTLkwW68NB6Pp20lIKva8=; fh=wMMk2NwBM2A+Q1mkqczGYlMGmcFQmd5HTUYiEJw+U5I=; b=pFL8pcs9l80XsRcm+ugkdfuVFjbPd/9m2o8xcfj/RCsiECsg0pdRdH7RvJt0o9X7ke mvSOLchLFjtObaIfDYtFLp6wGOE+lS17yIAg+HDhWnRdQUCVrKnntqOa++U/bg1OiQkD oagWw+RhAkFXlVS/mGiszgqGWYuEVS3k79fME5TTp/tBdYjVwWlHIBbyU8SvqOsgdvcB as0J+9GwInW/Figsm+jFvYlDUTwuUZ46L/pSTczRlELRQ7oh7Nn9Qb4r+Y0G6qb+xXhj JpOTYJyINNI1g723CZhlnXh6gI5/8ug25ZgJDcO/i3t0LRfWteswF5T1SNHEB2AOAJJE +YLQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-40671-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40671-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g18-20020a0564021ed200b0055a8e3cec48si1025120edg.577.2024.01.26.13.27.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:27:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40671-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-40671-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40671-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3A3ED1F2260F for ; Fri, 26 Jan 2024 21:27:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99F0424A0F; Fri, 26 Jan 2024 21:27:27 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BA95250E2; Fri, 26 Jan 2024 21:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706304447; cv=none; b=EZJIsK2ssxE5an0ufuCuEj2N1tBGMuK+7i15+3N3LVV6l3/soAABcA/oVLHv1apxGwDjGGeOBGlMycugvOLqGuJi1pOrDXgddWwUhvyDqHRTn+JllOUEdY+Vtq92gkuU8OoFhoq9F6qpJjO7hcnMT4LuEkZ8ItpR8R4L62ycCBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706304447; c=relaxed/simple; bh=0Ibpzu52pa7xZyWfPXdiBU7biXDc1fNDD9XSBAy9kds=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=L0j8c/tPAdQvXWFgt5vJJbucRTotxyjt3giIfdI6DfFhGsDlFQE1ScnBN9Tfk8agsQcuJvz8PxqgTKq9tzlaTYrMh1KOogcO/ZIfVBnEJVte9HHG+HO8LAB7ehGpEXUDWd5PFrzjhtfBmDuvw7ji8sUWkK3ZrsUsGxSPGswzFDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9A4BC433F1; Fri, 26 Jan 2024 21:27:25 +0000 (UTC) Date: Fri, 26 Jan 2024 16:27:28 -0500 From: Steven Rostedt To: Mathieu Desnoyers Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Christian Brauner , Ajay Kaher , Geert Uytterhoeven , linux-fsdevel , Linus Torvalds Subject: Re: [RESEND] [PATCH] eventfs: Have inodes have unique inode numbers Message-ID: <20240126162728.786e56dd@gandalf.local.home> In-Reply-To: References: <20240126151251.74cb9285@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 26 Jan 2024 15:24:17 -0500 Mathieu Desnoyers wrote: > On 2024-01-26 15:12, Steven Rostedt wrote: > [...] > > diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c > > index e1b172c0e091..2187be6d7b23 100644 > > --- a/fs/tracefs/inode.c > > +++ b/fs/tracefs/inode.c > > @@ -223,13 +223,41 @@ static const struct inode_operations tracefs_file_inode_operations = { > > .setattr = tracefs_setattr, > > }; > > > > +/* Copied from get_next_ino() but adds allocation for multiple inodes */ > > +#define LAST_INO_BATCH 1024 > > +#define LAST_INO_MASK (~(LAST_INO_BATCH - 1)) > > +static DEFINE_PER_CPU(unsigned int, last_ino); > > + > > +unsigned int tracefs_get_next_ino(int files) > > +{ > > + unsigned int *p = &get_cpu_var(last_ino); > > + unsigned int res = *p; > > + > > +#ifdef CONFIG_SMP > > + /* Check if adding files+1 overflows */ > > How does it handle a @files input where: > > * (files+1 > LAST_INO_BATCH) ? > > * (files+1 == LAST_INO_BATCH) ? Well, this is moot anyway, as Linus hates it. -- Steve