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 314162 Details for
Bug 438761
LTC:5.4:201049:DM-MP SCSI Hardware Handlers
[?]
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.
Add a workqueue to handle events
07-add-workqueue (text/plain), 4.07 KB, created by
IBM Bug Proxy
on 2008-08-13 00:51:43 UTC
(
hide
)
Description:
Add a workqueue to handle events
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2008-08-13 00:51:43 UTC
Size:
4.07 KB
patch
obsolete
>Subject: scsi_dh: Add a single threaded workqueue for initializing paths > >From: Chandra Seetharaman <sekharan@us.ibm.com> > >Before this patch set (SCSI hardware handlers), initialization of a >path was done asynchronously. Doing that requires a workqueue in each >device/hardware handler module and leads to unneccessary complication >in the device handler code, making it difficult to read the code and >follow the state diagram. > >Moving that workqueue to this level makes the device handler code simpler. >Hence, the workqueue is moved to dm level. > >A new workqueue is added instead of adding it to the existing workqueue >(kmpathd) for the following reasons: > 1. Device activation has to happen faster, stacking them along > with the other workqueue might lead to unnecessary delay > in the activation of the path. > 2. The effect could be felt the other way too. i.e the current > events that are handled by the existing workqueue might get > a delayed response. > >Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> >--- >Index: linux-2.6.18.ppc64/drivers/md/dm-mpath.c >=================================================================== >--- linux-2.6.18.ppc64.orig/drivers/md/dm-mpath.c >+++ linux-2.6.18.ppc64/drivers/md/dm-mpath.c >@@ -86,6 +86,7 @@ struct multipath { > unsigned queue_size; > > struct work_struct trigger_event; >+ struct work_struct activate_path; > > /* > * We must use a mempool of mpath_io structs so that we >@@ -108,11 +109,10 @@ typedef int (*action_fn) (struct pgpath > > static kmem_cache_t *_mpio_cache; > >-struct workqueue_struct *kmultipathd; >+struct workqueue_struct *kmultipathd, *kmpath_handlerd; > static void process_queued_ios(void *data); > static void trigger_event(void *data); >-static void pg_init_done(struct path *, int); >- >+static void activate_path(void *data); > > /*----------------------------------------------- > * Allocation routines >@@ -189,6 +189,7 @@ static struct multipath *alloc_multipath > m->queue_io = 1; > INIT_WORK(&m->process_queued_ios, process_queued_ios, m); > INIT_WORK(&m->trigger_event, trigger_event, m); >+ INIT_WORK(&m->activate_path, activate_path, m); > m->mpio_pool = mempool_create_slab_pool(MIN_IOS, _mpio_cache); > if (!m->mpio_pool) { > kfree(m); >@@ -443,12 +444,8 @@ out: > if (hwh->type) > hwh->type->pg_init(hwh, pgpath->pg->bypassed, > &pgpath->path); >- else { >- int ret; >- struct path *path = &pgpath->path; >- ret = scsi_dh_activate(bdev_get_queue(path->dev->bdev)); >- pg_init_done(path, ret); >- } >+ else >+ queue_work(kmpath_handlerd, &m->activate_path); > } > > if (!must_queue) >@@ -845,6 +842,7 @@ static void multipath_dtr(struct dm_targ > { > struct multipath *m = (struct multipath *) ti->private; > >+ flush_workqueue(kmpath_handlerd); > flush_workqueue(kmultipathd); > free_multipath(m); > } >@@ -1165,6 +1163,16 @@ static void pg_init_done(struct path *pa > spin_unlock_irqrestore(&m->lock, flags); > } > >+static void activate_path(void *data) >+{ >+ int ret; >+ struct multipath *m = (struct multipath *) data; >+ struct path *path = &m->current_pgpath->path; >+ >+ ret = scsi_dh_activate(bdev_get_queue(path->dev->bdev)); >+ pg_init_done(path, ret); >+} >+ > /* > * end_io handling > */ >@@ -1529,6 +1537,21 @@ static int __init dm_multipath_init(void > return -ENOMEM; > } > >+ /* >+ * A separate workqueue is used to handle the device handlers >+ * to avoid overloading existing workqueue. Overloading the >+ * old workqueue would also create a bottleneck in the >+ * path of the storage hardware device activation. >+ */ >+ kmpath_handlerd = create_singlethread_workqueue("kmpath_handlerd"); >+ if (!kmpath_handlerd) { >+ DMERR("failed to create workqueue kmpath_handlerd"); >+ destroy_workqueue(kmultipathd); >+ dm_unregister_target(&multipath_target); >+ kmem_cache_destroy(_mpio_cache); >+ return -ENOMEM; >+ } >+ > DMINFO("version %u.%u.%u loaded", > multipath_target.version[0], multipath_target.version[1], > multipath_target.version[2]); >@@ -1540,6 +1563,7 @@ static void __exit dm_multipath_exit(voi > { > int r; > >+ destroy_workqueue(kmpath_handlerd); > destroy_workqueue(kmultipathd); > > r = dm_unregister_target(&multipath_target);
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 Raw
Actions:
View
Attachments on
bug 438761
:
314153
|
314154
|
314155
|
314156
|
314157
|
314158
|
314159
|
314160
|
314161
| 314162 |
314163
|
314339
|
314426
|
314828
|
314829
|
316641