Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1288593 > unrolled thread

Re: [PATCH 6/7] printk: Avoid scheduling printing threads on the same CPU

Started bySergey Senozhatsky <sergey.senozhatsky@gmail.com>
First post2015-12-10 16:30 +0100
Last post2015-12-10 16:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  Re: [PATCH 6/7] printk: Avoid scheduling printing threads on the  same CPU Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-12-10 16:30 +0100

#1288593 — Re: [PATCH 6/7] printk: Avoid scheduling printing threads on the same CPU

FromSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Date2015-12-10 16:30 +0100
SubjectRe: [PATCH 6/7] printk: Avoid scheduling printing threads on the same CPU
Message-ID<qEbkl-7Z2-13@gated-at.bofh.it>
>+static void distribute_printing_kthreads(void)
>+{
>+	int i;
>+	unsigned int cpus_per_thread;
>+	unsigned int cpu, seen_cpu;
>+
>+	for (i = 0; i < PRINTING_TASKS; i++)
>+		cpumask_clear(printing_kthread_mask[i]);
>+
>+	cpus_per_thread = DIV_ROUND_UP(num_online_cpus(), PRINTING_TASKS);
>+	seen_cpu = 0;
>+	for_each_online_cpu(cpu) {
>+		cpumask_set_cpu(cpu,
>+			printing_kthread_mask[seen_cpu / cpus_per_thread]);
>+		seen_cpu++;
>+	}
>+
>+	for (i = 0; i < PRINTING_TASKS; i++)
>+		if (!cpumask_empty(printing_kthread_mask[i]))
>+			set_cpus_allowed_ptr(printing_kthread[i],
>+					     printing_kthread_mask[i]);
>+}


I certainly understand what are you trying to do here, but I'm a bit concerned.
This may result in 'bad' affinities on big.LITTLE platforms, for example. So I
think that printk is not quite good place for that type of decisions. Just my 5
cents.

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web