Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755678Ab2JJVGZ (ORCPT ); Wed, 10 Oct 2012 17:06:25 -0400 Received: from twin.jikos.cz ([89.185.236.188]:50326 "EHLO twin.jikos.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031Ab2JJVGW (ORCPT ); Wed, 10 Oct 2012 17:06:22 -0400 Date: Wed, 10 Oct 2012 23:05:55 +0200 From: David Sterba To: zwu.kernel@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linuxram@linux.vnet.ibm.com, viro@zeniv.linux.org.uk, david@fromorbit.com, dave@jikos.cz, tytso@mit.edu, cmm@us.ibm.com, Zhi Yong Wu Subject: Re: [RFC v3 12/13] vfs: add debugfs support Message-ID: <20121010210555.GB4405@twin.jikos.cz> Reply-To: dave@jikos.cz Mail-Followup-To: zwu.kernel@gmail.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linuxram@linux.vnet.ibm.com, viro@zeniv.linux.org.uk, david@fromorbit.com, dave@jikos.cz, tytso@mit.edu, cmm@us.ibm.com, Zhi Yong Wu References: <1349863655-29320-1-git-send-email-zwu.kernel@gmail.com> <1349863655-29320-13-git-send-email-zwu.kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1349863655-29320-13-git-send-email-zwu.kernel@gmail.com> User-Agent: Mutt/1.5.21 (2011-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2888 Lines: 58 On Wed, Oct 10, 2012 at 06:07:34PM +0800, zwu.kernel@gmail.com wrote: > +static int hot_debugfs_copy(struct debugfs_vol_data *data, char *msg, int len) > +{ > + struct lstring *debugfs_log = data->debugfs_log; > + uint new_log_alloc_size; > + char *new_log; > + static char err_msg[] = "No more memory!\n"; > + > + if (len >= data->log_alloc_size - debugfs_log->len) { > + /* > + * Not enough room in the log buffer for the new message. > + * Allocate a bigger buffer. > + */ > + new_log_alloc_size = data->log_alloc_size + LOG_PAGE_SIZE; > + new_log = vmalloc(new_log_alloc_size); This is also called with a spinlock from hot_debugfs_log, and it is a frequent call. I found my testbox inaccessible after an hour of md5sums on a partition when I tried to print contents of the /sys/debug files. Serial console log filled with [ 4886.141736] BUG: scheduling while atomic: mc/3176/0x00000004 [ 4886.148443] INFO: lockdep is turned off. [ 4886.153424] Modules linked in: aoe dm_crypt loop btrfs [ 4886.159705] Pid: 3176, comm: mc Tainted: G W 3.6.0hottrack-default+ #209 [ 4886.168346] Call Trace: [ 4886.171842] [] __schedule_bug+0x68/0x90 [ 4886.178427] [] __schedule+0x73c/0x810 [ 4886.184809] [] schedule+0x29/0x70 [ 4886.190838] [] schedule_timeout+0x17c/0x2f0 [ 4886.197732] [] ? del_timer+0x100/0x100 [ 4886.204198] [] ? _raw_spin_unlock+0x2b/0x50 [ 4886.211099] [] schedule_timeout_uninterruptible+0x1e/0x20 [ 4886.219211] [] __alloc_pages_nodemask+0x839/0x9f0 [ 4886.226624] [] __vmalloc_node_range+0xf3/0x200 [ 4886.233788] [] ? hot_debugfs_copy+0x59/0x130 [ 4886.240774] [] __vmalloc_node+0x35/0x40 [ 4886.247335] [] ? hot_debugfs_copy+0x59/0x130 [ 4886.254331] [] vmalloc+0x2c/0x30 [ 4886.260299] [] hot_debugfs_copy+0x59/0x130 [ 4886.267130] [] hot_debugfs_log+0x96/0xe0 [ 4886.273772] [] __hot_debugfs_print_inode_freq_data+0x5f/0x80 [ 4886.282149] [] __hot_debugfs_comm_read+0x14c/0x280 [ 4886.289653] [] ? hot_debugfs_log+0xe0/0xe0 [ 4886.296461] [] __hot_debugfs_inode_read+0x15/0x20 [ 4886.303853] [] vfs_read+0xcb/0x190 [ 4886.309934] [] sys_read+0x62/0xb0 [ 4886.315927] [] ? trace_hardirqs_on_thunk+0x3a/0x3f [ 4886.323399] [] system_call_fastpath+0x16/0x1b david -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/