Skip to contentSkip to conversation

Allocate kprobe_table at runtime

PATCH In review Andi Kleen 3 participants 3 messages Jun 27, 2005 – Jun 28, 2005 2 messages not in the archive kprobes

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#2 lore raw
Quoted 9 lines · Prasanna S Panchamukhi

Jeff,

Review

Quoted 3 lines · Jeff Sipek

Allocates kprobe_table at runtime.

(quoted diff) +1 -1
-	/* FIXME allocate the probe table, currently defined statically */
+	kprobe_table = kmalloc(sizeof(struct hlist_head)*KPROBE_TABLE_SIZE, GFP_ATOMIC);

Memory allocation using GFP_KERNEL has more chances of success as compared to GFP_ATOMIC. Why can't we use GFP_KERNEL here?

I don't see any sense in the change anyways. Just using BSS should be fine.

Jeff, when you submit a patch you should add a small blurb describing why you think it is a good idea.

-Andi

#3 lore raw

PATCH v2 1/1 Allocate kprobe_table at runtime

Quoted 12 lines · Andi Kleen
Quoted 9 lines · Prasanna S Panchamukhi

Jeff,

Review

Quoted 3 lines · Jeff Sipek

Allocates kprobe_table at runtime.

(quoted diff) +1 -1
-	/* FIXME allocate the probe table, currently defined statically */
+	kprobe_table = kmalloc(sizeof(struct hlist_head)*KPROBE_TABLE_SIZE, GFP_ATOMIC);

Memory allocation using GFP_KERNEL has more chances of success as compared to GFP_ATOMIC. Why can't we use GFP_KERNEL here?

Quoted 5 lines

I don't see any sense in the change anyways. Just using BSS should be fine.

Jeff, when you submit a patch you should add a small blurb describing why you think it is a good idea.

That patch was somewhat impulsive...I was looking at some code and saw a FIXME that required minimal work. I agree that BSS is good enough.

Patch below removes the FIXME notice.

Pick one ;-) (Patch Monkey is CC'd).

Jeff.

Remove useless FIXME.

Signed-off-by Josef "Jeff" Sipek
kernel/kprobes.c +0 -1
@@ -261,7 +261,6 @@ static int __init init_kprobes(void)
 {
 	int i, err = 0;
 
-	/* FIXME allocate the probe table, currently defined statically */
 	/* initialize all list heads */
 	for (i = 0; i < KPROBE_TABLE_SIZE; i++)
 		INIT_HLIST_HEAD(&kprobe_table[i]);
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 1 line

I agree that BSS is good enough.

Alternatively, you can implement dynamic allocation of each element of kprobe_table in register_kprobe function. You will be able to free them by calling unregister_kprobe function later on.

Regards,
- --
Luca
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQsBY/8zkDT3RfMB6AQJBGQf+PUMdOIpAfq4Q5lI77P7uSx1vdq2905Dp UwowzJpBLhQoZWI94xmhp7zx2unu5IqKBoXl62sjqOLgT9/K417ReEKFKfN3SSex shtulBOFxHfimNZX1mYhtmgJxKMU3jb3jyjXQg4oufL15Khl5PqkIxWewcVGB8LB bciH1242moxl7jKmEJXqm8IU4ZezOpfRoBYnvaxVrr1zL/zQzUgISgBfb2GkYpSP ErXg+w8ggUJ/TDlkZyGjT1OmjhLmb1ekYxzUE/K+dYnP5GGC/sGx5t/YgLxiKXjL nfNM7oF8qP43eArFmbQlUpMAXpkCWOGr7v5Ifcq8hJRfo99B9GL5uA== =fBGJ
-----END PGP SIGNATURE-----