From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754334AbcCWIko (ORCPT ); Wed, 23 Mar 2016 04:40:44 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:33727 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753557AbcCWIkk (ORCPT ); Wed, 23 Mar 2016 04:40:40 -0400 Date: Wed, 23 Mar 2016 17:42:04 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Andrew Morton , Jan Kara , Tejun Heo , Tetsuo Handa , linux-kernel@vger.kernel.org, Byungchul Park , Jan Kara Subject: Re: [RFC][PATCH v6 1/2] printk: Make printk() completely async Message-ID: <20160323084204.GD512@swordfish> References: <1458581130-8677-1-git-send-email-sergey.senozhatsky@gmail.com> <1458581130-8677-2-git-send-email-sergey.senozhatsky@gmail.com> <20160322131106.GA5522@pathway.suse.cz> <20160323003725.GA641@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160323003725.GA641@swordfish> 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 On (03/23/16 09:37), Sergey Senozhatsky wrote: [..] > ok, I'll take a look. > > eventually (after 0003) vprintk_emit() is > > if (in_sched) { > __this_cpu_or(printk_pending, > PRINTK_PENDING_OUTPUT); > irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); > } > local_irq_restore(flags); > if (!in_sched) { > lockdep_off(); > if (console_trylock()) > console_unlock(); > lockdep_on(); > } > > > I do not say that it is a "dream-of-like" code. One important thing for > > me is that it does not use "sync_printk" variable. > > > > You original code modified "sync_printk" according to "in_sched" and > > "in_panic" variables earlier in vprintk_emit. Then it again checked > > all three variables here which produced strange twists in my head ;-) > hm... may be we can do even better. move printk_pending and irq_work_queue() back to printk_deferred() and do the preemption magic there. so vprintk_emit() can be lighter. will take a look later today. -ss