~ubuntu-branches/ubuntu/wily/spl-linux/wily-proposed

« back to all changes in this revision

Viewing changes to module/spl/spl-taskq.c

  • Committer: Package Import Robot
  • Author(s): Liang Guo
  • Date: 2014-07-31 15:16:53 UTC
  • Revision ID: package-import@ubuntu.com-20140731151653-tgao12alohj26jcs
Tags: upstream-0.6.3+git20140731
ImportĀ upstreamĀ versionĀ 0.6.3+git20140731

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
#define SS_DEBUG_SUBSYS SS_TASKQ
36
36
 
 
37
int spl_taskq_thread_bind = 0;
 
38
module_param(spl_taskq_thread_bind, int, 0644);
 
39
MODULE_PARM_DESC(spl_taskq_thread_bind, "Bind taskq thread to CPU by default");
 
40
 
37
41
/* Global system-wide dynamic task queue available for all consumers */
38
42
taskq_t *system_taskq;
39
43
EXPORT_SYMBOL(system_taskq);
781
785
taskq_create(const char *name, int nthreads, pri_t pri,
782
786
    int minalloc, int maxalloc, uint_t flags)
783
787
{
 
788
        static int last_used_cpu = 0;
784
789
        taskq_t *tq;
785
790
        taskq_thread_t *tqt;
786
791
        int rc = 0, i, j = 0;
839
844
                tqt->tqt_tq = tq;
840
845
                tqt->tqt_id = 0;
841
846
 
842
 
                tqt->tqt_thread = kthread_create(taskq_thread, tqt,
 
847
                tqt->tqt_thread = spl_kthread_create(taskq_thread, tqt,
843
848
                    "%s/%d", name, i);
844
849
                if (tqt->tqt_thread) {
845
850
                        list_add(&tqt->tqt_thread_list, &tq->tq_thread_list);
846
 
                        kthread_bind(tqt->tqt_thread, i % num_online_cpus());
 
851
                        if (spl_taskq_thread_bind) {
 
852
                                last_used_cpu = (last_used_cpu + 1) % num_online_cpus();
 
853
                                kthread_bind(tqt->tqt_thread, last_used_cpu);
 
854
                        }
847
855
                        set_user_nice(tqt->tqt_thread, PRIO_TO_NICE(pri));
848
856
                        wake_up_process(tqt->tqt_thread);
849
857
                        j++;