Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 293929 Details for
Bug 250104
RHEL5 Kernel patches for blktap statistics
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch 4 for blktap statistics
linux-2.6.18-xen-blktap-stats-14040-4.patch (text/plain), 7.45 KB, created by
Chris Lalancette
on 2008-02-04 20:01:13 UTC
(
hide
)
Description:
Patch 4 for blktap statistics
Filename:
MIME Type:
Creator:
Chris Lalancette
Created:
2008-02-04 20:01:13 UTC
Size:
7.45 KB
patch
obsolete
>diff -urp linux-2.6.18.noarch.13325/drivers/xen/blkback/blkback.c linux-2.6.18.noarch.14040/drivers/xen/blkback/blkback.c >--- linux-2.6.18.noarch.13325/drivers/xen/blkback/blkback.c 2008-02-04 14:04:51.000000000 -0500 >+++ linux-2.6.18.noarch.14040/drivers/xen/blkback/blkback.c 2008-02-04 14:07:50.000000000 -0500 >@@ -492,6 +492,12 @@ static void dispatch_rw_block_io(blkif_t > for (i = 0; i < nbio; i++) > submit_bio(operation, biolist[i]); > >+ if (operation == READ) { >+ blkif->st_rd_sect += preq.nr_sects; >+ } else if (operation == WRITE) { >+ blkif->st_wr_sect += preq.nr_sects; >+ } >+ > return; > > fail_put_bio: >diff -urp linux-2.6.18.noarch.13325/drivers/xen/blkback/common.h linux-2.6.18.noarch.14040/drivers/xen/blkback/common.h >--- linux-2.6.18.noarch.13325/drivers/xen/blkback/common.h 2008-02-04 14:04:51.000000000 -0500 >+++ linux-2.6.18.noarch.14040/drivers/xen/blkback/common.h 2008-02-04 14:07:50.000000000 -0500 >@@ -88,6 +88,8 @@ typedef struct blkif_st { > int st_wr_req; > int st_oo_req; > int st_br_req; >+ int st_rd_sect; >+ int st_wr_sect; > > wait_queue_head_t waiting_to_free; > >diff -urp linux-2.6.18.noarch.13325/drivers/xen/blkback/xenbus.c linux-2.6.18.noarch.14040/drivers/xen/blkback/xenbus.c >--- linux-2.6.18.noarch.13325/drivers/xen/blkback/xenbus.c 2008-02-04 14:07:03.000000000 -0500 >+++ linux-2.6.18.noarch.14040/drivers/xen/blkback/xenbus.c 2008-02-04 14:07:50.000000000 -0500 >@@ -111,16 +111,20 @@ static void update_blkif_status(blkif_t > } \ > DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) > >-VBD_SHOW(oo_req, "%d\n", be->blkif->st_oo_req); >-VBD_SHOW(rd_req, "%d\n", be->blkif->st_rd_req); >-VBD_SHOW(wr_req, "%d\n", be->blkif->st_wr_req); >-VBD_SHOW(br_req, "%d\n", be->blkif->st_br_req); >+VBD_SHOW(oo_req, "%d\n", be->blkif->st_oo_req); >+VBD_SHOW(rd_req, "%d\n", be->blkif->st_rd_req); >+VBD_SHOW(wr_req, "%d\n", be->blkif->st_wr_req); >+VBD_SHOW(br_req, "%d\n", be->blkif->st_br_req); >+VBD_SHOW(rd_sect, "%d\n", be->blkif->st_rd_sect); >+VBD_SHOW(wr_sect, "%d\n", be->blkif->st_wr_sect); > > static struct attribute *vbdstat_attrs[] = { > &dev_attr_oo_req.attr, > &dev_attr_rd_req.attr, > &dev_attr_wr_req.attr, > &dev_attr_br_req.attr, >+ &dev_attr_rd_sect.attr, >+ &dev_attr_wr_sect.attr, > NULL > }; > >diff -urp linux-2.6.18.noarch.13325/drivers/xen/blktap/blktapmain.c linux-2.6.18.noarch.14040/drivers/xen/blktap/blktapmain.c >--- linux-2.6.18.noarch.13325/drivers/xen/blktap/blktapmain.c 2008-02-04 11:18:16.000000000 -0500 >+++ linux-2.6.18.noarch.14040/drivers/xen/blktap/blktapmain.c 2008-02-04 14:08:24.000000000 -0500 >@@ -1151,7 +1151,7 @@ static void dispatch_rw_block_io(blkif_t > int op, operation = (req->operation == BLKIF_OP_WRITE) ? WRITE : READ; > struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST*2]; > unsigned int nseg; >- int ret, i; >+ int ret, i, nr_sects = 0; > tap_blkif_t *info = tapfds[blkif->dev_num]; > > blkif_request_t *target; >@@ -1226,6 +1226,9 @@ static void dispatch_rw_block_io(blkif_t > req->seg[i].gref, blkif->domid); > op++; > } >+ >+ nr_sects += (req->seg[i].last_sect - >+ req->seg[i].first_sect + 1); > } > > ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, map, op); >@@ -1347,6 +1350,13 @@ static void dispatch_rw_block_io(blkif_t > target->id = usr_idx; > wmb(); /* blktap_poll() reads req_prod_pvt asynchronously */ > info->ufe_ring.req_prod_pvt++; >+ >+ if (operation == READ) { >+ blkif->st_rd_sect += nr_sects; >+ } else if (operation == WRITE) { >+ blkif->st_wr_sect += nr_sects; >+ } >+ > return; > > fail_flush: >diff -urp linux-2.6.18.noarch.13325/drivers/xen/blktap/common.h linux-2.6.18.noarch.14040/drivers/xen/blktap/common.h >--- linux-2.6.18.noarch.13325/drivers/xen/blktap/common.h 2008-02-04 11:18:10.000000000 -0500 >+++ linux-2.6.18.noarch.14040/drivers/xen/blktap/common.h 2008-02-04 14:07:50.000000000 -0500 >@@ -76,6 +76,8 @@ typedef struct blkif_st { > int st_rd_req; > int st_wr_req; > int st_oo_req; >+ int st_rd_sect; >+ int st_wr_sect; > > wait_queue_head_t waiting_to_free; > >diff -urp linux-2.6.18.noarch.13325/drivers/xen/blktap/xenbus.c linux-2.6.18.noarch.14040/drivers/xen/blktap/xenbus.c >--- linux-2.6.18.noarch.13325/drivers/xen/blktap/xenbus.c 2008-02-04 14:07:03.000000000 -0500 >+++ linux-2.6.18.noarch.14040/drivers/xen/blktap/xenbus.c 2008-02-04 14:07:50.000000000 -0500 >@@ -112,6 +112,74 @@ static int blktap_name(blkif_t *blkif, c > return 0; > } > >+/**************************************************************** >+ * sysfs interface for VBD I/O requests >+ */ >+ >+#define VBD_SHOW(name, format, args...) \ >+ static ssize_t show_##name(struct device *_dev, \ >+ struct device_attribute *attr, \ >+ char *buf) \ >+ { \ >+ struct xenbus_device *dev = to_xenbus_device(_dev); \ >+ struct backend_info *be = dev->dev.driver_data; \ >+ \ >+ return sprintf(buf, format, ##args); \ >+ } \ >+ DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) >+ >+VBD_SHOW(tap_oo_req, "%d\n", be->blkif->st_oo_req); >+VBD_SHOW(tap_rd_req, "%d\n", be->blkif->st_rd_req); >+VBD_SHOW(tap_wr_req, "%d\n", be->blkif->st_wr_req); >+VBD_SHOW(tap_rd_sect, "%d\n", be->blkif->st_rd_sect); >+VBD_SHOW(tap_wr_sect, "%d\n", be->blkif->st_wr_sect); >+ >+static struct attribute *tapstat_attrs[] = { >+ &dev_attr_tap_oo_req.attr, >+ &dev_attr_tap_rd_req.attr, >+ &dev_attr_tap_wr_req.attr, >+ &dev_attr_tap_rd_sect.attr, >+ &dev_attr_tap_wr_sect.attr, >+ NULL >+}; >+ >+static struct attribute_group tapstat_group = { >+ .name = "statistics", >+ .attrs = tapstat_attrs, >+}; >+ >+int xentap_sysfs_addif(struct xenbus_device *dev) >+{ >+ return sysfs_create_group(&dev->dev.kobj, &tapstat_group); >+} >+ >+void xentap_sysfs_delif(struct xenbus_device *dev) >+{ >+ sysfs_remove_group(&dev->dev.kobj, &tapstat_group); >+} >+ >+static int blktap_remove(struct xenbus_device *dev) >+{ >+ struct backend_info *be = dev->dev.driver_data; >+ >+ if (be->backend_watch.node) { >+ unregister_xenbus_watch(&be->backend_watch); >+ kfree(be->backend_watch.node); >+ be->backend_watch.node = NULL; >+ } >+ if (be->blkif) { >+ if (be->blkif->xenblkd) >+ kthread_stop(be->blkif->xenblkd); >+ signal_tapdisk(be->blkif->dev_num); >+ tap_blkif_free(be->blkif); >+ be->blkif = NULL; >+ } >+ xentap_sysfs_delif(be->dev); >+ kfree(be); >+ dev->dev.driver_data = NULL; >+ return 0; >+} >+ > static void tap_update_blkif_status(blkif_t *blkif) > { > int err; >@@ -137,6 +205,13 @@ static void tap_update_blkif_status(blki > return; > } > >+ err = xentap_sysfs_addif(blkif->be->dev); >+ if (err) { >+ xenbus_dev_fatal(blkif->be->dev, err, >+ "creating sysfs entries"); >+ return; >+ } >+ > blkif->xenblkd = kthread_run(tap_blkif_schedule, blkif, name); > if (IS_ERR(blkif->xenblkd)) { > err = PTR_ERR(blkif->xenblkd); >@@ -146,27 +221,6 @@ static void tap_update_blkif_status(blki > } > } > >-static int blktap_remove(struct xenbus_device *dev) >-{ >- struct backend_info *be = dev->dev.driver_data; >- >- if (be->backend_watch.node) { >- unregister_xenbus_watch(&be->backend_watch); >- kfree(be->backend_watch.node); >- be->backend_watch.node = NULL; >- } >- if (be->blkif) { >- if (be->blkif->xenblkd) >- kthread_stop(be->blkif->xenblkd); >- signal_tapdisk(be->blkif->dev_num); >- tap_blkif_free(be->blkif); >- be->blkif = NULL; >- } >- kfree(be); >- dev->dev.driver_data = NULL; >- return 0; >-} >- > /** > * Entry point to this code when a new device is created. Allocate > * the basic structures, and watch the store waiting for the
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 250104
:
293926
|
293927
|
293928
|
293929
|
293930
|
293931
|
293932
|
293933
|
293934
|
312441
|
312442
|
312443
|
312444
|
312445
|
312446
|
312447