Thread (2 messages) 2 messages, 2 authors, 2012-11-30

Re: [patch] bdi: add a user-tunable cpu_list for the bdi flusher threads

From: Zach Brown <hidden>
Date: 2012-11-30 22:15:47
Also in: lkml

+	ret = cpulist_parse(buf, newmask);
+	if (!ret) {
+		spin_lock(&bdi->wb_lock);
+		task = wb->task;
+		get_task_struct(task);
+		spin_unlock(&bdi->wb_lock);
+		if (task)
+			ret = set_cpus_allowed_ptr(task, newmask);
+		put_task_struct(task);
If that test for a non-null task is needed then surely the get and put
need to be similarly protected :).
+		bdi->flusher_cpumask = kmalloc(sizeof(cpumask_t), GFP_KERNEL);
+		if (!bdi->flusher_cpumask)
+			return -ENOMEM;
The bare GFP_KERNEL raises an eyebrow.  Some bdi_init() callers like
blk_alloc_queue_node() look like they'll want to pass in a gfp_t for the
allocation.

And shouldn't this be freed in the error path of bdi_init()?

- z

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help