Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp447024lqp; Mon, 10 Jun 2024 08:47:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGJsm7wPp1Ejbt37MigntSmvOrytGjCXlf24Rq6dU2Hlhrx/FsHe+sIyhTUqzcHQK+Tk9JcxRmo+2VS+KR9RqGTSfWCg5fVQ4mRSYhxA== X-Google-Smtp-Source: AGHT+IEZo508oVFH2Dy6FEYzs1mL/sXLd1bUTp2K32dwQ85+73Rz/YMoFrnwLk73qN2RwskyUd8n X-Received: by 2002:ac2:4c82:0:b0:52c:8289:e891 with SMTP id 2adb3069b0e04-52c8289e9a0mr4072187e87.6.1718034433299; Mon, 10 Jun 2024 08:47:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718034433; cv=pass; d=google.com; s=arc-20160816; b=b3HjC/vcfJ65eV+hOEHHDwxKYPndwOpcpuc1Jc1qw1jiBQlf6BgaIXtgIci8xzX8k9 hlYcUFLLgHlz2ncT0dT9c5ei9EPXnpBgkw8r6mCaz4EPnh5wC2H9RCvR+4q36cutqKFn JCLZj6e0r5c8uyB0H7va9hhKbwK1LygMs/ZxBz42jEo8s8TdS+YzZOl4utsfcjsQlh3J OhANhhMkBziwz5hwkQeXwtFmqZXCpWkqw7IET9CCK3BOxXM7AahUwdPCjlEZGXJoayL6 N7w3CzuH9JB4piFK93k8+UQDSTRIjryb1ZxBI70+N4uaE/+JpbtrdfKSFYhJX3Tyvte1 GrHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ivxMbqPBVW/ClgvBIVHXPL4FcEdcBIF9jtYkx0vFw4U=; fh=uVeVr44ESEUwjOpkufMHPks1uulfLJ0YkAP1q7n7E8o=; b=ERsJA4ZNh7S4XuuzrKoqUp2jqaMgu+mskLPqpcxfvki2QdlqTus5967Ehql8g3GQ0/ PPhzNUYawX43hJaX6Y8kmRcq3iHpC+9ilNbP7D6nDYT8GiJDl2FRGvhTn657YErc8UsU 7lw8B/vyAnSwovYRQl26FDS1GYMMUGg4h/iuiXNnEKDJUn/ixVke1R8qhxY/PTX/vj1/ YMzE8PIhmrB6bTPwIwsVVSXg9CiMgyNelACUXUJbzivzCEyT5j6Xxag4QThedJUzx3Do IOPnw55bRqcz3A1LAYPyVgOeJ3QT3B5KGWNdS8iNnV0/qlZoKrljCEHwdvRtWYIdaJtJ Ewxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fwii7sXn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208505-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208505-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f1484bdafsi178408966b.579.2024.06.10.08.47.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 08:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208505-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fwii7sXn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208505-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208505-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 064D31F22A96 for ; Mon, 10 Jun 2024 15:47:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C74E9142E90; Mon, 10 Jun 2024 15:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fwii7sXn" 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 E719C140364; Mon, 10 Jun 2024 15:46:42 +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=1718034403; cv=none; b=gtMWixQuwS2Fi3r9UIQlUgTf9WDqgqyiwKRU/+4a+cbG2Qe1HdaHbQ9ZFm/DqV7UGdPPTehM40NCTz/6Yl8hnSJXCtATREwferZNtwvEjU5jnsJXRmT2D97gBXT1r/JMUkOnb1AR/eUhWuC86nTssiiLEIoooXBNP5ffDj0nJSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718034403; c=relaxed/simple; bh=+4/zPi4hkw9UfPxusBsUfwuVq79GZtvtVsjTstppxQc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NBh+J2oMCMJ9xiLkZYzbIS7AGzcK/YWtLUU0+LBbmGF5Vt6ED+Q+Ll4uDvZxQNk1pEMKf3tB16bKd+eIL7AnWYECo+VVDGyitBkZkOyvz6Xi9HB/rKN7Dkm4MzUcrRE7Qzk45Z/pz8Cu/BD99mvtL0sZPth86e3t7otvDbLf1X8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fwii7sXn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68C8DC2BBFC; Mon, 10 Jun 2024 15:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718034402; bh=+4/zPi4hkw9UfPxusBsUfwuVq79GZtvtVsjTstppxQc=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Fwii7sXnqnhyPe9nfsJEx4HelbDSAwAq539Cs4TUF7W/nwWo/mkQZnwbqkz1hJCsx Gl7rGNsG6Y36dslQZqhMohi69OBawmwEWammQElV+FoIvi/t62YOM6TW6enEwgGOKE ppouJINyhxUq85WZiR51gjaXEe+uiTRqdWXCnSizNl4ClunIQF/HIlhljzVXslV7zv OeNcLtKfBQj2/M4NYZAEcz7By8mW5z+uNvP6XbbHCGkJPaOoHEvysPmJJ+Vdpz4451 YcgIftKDpf74Hr06mW4GdGG/67vUamk2Pg1UsSHXeVh/chMDR1k9JXvuCQ9rxGcJ9v InhdFxKuunayQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 0B026CE2373; Mon, 10 Jun 2024 08:46:42 -0700 (PDT) Date: Mon, 10 Jun 2024 08:46:42 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Julia Lawall , kernel-janitors@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Vlastimil Babka Subject: Re: [PATCH 05/14] tracefs: replace call_rcu by kfree_rcu for simple kmem_cache_free callback Message-ID: Reply-To: paulmck@kernel.org References: <20240609082726.32742-1-Julia.Lawall@inria.fr> <20240609082726.32742-6-Julia.Lawall@inria.fr> <20240610112223.151faf65@rorschach.local.home> 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-Disposition: inline In-Reply-To: <20240610112223.151faf65@rorschach.local.home> On Mon, Jun 10, 2024 at 11:22:23AM -0400, Steven Rostedt wrote: > On Sun, 9 Jun 2024 10:27:17 +0200 > Julia Lawall wrote: > > > diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c > > index 7c29f4afc23d..338c52168e61 100644 > > --- a/fs/tracefs/inode.c > > +++ b/fs/tracefs/inode.c > > @@ -53,14 +53,6 @@ static struct inode *tracefs_alloc_inode(struct super_block *sb) > > return &ti->vfs_inode; > > } > > > > -static void tracefs_free_inode_rcu(struct rcu_head *rcu) > > -{ > > - struct tracefs_inode *ti; > > - > > - ti = container_of(rcu, struct tracefs_inode, rcu); > > - kmem_cache_free(tracefs_inode_cachep, ti); > > Does this work? > > tracefs needs to be freed via the tracefs_inode_cachep. Does > kfree_rcu() handle specific frees for objects that were not allocated > via kmalloc()? A recent change to kfree() allows it to correctly handle memory allocated via kmem_cache_alloc(). News to me as of a few weeks ago. ;-) Thanx, Paul > -- Steve > > > > -} > > - > > static void tracefs_free_inode(struct inode *inode) > > { > > struct tracefs_inode *ti = get_tracefs(inode); > > @@ -70,7 +62,7 @@ static void tracefs_free_inode(struct inode *inode) > > list_del_rcu(&ti->list); > > spin_unlock_irqrestore(&tracefs_inode_lock, flags); > > > > - call_rcu(&ti->rcu, tracefs_free_inode_rcu); > > + kfree_rcu(ti, rcu); > > } > > > > static ssize_t default_read_file(struct file *file, char __user *buf, >