Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755736AbdIRKAJ (ORCPT ); Mon, 18 Sep 2017 06:00:09 -0400 Received: from smtprelay0064.hostedemail.com ([216.40.44.64]:59937 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752872AbdIRKAH (ORCPT ); Mon, 18 Sep 2017 06:00:07 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1981:2194:2197:2199:2200:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3867:3870:3871:3872:3873:4184:4321:4605:5007:6117:6119:6120:7875:7903:8603:10004:10400:10848:11026:11232:11473:11658:11914:12296:12438:12555:12663:12740:12760:12895:12986:13069:13095:13311:13357:13439:14096:14097:14180:14659:14721:21060:21080:21212:21221:21433:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: mark97_752678bd12140 X-Filterd-Recvd-Size: 3233 Message-ID: <1505728803.12022.8.camel@perches.com> Subject: Re: [RFC V2] printk: add warning while drop partial text in msg From: Joe Perches To: Sergey Senozhatsky , pierre kuo Cc: Petr Mladek , Sergey Senozhatsky , rostedt@goodmis.org, linux-kernel@vger.kernel.org Date: Mon, 18 Sep 2017 03:00:03 -0700 In-Reply-To: <20170918093905.GB1514@jagdpanzerIV.localdomain> References: <1501421870-12042-1-git-send-email-vichy.kuo@gmail.com> <20170801024303.GA469@jagdpanzerIV.localdomain> <20170817010541.GA20907@jagdpanzerIV.localdomain> <20170918093905.GB1514@jagdpanzerIV.localdomain> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1924 Lines: 37 On Mon, 2017-09-18 at 18:39 +0900, Sergey Senozhatsky wrote: > Hi, > > On (09/12/17 14:07), pierre kuo wrote: > [..] > > int per_cpu_thread_fn(void* data) > > { > > unsigned int index = 0; > > unsigned int len = 0; > > char* local_string = kzalloc(2048, GFP_KERNEL); > > > > do { > > len += sprintf((local_string + len), "this is the %d line\n", index++); > > }while(len < 576); > > printk_deferred("%s", local_string); > > return 0; > > } > > which is not a real world example, isn't it? > > printk_deferred("%s", local_string[2048]) makes no sense anyway, > since we limit the message size to 1024 - HEADER chars in > vprintk_emit() // see static char textbuf[LOG_LINE_MAX]. > > I'm not quite following what were you trying to prove, sorry. > does any function in the upstream kernel printk()-s buffers > larger than LOG_LINE_MAX? which one? > > > - the longest line in my dmesg output is 260 bytes in total (including timestamp) try a kernel with a few modules loaded For instance: $ dmesg | awk '{ print length($0), $0 }'|sort -rn | head -1 827 [337318.968616] Modules linked in: snd_usb_audio snd_usbmidi_lib ccm rfcomm bnep snd_hda_codec_hdmi dell_led snd_hda_codec_realtek snd_hda_codec_generic hid_multitouch binfmt_misc nls_iso8859_1 arc4 i2c_designware_platform i2c_designware_core dell_wmi snd_soc_skl snd_soc_skl_ipc snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core snd_soc_sst_match snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel dell_laptop intel_rapl snd_hda_codec dell_smbios dcdbas x86_pkg_temp_thermal snd_hda_core intel_powerclamp snd_hwdep coretemp kvm_intel snd_pcm kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel iwlmvm pcbc mac80211 snd_seq_midi snd_seq_midi_event aesni_intel aes_x86_64 crypto_simd snd_rawmidi glue_helper cryptd intel_cstate intel_rapl_perf snd_seq iwlwifi snd_seq_device uvcvideo videobuf2_vmalloc