All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg KH <gregkh@suse.de>, Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-kernel@vger.kernel.org
Subject: Re: [GIT PATCH] TTY patches for 2.6.33-git
Date: Wed, 16 Dec 2009 09:15:45 +0000	[thread overview]
Message-ID: <200912160915.45606.arnd@arndb.de> (raw)
In-Reply-To: <20091213213015.653307b5@infradead.org>

On Monday 14 December 2009 05:30:15 Arjan van de Ven wrote:
> On Sun, 13 Dec 2009 20:16:08 +0100 Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
> > We have the bkl tracepoints for that, attaching an example below,
> > blkdev_get/bkldev_put is among the highest consumer for me.
> 
> we have a trace, but not a number that anyone can just pull out without
> having to go through great lengths to set stuff up... (esp to capture a
> boot)...
> Adding a counter always to the lock_kernel function should be fine
> instead...

FWIW, I've hacked up some debugging logic in lib/kernel_lock.c to count
and measure the BKL. If anyone is interested in this, I can bring the
patch into a form that is usable. The output for a boot followed by
building a kernel on a four-way box with today's git looks like:

fs/ioctl.c:51 vfs_ioctl,5672809,0,9,108968293432,40528
drivers/char/vt_ioctl.c:512 vt_ioctl,15615,0,45,7967944,16400928
fs/locks.c:826 __posix_lock_file,1272,0,57,2815752,2013920
sound/core/sound.c:175 snd_open,1201,0,0,3863432,0
fs/block_dev.c:1192 __blkdev_get,479,26,14,39860472,686636416
drivers/usb/core/devio.c:656 usbdev_open,240,0,0,1640792,0
drivers/usb/core/devio.c:1868 usbdev_ioctl,240,0,0,369368,0
fs/read_write.c:110 default_llseek,185,0,5,88048,669224
drivers/char/tty_io.c:1761 tty_open,136,0,11,2878344,249472048
fs/block_dev.c:1358 __blkdev_put,117,1,1,10654208,3840
drivers/char/tty_io.c:1882 tty_open,106,0,5,44344,32056
drivers/char/tty_io.c:1603 tty_release,99,0,3,363496,8192
drivers/char/tty_io.c:1513 tty_release,99,0,3,639200,104312
kernel/ptrace.c:610 sys_ptrace,98,0,0,588432,0
block/ioctl.c:171 __blkdev_driver_ioctl,40,0,4,2960544,69288
fs/locks.c:1188 __break_lease,25,0,0,14960,0
fs/namespace.c:1650 do_new_mount,14,1,0,403088,0
fs/locks.c:733 flock_lock_file,14,0,0,33072,0
fs/locks.c:2022 locks_remove_flock,9,0,0,17160,0
drivers/char/pty.c:673 ptmx_open,8,0,0,406200,0
drivers/input/input.c:1767 input_open_file,7,0,0,83776,0
drivers/char/tty_io.c:717 disassociate_ctty,5,0,1,2376,322352
lib/kernel_lock.c:236 stat_read,3,0,0,590328,0
kernel/trace/trace.c:721 register_tracer,3,0,1,2420999112,17296
fs/locks.c:647 posix_test_lock,3,0,0,6920,0
drivers/gpu/drm/drm_fops.c:176 drm_stub_open,2,0,0,16712,0
init/main.c:849 kernel_init,1,0,0,334951112,0
init/main.c:546 start_kernel,1,0,0,873891904,0
fs/ext3/super.c:2548 ext3_remount,1,0,0,86592,0
fs/ext3/super.c:2036 ext3_fill_super,1,1,0,2656,0
drivers/gpu/drm/drm_fops.c:473 drm_release,1,0,0,6360,0
block/ioctl.c:316 blkdev_ioctl,1,0,1,848,32352

The comma-separated fields are
1. caller location
2. number of lock_kernel() calls
3. number of times it was called with BKL held already
4. number of times it blocked
5. total time it was held in get_cycles() units, not counting
   time spent during release-on-sleep
6. total time that this lock_kernel() was blocked by another
   thread holding the BKL.

It would be easy to add some recording of who is nesting
or blocking whom, or which ones call a function that might_sleep().

	Arnd

  parent reply	other threads:[~2009-12-16  9:16 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-11 23:28 [GIT PATCH] TTY patches for 2.6.33-git Greg KH
2009-12-11 23:27 ` [PATCH 01/58] jsm: IRQ handlers doesn't need to have IRQ_DISABLED enabled Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 02/58] jsm: Rewriting a bad log message Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 03/58] jsm: remove the ch_custom_speed field Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 04/58] jsm: removing ch_old_baud field Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 05/58] jsm: Remove ch_cpstime field Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 06/58] jsm: Removing unused jsm_channel->ch_wopen field Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 07/58] jsm: removing the field jsm_board->intr_count Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 08/58] jsm: adding EEH handlers Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 09/58] tty: const: constify remaining tty_operations Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 10/58] tty: esp: remove broken driver Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 11/58] tty: istallion: Kill off the BKL ioctl Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 12/58] tty: stallion: kill " Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 13/58] tty_port: add "tty_port_open" helper Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 14/58] tty_port: coding style cleaning pass Greg Kroah-Hartman
2009-12-11 23:27 ` [PATCH 15/58] usb_serial: Use the shutdown() operation Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 16/58] usb_serial: Kill port mutex Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 17/58] opticon: Fix resume logic Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 18/58] serial: fix NULL pointer dereference Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 19/58] serial: cascade needless conditionals Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 20/58] serial, 8250: calculate irqflags bitmask before loop Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 21/58] Serial: pxa: work around Errata #75 Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 22/58] tty: docs: serial/tty, add to ldisc methods Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 23/58] Serial: Do not read IIR in serial8250_start_tx when UART_BUG_TXEN Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 24/58] devpts_get_tty() should validate inode Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 25/58] tty_port: Move hupcl handling Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 26/58] sdio_uart: use tty_port Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 27/58] sdio_uart: Fix oops caused by the previous changeset Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 28/58] sdio_uart: refcount the tty objects Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 29/58] sdio_uart: Move the open lock Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 30/58] tty: sdio_uart: Switch to the open/close helpers Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 31/58] tty: sdio_uart: Fix termios handling Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 32/58] tty: sdio_uart: Style fixes Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 33/58] tty: sdio_uart: add modem functionality Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 34/58] tty: sdio_uart: Fix the locking on "func" for new code Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 35/58] tty: tty_port: Change the buffer allocator locking Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 36/58] tty: riscom8: switch to the tty_port_open API Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 37/58] tty: tty_port: Add IO_ERROR bit handling Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 38/58] tty: tty_port: Move the IO_ERROR clear Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 39/58] tty: stallion: Convert to the tty_port_open/close methods Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 40/58] tty: istallion: tty port open/close methods Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 41/58] tty: tty_port: Add a kref object to the tty port Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 42/58] tty: isicom: switch to the new tty_port_open helper Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 43/58] tty: isicom: sort out the board init logic Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 44/58] tty: mxser: use the tty_port_open method Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 45/58] tty: mxser: Use the new locking rules to fix setserial properly Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 46/58] tty: isicom: fix deadlock on shutdown Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 47/58] tty: moxa: Use more tty_port ops Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 48/58] tty: moxa: rework the locking a bit Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 49/58] tty: moxa: Locking clean up Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 50/58] tty: moxa: Kill off the throttle method Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 51/58] tty: moxa: Fix modem op locking Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 52/58] tty: moxa: Kill the use of lock_kernel Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 53/58] tty: moxa: split open lock Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 54/58] tty: push the BKL down into the handlers a bit Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 55/58] tty: Push the lock down further into the ldisc code Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 56/58] tty: Push the bkl down a bit in the hangup code Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 57/58] tty: Move the leader test in disassociate Greg Kroah-Hartman
2009-12-11 23:28 ` [PATCH 58/58] tty: split the lock up a bit further Greg Kroah-Hartman
2009-12-12  8:46 ` [GIT PATCH] TTY patches for 2.6.33-git Ingo Molnar
2009-12-12  9:39   ` Andrew Morton
2009-12-12 10:06     ` Ingo Molnar
2009-12-12 10:15       ` Ingo Molnar
2009-12-12 10:41         ` Andrew Morton
2009-12-12 10:52           ` Ingo Molnar
2009-12-12 10:10     ` Ingo Molnar
2009-12-12 10:36       ` Andrew Morton
2009-12-12 17:16         ` Linus Torvalds
2009-12-12 17:26           ` Linus Torvalds
2009-12-12 21:42             ` Alan Cox
2009-12-12 21:48               ` Thomas Gleixner
2009-12-12 22:25                 ` Linus Torvalds
2009-12-12 22:31                   ` Thomas Gleixner
2009-12-12 22:21               ` Linus Torvalds
2009-12-12 22:33                 ` Thomas Gleixner
2009-12-12 23:17                   ` Linus Torvalds
2009-12-13  6:58                     ` Ingo Molnar
2009-12-13 11:36                       ` Alan Cox
2009-12-13 12:13                         ` Ingo Molnar
2009-12-13 17:46                       ` Linus Torvalds
2009-12-13 18:17                         ` Ingo Molnar
2009-12-13 18:33                           ` Trond Myklebust
2009-12-13 19:07                             ` Linus Torvalds
2009-12-13 19:17                               ` Trond Myklebust
2009-12-13 19:04                           ` Frederic Weisbecker
2009-12-13 19:09                             ` Trond Myklebust
2009-12-13 19:19                               ` Linus Torvalds
2009-12-13 20:04                                 ` Trond Myklebust
2009-12-13 19:20                               ` Frederic Weisbecker
2009-12-13 17:55                       ` Arjan van de Ven
2009-12-13 19:16                         ` Frederic Weisbecker
2009-12-14  5:30                           ` Arjan van de Ven
2009-12-14 10:39                             ` Oliver Neukum
2009-12-14 16:02                               ` Arjan van de Ven
2009-12-16  9:15                             ` Arnd Bergmann [this message]
2009-12-12 11:02     ` Alan Cox
2009-12-12 22:34       ` Thomas Gleixner
2009-12-12 10:42   ` Alan Cox
2009-12-12 10:42     ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2010-03-02 23:09 Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200912160915.45606.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=fweisbec@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.