Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807873/?format=api
{ "id": 807873, "url": "http://patchwork.ozlabs.org/api/patches/807873/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/150412223801.10177.4972035211701096310.stgit@dwillia2-desk3.amr.corp.intel.com/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/projects/8/?format=api", "name": "Linux ext4 filesystem development", "link_name": "linux-ext4", "list_id": "linux-ext4.vger.kernel.org", "list_email": "linux-ext4@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<150412223801.10177.4972035211701096310.stgit@dwillia2-desk3.amr.corp.intel.com>", "list_archive_url": null, "date": "2017-08-30T19:43:58", "name": "[v3,2/4] xfs: perform dax_device lookup at mount", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "29ed1fc516d90ce364881399879e791e978b5f06", "submitter": { "id": 347, "url": "http://patchwork.ozlabs.org/api/people/347/?format=api", "name": "Dan Williams", "email": "dan.j.williams@intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/150412223801.10177.4972035211701096310.stgit@dwillia2-desk3.amr.corp.intel.com/mbox/", "series": [ { "id": 694, "url": "http://patchwork.ozlabs.org/api/series/694/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=694", "date": "2017-08-30T19:43:47", "name": "fs, dax: lookup dax_device at mount time", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/694/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807873/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807873/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-ext4-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjGM51Y1mz9sP5\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 05:50:25 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751333AbdH3TuX (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 30 Aug 2017 15:50:23 -0400", "from mga11.intel.com ([192.55.52.93]:39852 \"EHLO mga11.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751110AbdH3TuW (ORCPT <rfc822;linux-ext4@vger.kernel.org>);\n\tWed, 30 Aug 2017 15:50:22 -0400", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t30 Aug 2017 12:50:22 -0700", "from dwillia2-desk3.jf.intel.com (HELO\n\tdwillia2-desk3.amr.corp.intel.com) ([10.54.39.125])\n\tby fmsmga005.fm.intel.com with ESMTP; 30 Aug 2017 12:50:22 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.41,449,1498546800\"; d=\"scan'208\";a=\"145790436\"", "Subject": "[PATCH v3 2/4] xfs: perform dax_device lookup at mount", "From": "Dan Williams <dan.j.williams@intel.com>", "To": "linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org", "Cc": "linux-nvdimm@lists.01.org, Christoph Hellwig <hch@lst.de>,\n\t\"Darrick J. Wong\" <darrick.wong@oracle.com>", "Date": "Wed, 30 Aug 2017 12:43:58 -0700", "Message-ID": "<150412223801.10177.4972035211701096310.stgit@dwillia2-desk3.amr.corp.intel.com>", "In-Reply-To": "<150412222686.10177.8031279869867070772.stgit@dwillia2-desk3.amr.corp.intel.com>", "References": "<150412222686.10177.8031279869867070772.stgit@dwillia2-desk3.amr.corp.intel.com>", "User-Agent": "StGit/0.17.1-9-g687f", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Sender": "linux-ext4-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-ext4.vger.kernel.org>", "X-Mailing-List": "linux-ext4@vger.kernel.org" }, "content": "The ->iomap_begin() operation is a hot path, so cache the\nfs_dax_get_by_host() result at mount time to avoid the incurring the\nhash lookup overhead on a per-i/o basis.\n\nCc: \"Darrick J. Wong\" <darrick.wong@oracle.com>\nReported-by: Christoph Hellwig <hch@lst.de>\nSigned-off-by: Dan Williams <dan.j.williams@intel.com>\n---\n fs/xfs/xfs_aops.c | 13 +++++++++++++\n fs/xfs/xfs_aops.h | 1 +\n fs/xfs/xfs_buf.c | 4 +++-\n fs/xfs/xfs_buf.h | 3 ++-\n fs/xfs/xfs_iomap.c | 10 +---------\n fs/xfs/xfs_super.c | 25 +++++++++++++++++++++----\n 6 files changed, 41 insertions(+), 15 deletions(-)", "diff": "diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c\nindex 6bf120bb1a17..78185f3b10b2 100644\n--- a/fs/xfs/xfs_aops.c\n+++ b/fs/xfs/xfs_aops.c\n@@ -80,6 +80,19 @@ xfs_find_bdev_for_inode(\n \t\treturn mp->m_ddev_targp->bt_bdev;\n }\n \n+struct dax_device *\n+xfs_find_daxdev_for_inode(\n+\tstruct inode\t\t*inode)\n+{\n+\tstruct xfs_inode\t*ip = XFS_I(inode);\n+\tstruct xfs_mount\t*mp = ip->i_mount;\n+\n+\tif (XFS_IS_REALTIME_INODE(ip))\n+\t\treturn mp->m_rtdev_targp->bt_daxdev;\n+\telse\n+\t\treturn mp->m_ddev_targp->bt_daxdev;\n+}\n+\n /*\n * We're now finished for good with this page. Update the page state via the\n * associated buffer_heads, paying attention to the start and end offsets that\ndiff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h\nindex cc174ec6c2fd..88c85ea63da0 100644\n--- a/fs/xfs/xfs_aops.h\n+++ b/fs/xfs/xfs_aops.h\n@@ -59,5 +59,6 @@ int\txfs_setfilesize(struct xfs_inode *ip, xfs_off_t offset, size_t size);\n \n extern void xfs_count_page_state(struct page *, int *, int *);\n extern struct block_device *xfs_find_bdev_for_inode(struct inode *);\n+extern struct dax_device *xfs_find_daxdev_for_inode(struct inode *);\n \n #endif /* __XFS_AOPS_H__ */\ndiff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c\nindex 72f038492ba8..6deb86c845d1 100644\n--- a/fs/xfs/xfs_buf.c\n+++ b/fs/xfs/xfs_buf.c\n@@ -1802,7 +1802,8 @@ xfs_setsize_buftarg_early(\n xfs_buftarg_t *\n xfs_alloc_buftarg(\n \tstruct xfs_mount\t*mp,\n-\tstruct block_device\t*bdev)\n+\tstruct block_device\t*bdev,\n+\tstruct dax_device\t*dax_dev)\n {\n \txfs_buftarg_t\t\t*btp;\n \n@@ -1811,6 +1812,7 @@ xfs_alloc_buftarg(\n \tbtp->bt_mount = mp;\n \tbtp->bt_dev = bdev->bd_dev;\n \tbtp->bt_bdev = bdev;\n+\tbtp->bt_daxdev = dax_dev;\n \n \tif (xfs_setsize_buftarg_early(btp, bdev))\n \t\tgoto error;\ndiff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h\nindex 20721261dae5..bf71507ddb16 100644\n--- a/fs/xfs/xfs_buf.h\n+++ b/fs/xfs/xfs_buf.h\n@@ -108,6 +108,7 @@ typedef unsigned int xfs_buf_flags_t;\n typedef struct xfs_buftarg {\n \tdev_t\t\t\tbt_dev;\n \tstruct block_device\t*bt_bdev;\n+\tstruct dax_device\t*bt_daxdev;\n \tstruct xfs_mount\t*bt_mount;\n \tunsigned int\t\tbt_meta_sectorsize;\n \tsize_t\t\t\tbt_meta_sectormask;\n@@ -385,7 +386,7 @@ xfs_buf_update_cksum(struct xfs_buf *bp, unsigned long cksum_offset)\n *\tHandling of buftargs.\n */\n extern xfs_buftarg_t *xfs_alloc_buftarg(struct xfs_mount *,\n-\t\t\tstruct block_device *);\n+\t\t\tstruct block_device *, struct dax_device *);\n extern void xfs_free_buftarg(struct xfs_mount *, struct xfs_buftarg *);\n extern void xfs_wait_buftarg(xfs_buftarg_t *);\n extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int);\ndiff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c\nindex 813394c62849..7c934e407332 100644\n--- a/fs/xfs/xfs_iomap.c\n+++ b/fs/xfs/xfs_iomap.c\n@@ -69,6 +69,7 @@ xfs_bmbt_to_iomap(\n \tiomap->offset = XFS_FSB_TO_B(mp, imap->br_startoff);\n \tiomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount);\n \tiomap->bdev = xfs_find_bdev_for_inode(VFS_I(ip));\n+\tiomap->dax_dev = xfs_find_daxdev_for_inode(VFS_I(ip));\n }\n \n xfs_extlen_t\n@@ -976,7 +977,6 @@ xfs_file_iomap_begin(\n \tint\t\t\tnimaps = 1, error = 0;\n \tbool\t\t\tshared = false, trimmed = false;\n \tunsigned\t\tlockmode;\n-\tstruct block_device\t*bdev;\n \n \tif (XFS_FORCED_SHUTDOWN(mp))\n \t\treturn -EIO;\n@@ -1087,13 +1087,6 @@ xfs_file_iomap_begin(\n \n \txfs_bmbt_to_iomap(ip, iomap, &imap);\n \n-\t/* optionally associate a dax device with the iomap bdev */\n-\tbdev = iomap->bdev;\n-\tif (blk_queue_dax(bdev->bd_queue))\n-\t\tiomap->dax_dev = fs_dax_get_by_host(bdev->bd_disk->disk_name);\n-\telse\n-\t\tiomap->dax_dev = NULL;\n-\n \tif (shared)\n \t\tiomap->flags |= IOMAP_F_SHARED;\n \treturn 0;\n@@ -1171,7 +1164,6 @@ xfs_file_iomap_end(\n \tunsigned\t\tflags,\n \tstruct iomap\t\t*iomap)\n {\n-\tfs_put_dax(iomap->dax_dev);\n \tif ((flags & IOMAP_WRITE) && iomap->type == IOMAP_DELALLOC)\n \t\treturn xfs_file_iomap_end_delalloc(XFS_I(inode), offset,\n \t\t\t\tlength, written, iomap);\ndiff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c\nindex 38aaacdbb8b3..ee4225c65f0c 100644\n--- a/fs/xfs/xfs_super.c\n+++ b/fs/xfs/xfs_super.c\n@@ -714,17 +714,26 @@ STATIC void\n xfs_close_devices(\n \tstruct xfs_mount\t*mp)\n {\n+\tstruct dax_device *dax_ddev = mp->m_ddev_targp->bt_daxdev;\n+\n \tif (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {\n \t\tstruct block_device *logdev = mp->m_logdev_targp->bt_bdev;\n+\t\tstruct dax_device *dax_logdev = mp->m_logdev_targp->bt_daxdev;\n+\n \t\txfs_free_buftarg(mp, mp->m_logdev_targp);\n \t\txfs_blkdev_put(logdev);\n+\t\tfs_put_dax(dax_logdev);\n \t}\n \tif (mp->m_rtdev_targp) {\n \t\tstruct block_device *rtdev = mp->m_rtdev_targp->bt_bdev;\n+\t\tstruct dax_device *dax_rtdev = mp->m_rtdev_targp->bt_daxdev;\n+\n \t\txfs_free_buftarg(mp, mp->m_rtdev_targp);\n \t\txfs_blkdev_put(rtdev);\n+\t\tfs_put_dax(dax_rtdev);\n \t}\n \txfs_free_buftarg(mp, mp->m_ddev_targp);\n+\tfs_put_dax(dax_ddev);\n }\n \n /*\n@@ -742,6 +751,8 @@ xfs_open_devices(\n \tstruct xfs_mount\t*mp)\n {\n \tstruct block_device\t*ddev = mp->m_super->s_bdev;\n+\tstruct dax_device\t*dax_ddev = fs_dax_get_by_bdev(ddev);\n+\tstruct dax_device\t*dax_logdev = NULL, *dax_rtdev = NULL;\n \tstruct block_device\t*logdev = NULL, *rtdev = NULL;\n \tint\t\t\terror;\n \n@@ -752,6 +763,7 @@ xfs_open_devices(\n \t\terror = xfs_blkdev_get(mp, mp->m_logname, &logdev);\n \t\tif (error)\n \t\t\tgoto out;\n+\t\tdax_logdev = fs_dax_get_by_bdev(logdev);\n \t}\n \n \tif (mp->m_rtname) {\n@@ -765,24 +777,25 @@ xfs_open_devices(\n \t\t\terror = -EINVAL;\n \t\t\tgoto out_close_rtdev;\n \t\t}\n+\t\tdax_rtdev = fs_dax_get_by_bdev(rtdev);\n \t}\n \n \t/*\n \t * Setup xfs_mount buffer target pointers\n \t */\n \terror = -ENOMEM;\n-\tmp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev);\n+\tmp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev, dax_ddev);\n \tif (!mp->m_ddev_targp)\n \t\tgoto out_close_rtdev;\n \n \tif (rtdev) {\n-\t\tmp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev);\n+\t\tmp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev, dax_rtdev);\n \t\tif (!mp->m_rtdev_targp)\n \t\t\tgoto out_free_ddev_targ;\n \t}\n \n \tif (logdev && logdev != ddev) {\n-\t\tmp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev);\n+\t\tmp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev, dax_logdev);\n \t\tif (!mp->m_logdev_targp)\n \t\t\tgoto out_free_rtdev_targ;\n \t} else {\n@@ -798,10 +811,14 @@ xfs_open_devices(\n \txfs_free_buftarg(mp, mp->m_ddev_targp);\n out_close_rtdev:\n \txfs_blkdev_put(rtdev);\n+\tfs_put_dax(dax_rtdev);\n out_close_logdev:\n-\tif (logdev && logdev != ddev)\n+\tif (logdev && logdev != ddev) {\n \t\txfs_blkdev_put(logdev);\n+\t\tfs_put_dax(dax_logdev);\n+\t}\n out:\n+\tfs_put_dax(dax_ddev);\n \treturn error;\n }\n \n", "prefixes": [ "v3", "2/4" ] }