Malloc under kernel

Submitted by Macross
on July 19, 2005 - 6:07am

Hi

How can I alloc under the kernel a 20 Mbyte size data with a high priority under the system since I need such quantity for a high performance transference under my driver ?????

It must be dynamic , since th

Macross
on
July 19, 2005 - 6:10am

It must be dynamic , since the size changes depending on some circunstances ... i´ve took a look inside kmalloc, but it´s range is limited to a a default size ... Is there another way to get this memory ?

You could try reserving a lar

Anonymouse (not verified)
on
July 20, 2005 - 5:57pm

You could try reserving a large number of pages and mem mapping them.

u kud try fakit

sfghfghxcvbhn (not verified)
on
July 22, 2005 - 4:07pm

u kud try fakit

You can either use the bigphy

Anonymouse (not verified)
on
July 20, 2005 - 6:20pm

You can either use the bigphysarea patch to the kernel or better still you can use vmalloc which allocates pages.

kernel

Rvan hug
on
July 19, 2005 - 7:02am

Hi,

My colleague Bob just wrote the following patch. It implements sorting
by spamassassin score. There are "convert-to-mutt-score" configuration
hacks on the internet, but those are an incomplete hack.

The patch was built for our 1.3.8 debian-stable mutt, but applies
pretty cleanly to a 1.5.x tree.

jack.

--
+-- jack -- www.rse.nl/recovery.htm -- 030-2106401 --
| Data verloren, bestanden kwijt, alle data weg?!
| Blijf kalm en neem contact op met rse.nl!

diff -ur mutt-1.3.28-new/commands.c mutt-1.3.28/commands.c
--- mutt-1.3.28-new/commands.c Wed Feb 25 15:06:13 2004
+++ mutt-1.3.28/commands.c Wed Feb 25 15:06:35 2004
-459,9 +459,9
int method = Sort; /* save the current method in case of abort */

switch (mutt_multi_choice (reverse ?
- _("Rev-Sort (d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore?: ") :
- _("Sort (d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore?: "),
- _("dfrsotuzc")))
+ _("Rev-Sort (d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore/s(p)am?: ") :
+ _("Sort (d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore/s(p)am?: "),
+ _("dfrsotuzcp")))
{
case -1: /* abort - don't resort */
return -1;
-500,6 +500,9

case 9: /* s(c)ore */
Sort = SORT_SCORE;
+ break;
+ case 10: /* s(p)am */
+ Sort = SORT_SPAM;
break;
}
if (reverse)
diff -ur mutt-1.3.28-new/init.h mutt-1.3.28/init.h
--- mutt-1.3.28-new/init.h Wed Feb 25 15:06:15 2004
+++ mutt-1.3.28/init.h Wed Feb 25 15:09:32 2004
-2381,6 +2381,7
{ "threads", SORT_THREADS },
{ "to", SORT_TO },
{ "score", SORT_SCORE },
+ { "spam", SORT_SPAM },
{ NULL, 0 }
};

diff -ur mutt-1.3.28-new/mutt.h mutt-1.3.28/mutt.h
--- mutt-1.3.28-new/mutt.h Wed Feb 25 15:06:15 2004
+++ mutt-1.3.28/mutt.h Wed Feb 25 15:06:35 2004
-527,6 +524,8
LIST *references; /* message references (in reverse order) */
LIST *in_reply_to; /* in-reply-to header content */
LIST *userhdrs; /* user defined headers */
+
+ int x_spam_hits;
} ENVELOPE;

typedef struct parameter
diff -ur mutt-1.3.28-new/parse.c mutt-1.3.28/parse.c
--- mutt-1.3.28-new/parse.c Wed Feb 25 15:06:14 2004
+++ mutt-1.3.28/parse.c Wed Feb 25 15:07:36 2004
-1207,6 +1207,14
e->x_label = safe_strdup(p);
matched = 1;
}
+ else if (ascii_strcasecmp (line+1, "-Spam-Status") == 0)
+ {
+ char *s = strstr(p, "hits=");
+ if (s)
+ e->x_spam_hits = 100 * strtod(s + 5, NULL);
+
+ matched = 1;
+ }

default:
break;
diff -ur mutt-1.3.28-new/sort.c mutt-1.3.28/sort.c
--- mutt-1.3.28-new/sort.c Wed Feb 25 15:06:14 2004
+++ mutt-1.3.28/sort.c Wed Feb 25 15:06:35 2004
-37,6 +37,17
if (!code) \
code = (*((HEADER **)a))->index - (*((HEADER **)b))->index;

+int compare_spam (const void *a, const void *b)
+{
+ HEADER **pa = (HEADER **) a;
+ HEADER **pb = (HEADER **) b;
+
+ int result = (*pa)->env->x_spam_hits - (*pb)->env->x_spam_hits;
+ AUXSORT(result,a,b);
+ return (SORTCODE (result));
+}
+
+
int compare_score (const void *a, const void *b)
{
HEADER **pa = (HEADER **) a;
-168,6 +179,8
return (compare_to);
case SORT_SCORE:
return (compare_score);
+ case SORT_SPAM:
+ return (compare_spam);
default:
return (NULL);
}
diff -ur mutt-1.3.28-new/sort.h mutt-1.3.28/sort.h
--- mutt-1.3.28-new/sort.h Wed Feb 25 15:06:15 2004
+++ mutt-1.3.28/sort.h Wed Feb 25 15:06:35 2004
-29,6 +29,7
#define SORT_ADDRESS 11
#define SORT_KEYID 12
#define SORT_TRUST 13
+#define SORT_SPAM 14
#define SORT_MASK 0xf
#define SORT_REVERSE (1<<4)
#define SORT_LAST (1<<5)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.