From: William Lee Irwin III <wli@holomorphy.com>
To: Albert Cahalan <albert@users.sf.net>,
linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: fix text reporting in O(1) proc_pid_statm()
Date: Tue, 24 Aug 2004 17:01:49 -0700 [thread overview]
Message-ID: <20040825000149.GJ2793@holomorphy.com> (raw)
In-Reply-To: <20040824232424.GI2793@holomorphy.com>
On Tue, Aug 24, 2004 at 04:18:41PM -0700, William Lee Irwin III wrote:
>> Account reserved memory properly as per acahalan's sepecified semantics.
On Tue, Aug 24, 2004 at 04:24:24PM -0700, William Lee Irwin III wrote:
> Unrelated fix. Unaccount VM_DONTCOPY vmas properly; the child inherits
> the whole of the parent's virtual accounting from the memcpy() in
> copy_mm(), but the VM_DONTCOPY check here is where a decision is made
> for the child not to inherit the vmas corresponding to some accounted
> memory usages. Hence, unaccount them when skipping over them here.
Unrelated improvement (not mandatory or a fix for a bug). Remove the
accounting overhead when CONFIG_PROC_FS is not defined.
Index: mm4-2.6.8.1/include/linux/mm.h
===================================================================
--- mm4-2.6.8.1.orig/include/linux/mm.h 2004-08-23 18:29:33.000000000 -0700
+++ mm4-2.6.8.1/include/linux/mm.h 2004-08-24 16:57:36.114920616 -0700
@@ -754,7 +754,15 @@
int write);
extern int remap_page_range(struct vm_area_struct *vma, unsigned long from,
unsigned long to, unsigned long size, pgprot_t prot);
+
+#ifdef CONFIG_PROC_FS
void __vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
+#else
+static inline void __vm_stat_account(struct mm_struct *mm,
+ unsigned long flags, struct file *file, long pages)
+{
+}
+#endif /* CONFIG_PROC_FS */
static inline void vm_stat_account(struct vm_area_struct *vma)
{
Index: mm4-2.6.8.1/mm/mmap.c
===================================================================
--- mm4-2.6.8.1.orig/mm/mmap.c 2004-08-24 16:13:14.139602376 -0700
+++ mm4-2.6.8.1/mm/mmap.c 2004-08-24 16:57:23.943770912 -0700
@@ -729,6 +729,7 @@
return NULL;
}
+#ifdef CONFIG_PROC_FS
void __vm_stat_account(struct mm_struct *mm, unsigned long flags,
struct file *file, long pages)
{
@@ -752,6 +753,7 @@
if (flags & (VM_RESERVED|VM_IO))
mm->reserved_vm += pages;
}
+#endif /* CONFIG_PROC_FS */
/*
* The caller must hold down_write(current->mm->mmap_sem).
next prev parent reply other threads:[~2004-08-25 0:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-24 23:06 fix text reporting in O(1) proc_pid_statm() Albert Cahalan
2004-08-24 23:12 ` William Lee Irwin III
2004-08-24 23:18 ` William Lee Irwin III
2004-08-24 23:24 ` William Lee Irwin III
2004-08-25 0:01 ` William Lee Irwin III [this message]
2004-08-25 2:52 ` Albert Cahalan
2004-08-25 3:04 ` William Lee Irwin III
-- strict thread matches above, loose matches on Subject: below --
2004-08-22 8:34 2.6.8.1-mm4 Andrew Morton
2004-08-23 20:21 ` 2.6.8.1-mm4 wli
2004-08-24 6:14 ` 2.6.8.1-mm4 Andrew Morton
2004-08-24 7:55 ` O(1) proc_pid_statm() William Lee Irwin III
2004-08-24 17:05 ` fix text reporting in " William Lee Irwin III
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=20040825000149.GJ2793@holomorphy.com \
--to=wli@holomorphy.com \
--cc=albert@users.sf.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.