From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@linux-foundation.org
Cc: bernds_cb1@t-online.de, dhowells@redhat.com,
rgetz@blackfin.uclinux.org, vapier.adi@gmail.com,
lethal@linux-sh.org, linux-kernel@vger.kernel.org
Subject: [PATCH 03/10] NOMMU: Delete askedalloc and realalloc variables [ver #3]
Date: Thu, 08 Jan 2009 12:54:02 +0000 [thread overview]
Message-ID: <20090108125402.28454.97719.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20090108125346.28454.90871.stgit@warthog.procyon.org.uk>
Delete the askedalloc and realalloc variables as nothing actually uses the
value calculated.
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Mike Frysinger <vapier.adi@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
---
mm/nommu.c | 28 +---------------------------
1 files changed, 1 insertions(+), 27 deletions(-)
diff --git a/mm/nommu.c b/mm/nommu.c
index 1c28ea3..23f355b 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -40,7 +40,6 @@ void *high_memory;
struct page *mem_map;
unsigned long max_mapnr;
unsigned long num_physpages;
-unsigned long askedalloc, realalloc;
atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
int sysctl_overcommit_ratio = 50; /* default is 50% */
@@ -1042,22 +1041,11 @@ unsigned long do_mmap_pgoff(struct file *file,
/* okay... we have a mapping; now we have to register it */
result = (void *) vma->vm_start;
- if (vma->vm_flags & VM_MAPPED_COPY) {
- realalloc += kobjsize(result);
- askedalloc += len;
- }
-
- realalloc += kobjsize(vma);
- askedalloc += sizeof(*vma);
-
current->mm->total_vm += len >> PAGE_SHIFT;
add_nommu_vma(vma);
shared:
- realalloc += kobjsize(vml);
- askedalloc += sizeof(*vml);
-
add_vma_to_mm(current->mm, vml);
up_write(&nommu_vma_sem);
@@ -1124,14 +1112,8 @@ static void put_vma(struct mm_struct *mm, struct vm_area_struct *vma)
/* IO memory and memory shared directly out of the pagecache from
* ramfs/tmpfs mustn't be released here */
- if (vma->vm_flags & VM_MAPPED_COPY) {
- realalloc -= kobjsize((void *) vma->vm_start);
- askedalloc -= vma->vm_end - vma->vm_start;
+ if (vma->vm_flags & VM_MAPPED_COPY)
kfree((void *) vma->vm_start);
- }
-
- realalloc -= kobjsize(vma);
- askedalloc -= sizeof(*vma);
if (vma->vm_file) {
fput(vma->vm_file);
@@ -1177,8 +1159,6 @@ int do_munmap(struct mm_struct *mm, unsigned long addr, size_t len)
put_vma(mm, vml->vma);
*parent = vml->next;
- realalloc -= kobjsize(vml);
- askedalloc -= sizeof(*vml);
kfree(vml);
update_hiwater_vm(mm);
@@ -1220,9 +1200,6 @@ void exit_mmap(struct mm_struct * mm)
while ((tmp = mm->context.vmlist)) {
mm->context.vmlist = tmp->next;
put_vma(mm, tmp->vma);
-
- realalloc -= kobjsize(tmp);
- askedalloc -= sizeof(*tmp);
kfree(tmp);
}
@@ -1276,9 +1253,6 @@ unsigned long do_mremap(unsigned long addr,
/* all checks complete - do it */
vma->vm_end = vma->vm_start + new_len;
- askedalloc -= old_len;
- askedalloc += new_len;
-
return vma->vm_start;
}
EXPORT_SYMBOL(do_mremap);
next prev parent reply other threads:[~2009-01-08 12:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 12:53 [PATCH 00/10] Alter NOMMU mmap handling " David Howells
2009-01-08 12:53 ` [PATCH 01/10] NOMMU: Fix cleanup handling in ramfs_nommu_get_umapped_area() " David Howells
2009-01-08 12:53 ` [PATCH 02/10] NOMMU: Rename ARM's struct vm_region " David Howells
2009-01-08 12:54 ` David Howells [this message]
2009-01-08 12:54 ` [PATCH 04/10] NOMMU: Make VMAs per MM as for MMU-mode linux " David Howells
2009-01-13 7:55 ` Andrew Morton
2009-01-13 10:51 ` David Howells
2009-01-08 12:54 ` [PATCH 05/10] NOMMU: Make mmap allocation page trimming behaviour configurable. " David Howells
2009-01-08 12:54 ` [PATCH 06/10] NOMMU: Improve procfs output using per-MM VMAs " David Howells
2009-01-08 12:54 ` [PATCH 07/10] FDPIC: Don't attempt to expand the userspace stack to fill the space allocated " David Howells
2009-01-08 12:54 ` [PATCH 08/10] FLAT: " David Howells
2009-01-08 12:54 ` [PATCH 09/10] NOMMU: Teach kobjsize() about VMA regions. " David Howells
2009-01-08 12:54 ` [PATCH 10/10] NOMMU: Support XIP on initramfs " David Howells
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=20090108125402.28454.97719.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bernds_cb1@t-online.de \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rgetz@blackfin.uclinux.org \
--cc=torvalds@osdl.org \
--cc=vapier.adi@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®