From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754176AbbLJPUk (ORCPT ); Thu, 10 Dec 2015 10:20:40 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35667 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753798AbbLJPUj (ORCPT ); Thu, 10 Dec 2015 10:20:39 -0500 Date: Fri, 11 Dec 2015 00:19:06 +0900 From: Sergey Senozhatsky To: Jan Kara Cc: Andrew Morton , Petr Mladek , KY Srinivasan , Steven Rostedt , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: Re: [PATCH 6/7] printk: Avoid scheduling printing threads on the same CPU Message-ID: <20151210151906.GE540@swordfish> Reply-To: 1445835169-8203-7-git-send-email-jack@suse.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >+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