From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752210AbdF3MMV (ORCPT ); Fri, 30 Jun 2017 08:12:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:54095 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752052AbdF3ML2 (ORCPT ); Fri, 30 Jun 2017 08:11:28 -0400 Date: Fri, 30 Jun 2017 14:11:24 +0200 From: Petr Mladek To: Sergey Senozhatsky Cc: Steven Rostedt , Sergey Senozhatsky , Jan Kara , Andrew Morton , Peter Zijlstra , "Rafael J . Wysocki" , Eric Biederman , Greg Kroah-Hartman , Jiri Slaby , Pavel Machek , Andreas Mohr , Tetsuo Handa , linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCHv4 0/7] printk: introduce printing kernel threads Message-ID: <20170630121124.GF23069@pathway.suse.cz> References: <20170602090345.624-1-sergey.senozhatsky@gmail.com> <20170608081829.GA442@jagdpanzerIV.localdomain> <20170628134251.GQ1538@pathway.suse.cz> <20170629075630.GB14897@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170629075630.GB14897@jagdpanzerIV.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2017-06-29 16:56:30, Sergey Senozhatsky wrote: > yeah, I agree and understand that per-CPU printk kthreads > is a bit... too much. > > it was just a quick idea and I just gave it a try. but there > are some potential takeaways from the series (not sure if you > looked at the last patches of the series). > > with per-CPU kthreads we easily > > 1) can be quite flexible > there can be only certain CPUs that will take over printing duty. > so if you system has, say, IRQ affinity set up or anything else > that is critical, you can forbid printk offloading to those CPUs. > so "important" CPUs will not print out more than atomic_limit chars, > the rest of the job will be handled by "less important" CPUs. > > * this can be achieved with a single printk kthread. > but still, that's something I haven't thought about before this > series. Sounds interesting. Well, I would prefer to leave this for further optimization. It is a completely new area and it might open another can of worms. > 2) can offload printing to other CPUs from vprintk_emit() > and avoid any of scheduler->timekeeping->etc. paths. which will > replace printk_deferred(). I probably miss something. There is still called wake_up_process() in this patchset and we could not do this in some scheduler and timekeeping paths. Also we must not take the console_lock() in these paths because it calls wake_up_process() as well. But we want to flush few lines when possible. Best Regards, Petr