linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: chrisl@vmware.com
To: Andrew Morton <akpm@digeo.com>, andrea@suse.de
Cc: linux-kernel@vger.kernel.org
Subject: writepage return value check in vmscan.c
Date: Thu, 24 Oct 2002 01:25:05 -0700	[thread overview]
Message-ID: <20021024082505.GB1471@vmware.com> (raw)

Hi Andrew,

It might be a silly question.

Is it a bug in vmscan.c that it do not check the return
value of writepage when shrinking the cache?

Some background of the problem:

I was tracing some heavy swapping problem relate to high memory usage
when running many virtual machines in VMware GSX server some time ago.
If the total ram size of different virtual machine add up to some level,
bigger than 2G on a 4Gmachine.Kernel will keep swapping and no response.

VMware open a tmp ram file for each virtual machine and mmap on that file
to share memory between different process.

I soon find out the hidden size limit on shmfs even though the ram file
is open on a ext2/ext3 file system. If I change the ram file open on
/dev/shm then the problem seems to go away. I guess that is because /tmp
directory is full but bigger /tmp did not help. that is another issue
though.

I try to find out what happen if user memory map a sparse file then
kernel try to write it back to disk and hit a no disk space error.
To my surprise, it seems to me that both 2.4 and 2.5 kernel do not
check the return value of "writepage". If there is an error like ENOSPC
it will just drop it on the ground? Do I miss something obvious?

BTW, I am amazed that there is so many way user can abuse the mmap system
call. e.g. open a file, ftruncate to a bigger size, unlink that file while
keep the file descriptor, mmap to some memory using that descriptor,
close that descriptor, you can still use that mmaped memory.

Cheers,

Chris

             reply	other threads:[~2002-10-24  8:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-24  8:25 chrisl [this message]
2002-10-24  8:36 ` writepage return value check in vmscan.c Andrew Morton
2002-10-24  9:15   ` Alan Cox
2002-10-24 11:44     ` Andrea Arcangeli
2002-10-24 16:12       ` Andrew Morton
2002-10-24 17:59     ` chrisl
2002-10-24 11:31   ` Andrea Arcangeli
2002-10-24 18:30     ` chrisl
2002-10-24 18:40       ` Andrea Arcangeli
2002-10-24 19:14         ` Rik van Riel
2002-10-24 19:25           ` Andrew Morton
2002-10-24 17:57   ` chrisl
2002-10-24 18:33     ` Andrea Arcangeli
2002-10-24 19:15       ` chrisl
2002-10-24 20:41         ` Andrea Arcangeli
2002-10-24 21:17           ` chrisl
2002-10-24 20:46         ` Andrew Morton
2002-10-24 21:23           ` chrisl
2002-10-24 21:29             ` Andrew Morton
2002-10-25 16:11               ` Paul Larson
2002-10-25 16:31                 ` Christoph Hellwig
2002-10-25 17:07                 ` Rik van Riel
2002-10-25 18:44         ` Andrew Morton
2002-10-28 19:17           ` chrisl
2002-10-28 19:53             ` Andrew Morton
2002-10-28 20:38               ` chrisl
2002-10-28 21:14               ` Andrea Arcangeli
2002-10-28  8:28         ` Christoph Rohland
2002-10-28 18:44           ` chrisl
2002-10-28 19:22             ` Andrea Arcangeli
2002-10-28 19:29               ` chrisl
2002-10-29  6:10               ` Randy.Dunlap
2002-10-29  7:08                 ` Andreas Dilger
2002-10-28 19:58       ` chrisl
2002-10-28 21:32         ` Andrea Arcangeli
2002-10-30  4:13           ` chrisl

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=20021024082505.GB1471@vmware.com \
    --to=chrisl@vmware.com \
    --cc=akpm@digeo.com \
    --cc=andrea@suse.de \
    --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).