From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-mm@kvack.org
Subject: Re: 2.5.70-bk4+: oops by mc -v /proc/bus/pci/00/00.0
Date: Sun, 1 Jun 2003 14:34:39 +0200 [thread overview]
Message-ID: <20030601143439.O626@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <20030531195414.10c957b7.akpm@digeo.com>; from akpm@digeo.com on Sat, May 31, 2003 at 07:54:14PM -0700
Hi Andrew,
On Sat, May 31, 2003 at 07:54:14PM -0700, Andrew Morton wrote:
> It's pretty lame. Really we need a proper vma constructor
> somewhere.
you mean sth. like this? (Just initialized the members, that I had useful
defaults for.)
--- linux-2.5.70/kernel/fork.c Sun Jun 1 13:08:54 2003
+++ linux-2.5.70/kernel/fork.c Sun Jun 1 14:26:19 2003
@@ -1147,6 +1147,35 @@
/* SLAB cache for mm_struct structures (tsk->mm) */
kmem_cache_t *mm_cachep;
+/* SLAB constructor for vm_area_struct objects */
+static void init_vm_area_struct(void *at, kmem_cache_t * dummy,
+ unsigned long flags)
+{
+ struct vm_area_struct *t = at;
+
+ if (SLAB_CTOR_CONSTRUCTOR !=
+ (flags & (SLAB_CTOR_CONSTRUCTOR | SLAB_CTOR_VERIFY) ))
+ return;
+
+ /* these are NOT initialized, because they must be intialized
+ * by the caller of kmem_cache_alloc():
+
+ t->vm_mm
+ t->vm_start
+ t->vm_end
+ t->vm_page_prot
+ t->vm_flags
+ t->vm_rb
+
+ */
+ t->vm_next = NULL;
+ INIT_LIST_HEAD(&t->shared);
+ t->vm_ops = NULL;
+ t->vm_pgoff = 0; /* FIXME: maybe ~0UL is better here? */
+ t->vm_file = NULL;
+ t->private_data = NULL;
+}
+
void __init proc_caches_init(void)
{
sighand_cachep = kmem_cache_create("sighand_cache",
@@ -1175,7 +1204,7 @@
vm_area_cachep = kmem_cache_create("vm_area_struct",
sizeof(struct vm_area_struct), 0,
- 0, NULL, NULL);
+ 0, init_vm_area_struct, NULL);
if(!vm_area_cachep)
panic("vma_init: Cannot alloc vm_area_struct SLAB cache");
Regards
Ingo Oeser
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next parent reply other threads:[~2003-06-01 12:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20030531165523.GA18067@steel.home>
[not found] ` <20030531195414.10c957b7.akpm@digeo.com>
2003-06-01 12:34 ` Ingo Oeser [this message]
2003-06-01 19:58 ` Andrew Morton
2003-06-01 21:53 ` 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=20030601143439.O626@nightmaster.csn.tu-chemnitz.de \
--to=ingo.oeser@informatik.tu-chemnitz.de \
--cc=akpm@digeo.com \
--cc=linux-mm@kvack.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