From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752246AbcJCHyQ (ORCPT ); Mon, 3 Oct 2016 03:54:16 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34330 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639AbcJCHyJ (ORCPT ); Mon, 3 Oct 2016 03:54:09 -0400 Date: Mon, 3 Oct 2016 16:53:15 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Jan Kara , Andrew Morton , Tejun Heo , Calvin Owens , linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 6/7] printk: use alternative printk buffers Message-ID: <20161003075248.GA4652@swordfish> References: <20160927142237.5539-1-sergey.senozhatsky@gmail.com> <20160927142237.5539-7-sergey.senozhatsky@gmail.com> <20160929130000.GE26796@pathway.suse.cz> <20160930011544.GC547@swordfish> <20160930111546.GI26796@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160930111546.GI26796@pathway.suse.cz> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (09/30/16 13:15), Petr Mladek wrote: [..] > > and the decision was to keep `unsigned long flags' on stack in the > > alt_enter/exit caller. besides in most of the cases we already have > > it (in vprintk_emit() and console_unlock()). > > I would pass the pointer to flags as alt_enter() parameter. I think I'll do something like this -- void __alt_printk_enter(void); void __alt_printk_exit(void); #define alt_printk_enter(flags) \ do { \ local_irq_save(flags); \ __alt_printk_enter(); \ } while (0) #define alt_printk_exit(flags) \ do { \ __alt_printk_exit(); \ local_irq_restore(flags); \ } while (0) -- seems that this mostly will fit our needs in printk(). for anything that does not fit -- we have __alt_printk_enter()/exit(). and I'll also extend alt_printk more, some additional paths. I'm also thinking about your rename proposal, but didn't find a perfect name yet. -ss