From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751751AbdBYJTN (ORCPT ); Sat, 25 Feb 2017 04:19:13 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:33296 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751588AbdBYJTL (ORCPT ); Sat, 25 Feb 2017 04:19:11 -0500 Date: Sat, 25 Feb 2017 10:18:23 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: Thomas Gleixner , "H. Peter Anvin" , linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, arjan@linux.intel.com, bp@alien8.de, jpoimboe@redhat.com, richard.weinberger@gmail.com Subject: Re: [RFC][PATCH] bug: Add _ONCE logic to report_bug() Message-ID: <20170225091823.GB24922@gmail.com> References: <20170223132813.GB6515@twins.programming.kicks-ass.net> <20170224111652.GY6536@twins.programming.kicks-ass.net> <20170225081939.GZ6536@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170225081939.GZ6536@twins.programming.kicks-ass.net> 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 * Peter Zijlstra wrote: > > Josh suggested moving the _ONCE logic inside the trap handler, using a > bit in the bug_entry::flags field, avoiding the need for the extra > variable. This looks interesting, as the _ONCE() methods of warning are far more user-friendly than WARN() spam. > Sadly this only works for WARN_ON_ONCE(), since the others have > printk() statements prior to triggering the trap. Which one is problematic to convert, WARN_ONCE()? > Still, this saves some text and data: > > text data bss dec hex filename > 10469505 4443448 843776 15756729 f06db9 defconfig-build/vmlinux-ud0 > 10452803 4442616 843776 15739195 f0293b defconfig-build/vmlinux-ud0-once > > (Only compile tested on x86_64 so far.) That looks pretty sweet, as various almost never triggered _ONCE() checks tend to disturb the generated machine code quite a bit ... Thanks, Ingo