This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 211335 - Missing page_cache_release() in do_direct_IO() causes memory leak.
Missing page_cache_release() in do_direct_IO() causes memory leak.
Status: CLOSED DUPLICATE of bug 191736
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Prarit Bhargava
Martin Jenner
Depends On:
  Show dependency treegraph
Reported: 2006-10-18 14:33 EDT by Bob Miller
Modified: 2007-11-16 20:14 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-28 10:19:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch for leaking io_direct_IO(). (508 bytes, patch)
2006-10-18 14:33 EDT, Bob Miller
no flags Details | Diff
test program (1.95 KB, text/plain)
2007-05-16 08:54 EDT, Radovan Augustin
no flags Details

  None (edit)
Description Bob Miller 2006-10-18 14:33:10 EDT
Description of problem:

In do_direct_IO() there is an error return path if the buffer is not mapped 
and it is a write operation.  In that case, the current code just returns 
-ENOTBLK.  The code should be calling page_cache_release(page) before the 
return.  Because of the bug the page reference count for the page will never  
become zero and the page will never be free'd.  Enough of this and your system 
runs out of memory.

How reproducible:

If you do lots of direct I/O writes with the system under memory pressure this 
can happen a lot.
Comment 1 Bob Miller 2006-10-18 14:33:10 EDT
Created attachment 138819 [details]
Patch for leaking io_direct_IO().
Comment 3 Alex Yamauchi 2007-05-14 22:19:44 EDT
I believe I may have systems affected by this issue.  Has there been any
resoution?  My WS4U5 workstations are getting stuck in swap and it takes forever
to clear.

Would you please provide some tests to verify whether or not I am experiencing
the same issue?
Comment 4 Radovan Augustin 2007-05-16 08:54:40 EDT
Created attachment 154814 [details]
test program


here is test, which is able to test this bug. If you will have difference in
memory ussage before and after test run, you have a bug. Test will loose 100 MB
of system memory. If you are using RHEL 4.4, patch for this bug is already
included in RHEL updates.
Comment 7 Prarit Bhargava 2007-06-28 10:12:05 EDT
This seems pretty straightforward and is a bug.  Upstream code matches the
proposed patch.

I'll build & test.

Comment 8 Prarit Bhargava 2007-06-28 10:19:44 EDT

*** This bug has been marked as a duplicate of 191736 ***

Note You need to log in before you can comment on or make changes to this bug.