The patch titled knfsd: use svc_set_num_threads to manage threads in knfsd has been added to the -mm tree. Its filename is knfsd-use-svc_set_num_threads-to-manage-threads-in-knfsd.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: knfsd: use svc_set_num_threads to manage threads in knfsd From: Greg Banks <gnb@xxxxxxxxxxxxxxxxx> Replace the existing list of all nfsd threads with new code using svc_create_pooled(). Signed-off-by: Greg Banks <gnb@xxxxxxxxxxxxxxxxx> Signed-off-by: Neil Brown <neilb@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/nfsd/nfssvc.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff -puN fs/nfsd/nfssvc.c~knfsd-use-svc_set_num_threads-to-manage-threads-in-knfsd fs/nfsd/nfssvc.c --- a/fs/nfsd/nfssvc.c~knfsd-use-svc_set_num_threads-to-manage-threads-in-knfsd +++ a/fs/nfsd/nfssvc.c @@ -57,12 +57,6 @@ static atomic_t nfsd_busy; static unsigned long nfsd_last_call; static DEFINE_SPINLOCK(nfsd_call_lock); -struct nfsd_list { - struct list_head list; - struct task_struct *task; -}; -static struct list_head nfsd_list = LIST_HEAD_INIT(nfsd_list); - #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) static struct svc_stat nfsd_acl_svcstats; static struct svc_version * nfsd_acl_version[] = { @@ -206,8 +200,9 @@ int nfsd_create_serv(void) } atomic_set(&nfsd_busy, 0); - nfsd_serv = svc_create(&nfsd_program, NFSD_BUFSIZE, - nfsd_last_thread); + nfsd_serv = svc_create_pooled(&nfsd_program, NFSD_BUFSIZE, + nfsd_last_thread, + nfsd, SIG_NOCLEAN, THIS_MODULE); if (nfsd_serv == NULL) err = -ENOMEM; unlock_kernel(); @@ -247,7 +242,6 @@ int nfsd_svc(unsigned short port, int nrservs) { int error; - struct list_head *victim; lock_kernel(); dprintk("nfsd: creating service\n"); @@ -275,24 +269,7 @@ nfsd_svc(unsigned short port, int nrserv if (error) goto failure; - nrservs -= (nfsd_serv->sv_nrthreads-1); - while (nrservs > 0) { - nrservs--; - __module_get(THIS_MODULE); - error = svc_create_thread(nfsd, nfsd_serv); - if (error < 0) { - module_put(THIS_MODULE); - break; - } - } - victim = nfsd_list.next; - while (nrservs < 0 && victim != &nfsd_list) { - struct nfsd_list *nl = - list_entry(victim,struct nfsd_list, list); - victim = victim->next; - send_sig(SIG_NOCLEAN, nl->task, 1); - nrservs++; - } + error = svc_set_num_threads(nfsd_serv, NULL, nrservs); failure: svc_destroy(nfsd_serv); /* Release server */ out: @@ -329,7 +306,6 @@ nfsd(struct svc_rqst *rqstp) { struct fs_struct *fsp; int err; - struct nfsd_list me; sigset_t shutdown_mask, allowed_mask; /* Lock module and set up kernel thread */ @@ -353,8 +329,7 @@ nfsd(struct svc_rqst *rqstp) nfsdstats.th_cnt++; - me.task = current; - list_add(&me.list, &nfsd_list); + rqstp->rq_task = current; unlock_kernel(); @@ -413,7 +388,6 @@ nfsd(struct svc_rqst *rqstp) lock_kernel(); - list_del(&me.list); nfsdstats.th_cnt --; out: _ Patches currently in -mm which might be from gnb@xxxxxxxxxxxxxxxxx are knfsd-knfsd-add-some-missing-newlines-in-printks.patch knfsd-knfsd-remove-an-unused-variable-from-e_show.patch knfsd-knfsd-remove-an-unused-variable-from-auth_unix_lookup.patch knfsd-use-seq_start_token-instead-of-hardcoded-magic-void1.patch knfsd-move-tempsock-aging-to-a-timer.patch knfsd-move-tempsock-aging-to-a-timer-tidy.patch knfsd-convert-sk_inuse-to-atomic_t.patch knfsd-use-new-lock-for-svc_sock-deferred-list.patch knfsd-convert-sk_reserved-to-atomic_t.patch knfsd-test-and-set-sk_busy-atomically.patch knfsd-split-svc_serv-into-pools.patch knfsd-add-svc_get.patch knfsd-add-svc_set_num_threads.patch knfsd-use-svc_set_num_threads-to-manage-threads-in-knfsd.patch knfsd-make-rpc-threads-pools-numa-aware.patch knfsd-allow-admin-to-set-nthreads-per-node.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html