All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Mike Kravetz <kravetz@us.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Bug with shared memory.
Date: Wed, 15 May 2002 16:07:16 -0700	[thread overview]
Message-ID: <3CE2EA24.961D2CF@zip.com.au> (raw)
In-Reply-To: <OF6D316E56.12B1A4B0-ONC1256BB9.004B5DB0@de.ibm.com> <3CE16683.29A888F8@zip.com.au> <20020515154200.B8975@w-mikek2.des.beaverton.ibm.com>

Mike Kravetz wrote:
> 
> On Tue, May 14, 2002 at 12:33:23PM -0700, Andrew Morton wrote:
> > Martin Schwidefsky wrote:
> > >                                          The system call that caused
> > > this has been sys_ipc with IPC_RMID and from there the call chain is
> > > as follows: sys_shmctl, shm_destroy, fput, dput, iput, truncate_inode_pages,
> > > truncate_list_pages, schedule. The scheduler picked a process that called
> > > sys_shmat. It tries to get the lock and hangs.
> >
> > There's no way the kernel can successfully hold a spinlock
> > across that call chain.
> >
> 
> Is adding a check for this type of situation (under CONFIG_DEBUG_SPINLOCK
> of course) worth the effort?  One would simply add a 'locks_held' count
> for each task and check for zero at certain places such as return to
> user mode, and during context switching.

I think it would be worth the effort.  One approach would be to
create a `can_sleep()' macro.  Add that to functions which may
schedule.  It's useful for documentation purposes as well as runtime
checks.

The Stanford checker caught a lot of these, but it seems that
the (high) amount of source-level obfuscation in the ipc code
defeated it.

> One would think these types of things are easily found, but this example
> suggests otherwise.  Has anyone run the kernel through an extensive
> (stress) test suite with any of the kernel debug options enabled?

There are at present no tools in the tree to trap this
problem.

-

  reply	other threads:[~2002-05-15 23:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-14 15:13 Bug with shared memory Martin Schwidefsky
2002-05-14 19:33 ` Andrew Morton
2002-05-15 22:42   ` Mike Kravetz
2002-05-15 23:07     ` Andrew Morton [this message]
2002-05-17 17:53     ` Bill Davidsen
2002-05-17 20:07       ` Mike Kravetz
2002-05-17 20:29         ` Anton Blanchard
2002-05-20  4:30   ` Andrea Arcangeli
2002-05-20  5:21     ` Andrew Morton
2002-05-20 11:34       ` Andrey Savochkin
2002-05-20 14:15       ` Andrea Arcangeli
2002-05-20 19:24         ` Rik van Riel
2002-05-20 23:46           ` Andrea Arcangeli
2002-05-21  0:14             ` Martin J. Bligh
2002-05-21  1:40               ` Andrea Arcangeli
2002-05-20 16:22       ` Martin J. Bligh
2002-05-20 19:38         ` Rik van Riel
2002-05-20 20:06           ` William Lee Irwin III
2002-05-20 16:13     ` Martin J. Bligh
2002-05-20 16:37       ` Andrea Arcangeli
2002-05-20 17:23         ` Martin J. Bligh
2002-05-20 17:32           ` William Lee Irwin III
2002-05-24  7:33     ` inode highmem imbalance fix [Re: Bug with shared memory.] Andrea Arcangeli
2002-05-24  7:51       ` William Lee Irwin III
2002-05-24  8:04       ` Andrew Morton
2002-05-24 15:20         ` Andrea Arcangeli
2002-05-24 11:47       ` Ed Tomlinson
2002-05-30 11:25       ` Denis Lunev
2002-05-30 17:59         ` Andrea Arcangeli

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=3CE2EA24.961D2CF@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=kravetz@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /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.