Hugh Dickins: remove rlim_rss and this RLIMIT_RSS code from madvise. Presumably the code crept in by mistake.

Linux Kernel Mailing List <[email protected]>
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1581, 2005/01/28 07:43:18-02:00, [email protected]

	Hugh Dickins: remove rlim_rss and this RLIMIT_RSS code from madvise. Presumably the code crept in by mistake.
	
	Isn't the right fix just to remove rlim_rss and this RLIMIT_RSS code
	from here?  It's pretty silly for madvise alone to be taking notice
	of it.  Presumably the code crept in by mistake from some tree which
	was using an RLIMIT_RSS patch on 2.4.



 filemap.c |   12 +-----------
 1 files changed, 1 insertion(+), 11 deletions(-)


diff -Nru a/mm/filemap.c b/mm/filemap.c
--- a/mm/filemap.c	2005-01-30 15:36:55 -08:00
+++ b/mm/filemap.c	2005-01-30 15:36:55 -08:00
@@ -2589,7 +2589,7 @@
 	long error = -EBADF;
 	struct file * file;
 	struct inode * inode;
-	unsigned long size, rlim_rss;
+	unsigned long size;
 
 	/* Doesn't work if there's no mapped file. */
 	if (!vma->vm_file)
@@ -2604,16 +2604,6 @@
 	if (end > vma->vm_end)
 		end = vma->vm_end;
 	end = ((end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
-
-	/* Make sure this doesn't exceed the process's max rss. */
-	error = -EIO;
-	rlim_rss = current->rlim ?  current->rlim[RLIMIT_RSS].rlim_cur :
-				LONG_MAX; /* default: see resource.h */
-
-	rlim_rss = (rlim_rss & PAGE_MASK) >> PAGE_SHIFT;
-
-	if ((vma->vm_mm->rss + (end - start)) > rlim_rss)
-		return error;
 
 	/* round to cluster boundaries if this isn't a "random" area. */
 	if (!VM_RandomReadHint(vma)) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.