From: "Martin Schwidefsky" <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org
Subject: Bug with shared memory.
Date: Tue, 14 May 2002 17:13:06 +0200 [thread overview]
Message-ID: <OF6D316E56.12B1A4B0-ONC1256BB9.004B5DB0@de.ibm.com> (raw)
Hi,
we managed to hang the kernel with a db/2 stress test on s/390. The test
was done on 2.4.7 but the problem is present on all recent 2.4.x and 2.5.x
kernels (all architectures). In short a schedule is done while holding
the shm_lock of a shared memory segment. 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.
One way to fix this is to remove the schedule call from truncate_list_pages:
--- linux-2.5/mm/filemap.c~ Tue May 14 17:04:14 2002
+++ linux-2.5/mm/filemap.c Tue May 14 17:04:33 2002
@@ -237,11 +237,6 @@
page_cache_release(page);
- if (need_resched()) {
- __set_current_state(TASK_RUNNING);
- schedule();
- }
-
write_lock(&mapping->page_lock);
goto restart;
}
Another way is to free the lock before calling fput in shm_destroy but the
comment says that this functions has to be called with shp and shm_ids.sem
locked. Comments?
blue skies,
Martin
Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH
Schönaicherstr. 220, D-71032 Böblingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: schwidefsky@de.ibm.com
next reply other threads:[~2002-05-14 15:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-14 15:13 Martin Schwidefsky [this message]
2002-05-14 19:33 ` Bug with shared memory Andrew Morton
2002-05-15 22:42 ` Mike Kravetz
2002-05-15 23:07 ` Andrew Morton
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=OF6D316E56.12B1A4B0-ONC1256BB9.004B5DB0@de.ibm.com \
--to=schwidefsky@de.ibm.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).