{"id":2223185,"url":"http://patchwork.ozlabs.org/api/patches/2223185/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260414161805.233686-4-bharathsm@microsoft.com/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260414161805.233686-4-bharathsm@microsoft.com>","list_archive_url":null,"date":"2026-04-14T16:18:05","name":"[4/4] smb: client: add tracepoints for deferred handle caching","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"49a2c71f84112859cb54b36711c8d4fd3a4a3654","submitter":{"id":86063,"url":"http://patchwork.ozlabs.org/api/people/86063/?format=json","name":"Bharath SM","email":"bharathsm.hsk@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260414161805.233686-4-bharathsm@microsoft.com/mbox/","series":[{"id":499868,"url":"http://patchwork.ozlabs.org/api/series/499868/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=499868","date":"2026-04-14T16:18:03","name":"[1/4] smb: client: add tracepoints for lock operations","version":1,"mbox":"http://patchwork.ozlabs.org/series/499868/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223185/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2223185/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-cifs+bounces-10815-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=gi/1H5Uf;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10815-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"gi/1H5Uf\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.181","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fw8l566cLz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 02:25:21 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id E3AA8301F325\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 16:18:33 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 783834315A;\n\tTue, 14 Apr 2026 16:18:33 +0000 (UTC)","from mail-pf1-f181.google.com (mail-pf1-f181.google.com\n [209.85.210.181])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C56B3E6396\n\tfor <linux-cifs@vger.kernel.org>; Tue, 14 Apr 2026 16:18:32 +0000 (UTC)","by mail-pf1-f181.google.com with SMTP id\n d2e1a72fcca58-82a7ebc729dso2616980b3a.3\n        for <linux-cifs@vger.kernel.org>;\n Tue, 14 Apr 2026 09:18:32 -0700 (PDT)","from bharathsm-Virtual-Machine.. ([167.220.110.101])\n        by smtp.googlemail.com with ESMTPSA id\n d2e1a72fcca58-82f0c30ee59sm15298585b3a.1.2026.04.14.09.18.30\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 14 Apr 2026 09:18:30 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776183513; cv=none;\n b=e7aCdmc7HWK8HwC8TmKnpK/LvIAmTBm44Wuyss7TO9UFUIuFhL9waWKpEu52/9dtl6yOnN0sUAuLduYmDAcnjWCmHr323K0N0O1hiPO4e+KgAwVwJ8Zy0G7kO2tqLSDHe4MJheht4NSRRrk+fCAvP1pRFhY7UtWhT9Wpya/vf8s=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776183513; c=relaxed/simple;\n\tbh=bcs5Bdjk/1br+qhEaLKA5J3IsoAvhukhYIjFlzbnEUI=;\n\th=From:To:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=UBKLf8wrNWGeZgdyVgfhYBNxqr+nG55n1fmMjANm5NEF7PWOwB9CtcWWErEif4PfW9eyONUHyQef190g98M6vzdeWVbD2Vj8Hkv4glDQFmrNV3RLU4fUyD1Cn+0+jenWUm8Bq+PpGcqPqSrO+S2xGUf0nB2GtW0zy7D7Wg3pc1c=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=gi/1H5Uf; arc=none smtp.client-ip=209.85.210.181","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1776183511; x=1776788311;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:to:from:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=LfIZ0nR9y0zFrB/7i4IOTVQkXd+7h9FHuUzcwphCbDw=;\n        b=gi/1H5UfZ5AnxzFqextHbfQj6xbF+hArOIED775G+uOcVdA4zd0vec+s1RexRueI6+\n         xc3sOk5ANn2PboMuTbKlyDcwkOi1HQ3NmSw39sANQHKNdfe8qvJ9iluLNx5SN/yGPKPq\n         900K7HtOZ6n3liqjM+fVBZElaZMylbpGrlmeKeIFtr81JwUcFWZf1lEbV/k54KQcrHt6\n         gM2b73zFxeJ7VC3T/6Oev1Bv7b1s3bvlYxNvdJ3XLGpzOfqbE3o2NSDrsVnLA/u39sEJ\n         6EqKH81xW82mRLUTewS2auRsui49TOvIcCipY007BCLvAvBvCg6S0cAl+JpGt6HO5sXg\n         7m9w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776183511; x=1776788311;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to\n         :cc:subject:date:message-id:reply-to;\n        bh=LfIZ0nR9y0zFrB/7i4IOTVQkXd+7h9FHuUzcwphCbDw=;\n        b=DsTecY/oiaqqu33cnK7AtBtTGtUGqUaFut1Xn/dZM4L0YLx5Hw3AzI8XNxVmq/aIfT\n         qpjmEWuNCAUjJ8HCiJtr+rXKAy5fRI7sTEWk8ChVzCLV/gxSfO2o2mXH8KIGGW1VvTU8\n         vxlAD6r7RX8UVbA9xI4vM8nl1hTylb/GoibFUhb95zg2KBgSIPPoHcdh6gr9UFcm+4Ff\n         DA3Viphc/hh4zmuJRVYFltD7cNFkLlbNsz0QwmIek5aBdCr0BT/gRAbYX8vKYs36h82v\n         k8fVnzTLBHjxHn7vZ+JLY8NqbBhLUHbQ4MS5mY685YwT8LxdYnRR3vFpszuYUXE4IeGt\n         0rXA==","X-Gm-Message-State":"AOJu0YzGxLsMDUEd2A5ezYKl4F9gDquhowMahWwoCGifTSEgDw5Tj/gP\n\tiMmWwA5/TQoW1GJARbqpdNa4nra7oi1hhjK2myUYcH88G6Z+z0fmfUyLeGNKXdNO","X-Gm-Gg":"AeBDievn6aSgszqRSOQCfNIasDv4LJzNtyw5m8eFSM4C4+eXEmy2xvY8x1JVJ+VksjH\n\t02bZ6bPG07v0s+kabsHYCfywOFhZ6aHLEQZ10L3WWNds+b5mLT1UrCwcqO9v37C7tyyosHhh606\n\t2c7Go9la7uDauK59crWZay4aaF/s6c7bZ55X/FokpzHRojjtkIW8vSeeM3OnQ+5sQQ/RvByvN9S\n\tl/MT4EzmWhM7GJXXNS422bKbflVww0tZv/2HtulGj6CAL1KxgbLswwNyyglPG/sn/ALf51TF30p\n\t9LAPznQ/R7EbxX11qRoZ3UkmJIUUJk9jGOSogQsFGLbGSUHEsFEA90P/7plvFtNVk+0WFxUBP7h\n\t5SaEERIz3RMDeNglPv3oHvOrpbXioSsDQUbys0mx4wEWDvhmLUgEIs2jVgOUDOhkK4MeeFsWK15\n\tLL3lW3UY8DPfwft4j8vun/Vv+FgirtkYHjaqxjFAxkM6MmObZ/gTn2Ut8i6XiWPg==","X-Received":"by 2002:a05:6a00:2918:b0:82a:6461:6d1e with SMTP id\n d2e1a72fcca58-82f0c26bb4emr20063608b3a.46.1776183511249;\n        Tue, 14 Apr 2026 09:18:31 -0700 (PDT)","From":"Bharath SM <bharathsm.hsk@gmail.com>","X-Google-Original-From":"Bharath SM <bharathsm@microsoft.com>","To":"linux-cifs@vger.kernel.org,\n\tsmfrench@gmail.com,\n\tsprasad@microsoft.com,\n\tpc@manguebit.com,\n\tematsumiya@suse.de,\n\thenrique.carvalho@suse.com,\n\tbharathsm@microsoft.com","Subject":"[PATCH 4/4] smb: client: add tracepoints for deferred handle caching","Date":"Tue, 14 Apr 2026 21:48:05 +0530","Message-ID":"<20260414161805.233686-4-bharathsm@microsoft.com>","X-Mailer":"git-send-email 2.48.1","In-Reply-To":"<20260414161805.233686-1-bharathsm@microsoft.com>","References":"<20260414161805.233686-1-bharathsm@microsoft.com>","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"Add tracepoints to observe handle caching behavior.\n\nsmb3_open_cached: emitted when an open reuses a cached handle from\na previous deferred close, avoiding a network round-trip\n\nsmb3_close_cached: emitted when a close is deferred (handle cached\nfor potential reuse by subsequent opens)\n\nSigned-off-by: Bharath SM <bharathsm@microsoft.com>\n---\n fs/smb/client/file.c  |  8 +++++++\n fs/smb/client/trace.h | 51 +++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 59 insertions(+)","diff":"diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c\nindex 4662592801b0..79819241ebfd 100644\n--- a/fs/smb/client/file.c\n+++ b/fs/smb/client/file.c\n@@ -1083,6 +1083,9 @@ int cifs_open(struct inode *inode, struct file *file)\n \t\trc = cfile ? 0 : -ENOENT;\n \t}\n \tif (rc == 0) {\n+\t\ttrace_smb3_open_cached(xid, tcon->tid, tcon->ses->Suid,\n+\t\t\t\t       cfile->fid.persistent_fid,\n+\t\t\t\t       file->f_flags, cfile->f_flags);\n \t\tfile->private_data = cfile;\n \t\tspin_lock(&CIFS_I(inode)->deferred_lock);\n \t\tcifs_del_deferred_close(cfile);\n@@ -1442,6 +1445,7 @@ int cifs_close(struct inode *inode, struct file *file)\n \tstruct cifsInodeInfo *cinode = CIFS_I(inode);\n \tstruct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);\n \tstruct cifs_deferred_close *dclose;\n+\tstruct cifs_tcon *tcon;\n \n \tcifs_fscache_unuse_inode_cookie(inode, file->f_mode & FMODE_WRITE);\n \n@@ -1468,6 +1472,10 @@ int cifs_close(struct inode *inode, struct file *file)\n \t\t\t\t\tcifsFileInfo_get(cfile);\n \t\t\t} else {\n \t\t\t\t/* Deferred close for files */\n+\t\t\t\ttcon = tlink_tcon(cfile->tlink);\n+\t\t\t\ttrace_smb3_close_cached(tcon->tid, tcon->ses->Suid,\n+\t\t\t\t\t\tcfile->fid.persistent_fid,\n+\t\t\t\t\t\tcifs_sb->ctx->closetimeo);\n \t\t\t\tqueue_delayed_work(deferredclose_wq,\n \t\t\t\t\t\t&cfile->deferred, cifs_sb->ctx->closetimeo);\n \t\t\t\tcfile->deferred_close_scheduled = true;\ndiff --git a/fs/smb/client/trace.h b/fs/smb/client/trace.h\nindex 57abf5fca26c..b99ec5a417fa 100644\n--- a/fs/smb/client/trace.h\n+++ b/fs/smb/client/trace.h\n@@ -1361,6 +1361,57 @@ DEFINE_EVENT(smb3_open_done_class, smb3_##name,  \\\n DEFINE_SMB3_OPEN_DONE_EVENT(open_done);\n DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done);\n \n+TRACE_EVENT(smb3_open_cached,\n+\tTP_PROTO(unsigned int xid,\n+\t\t__u32 tid,\n+\t\t__u64 sesid,\n+\t\t__u64 fid,\n+\t\tunsigned int oflags,\n+\t\tunsigned int cflags),\n+\tTP_ARGS(xid, tid, sesid, fid, oflags, cflags),\n+\tTP_STRUCT__entry(\n+\t\t__field(unsigned int, xid)\n+\t\t__field(__u32, tid)\n+\t\t__field(__u64, sesid)\n+\t\t__field(__u64, fid)\n+\t\t__field(unsigned int, oflags)\n+\t\t__field(unsigned int, cflags)\n+\t),\n+\tTP_fast_assign(\n+\t\t__entry->xid = xid;\n+\t\t__entry->tid = tid;\n+\t\t__entry->sesid = sesid;\n+\t\t__entry->fid = fid;\n+\t\t__entry->oflags = oflags;\n+\t\t__entry->cflags = cflags;\n+\t),\n+\tTP_printk(\"xid=%u sid=0x%llx tid=0x%x fid=0x%llx oflags=0x%x cflags=0x%x\",\n+\t\t__entry->xid, __entry->sesid, __entry->tid, __entry->fid,\n+\t\t__entry->oflags, __entry->cflags)\n+);\n+\n+TRACE_EVENT(smb3_close_cached,\n+\tTP_PROTO(__u32 tid,\n+\t\t__u64 sesid,\n+\t\t__u64 fid,\n+\t\tunsigned long delay_jiffies),\n+\tTP_ARGS(tid, sesid, fid, delay_jiffies),\n+\tTP_STRUCT__entry(\n+\t\t__field(__u32, tid)\n+\t\t__field(__u64, sesid)\n+\t\t__field(__u64, fid)\n+\t\t__field(unsigned long, delay_jiffies)\n+\t),\n+\tTP_fast_assign(\n+\t\t__entry->tid = tid;\n+\t\t__entry->sesid = sesid;\n+\t\t__entry->fid = fid;\n+\t\t__entry->delay_jiffies = delay_jiffies;\n+\t),\n+\tTP_printk(\"sid=0x%llx tid=0x%x fid=0x%llx delay_jiffies=%lu\",\n+\t\t__entry->sesid, __entry->tid, __entry->fid, __entry->delay_jiffies)\n+);\n+\n \n DECLARE_EVENT_CLASS(smb3_lease_done_class,\n \tTP_PROTO(__u32\tlease_state,\n","prefixes":["4/4"]}