Skip to contentSkip to conversation

kernel thread priority

DISCUSSION Subbu 5 participants 7 messages Jul 7, 2006 – Jul 20, 2006

lore
Share & tools
lore

Subbu

author
#0 lore raw

Hi,

I have to run some part of my network driver code in a thread which
should have highest priority.

I am working on 2.4.20-8 redhat 9 kernel version.

i am using kernel_thread function to run the current process in a
thread.

How can i set the priority level of the same to the highest .

please help me in this regard. what are the functions i should use
for this

Thanx in advance
subbu

"SASKEN RATED Among THE Top 3 BEST COMPANIES TO WORK FOR IN INDIA - SURVEY 2005 conducted by the BUSINESS TODAY - Mercer - TNS India"

SASKEN BUSINESS DISCLAIMER
This message may contain confidential, proprietary or legally Privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email

#1 lore raw
Quoted 11 lines · Subbu

Hi,

I have to run some part of my network driver code in a thread which
should have highest priority.

I am working on 2.4.20-8 redhat 9 kernel version.

i am using kernel_thread function to run the current process in a
thread.

Quoted 9 lines

How can i set the priority level of the same to the highest .

please help me in this regard. what are the functions i should use
for this

Thanx in advance
subbu

Older kernels required something like:
task_lock(current);
current->nice = PRIORITY;
task_unlock(current);

Newer kernels use:

set_user_nice(current, PRIORITY);

Quoted 4 lines

"SASKEN RATED Among THE Top 3 BEST COMPANIES TO WORK FOR IN INDIA - SURVEY 2005 conducted by the BUSINESS TODAY - Mercer - TNS India"

Quoted 8 lines

SASKEN BUSINESS DISCLAIMER
This message may contain confidential, proprietary or legally Privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.4 on an i686 machine (5592.89 BogoMips). New book: http://www.AbominableFirebug.com/
_


****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

author
#2 lore raw

Compiling Driver code for 2.6 kernel

In reply to Subbu

Hi,

Please Help me as i am newbie to 2.6 kernel.

I have My driver code for 2.4.20 kernel(Here i generate .o with 100's
of .objs linked together).

I have a main GNUMakefile linked with 10's of individual make files
w.r.t different directories

i am able to compile my source code and able to link all individual
modules and generate final module.o (2.6). but i am not sure how to genrate .ko from the module.o i have.

I understand the compilation for 2.6 is different.

How i can generate .ko which is required for 2.6.

1) Is a simple Makefile changes for 2.4 to 2.6 enough..?? then what needs
to done in my GNUmakefile(not the kernel source)
2) Is it required to use kernel source GNUMakefile as given in examples
***
3) Is it o.k to compile individual 'c' files with .obj and linked to
module.o

Please help me in this regards

THanx in advance
Subbu

"SASKEN RATED Among THE Top 3 BEST COMPANIES TO WORK FOR IN INDIA - SURVEY 2005 conducted by the BUSINESS TODAY - Mercer - TNS India"

SASKEN BUSINESS DISCLAIMER
This message may contain confidential, proprietary or legally Privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email

#3 lore raw

Re: Compiling Driver code for 2.6 kernel

Quoted 7 lines · Subbu

Hi,

Please Help me as i am newbie to 2.6 kernel.

I have My driver code for 2.4.20 kernel(Here i generate .o with 100's
of .objs linked together).

wow that's a lot; I suspect you're going to want to consolidate that somewhat when you send your driver for inclusion into the kernel.org kernel

Quoted 6 lines

I have a main GNUMakefile linked with 10's of individual make files
w.r.t different directories

i am able to compile my source code and able to link all individual
modules and generate final module.o (2.6). but i am not sure how to genrate .ko from the module.o i have.

see Documentation/kbuild directory, it has many examples on this

but... it sounds like you oversplit your module... do you have a pointer to the source of it? Maybe I can give some useful suggestions on how to organize it...

Greetings,
Arjan van de Ven

author
#4 lore raw

Memory allocation Failure problem with kmalloc.

In reply to Subbu

Hi,

I am working on 2.4.20 kernel.

I need to allocate memory with kmalloc.

kmalloc fails because i want to allocate more than 128kb. How to handle
this issue.

Please help me in this regard.

How i can allocate memory of size equal to 1Mb with kmalloc or any other
function (2.4 kernel)

THanx in advance.
Subbu

"SASKEN RATED Among THE Top 3 BEST COMPANIES TO WORK FOR IN INDIA - SURVEY 2005 conducted by the BUSINESS TODAY - Mercer - TNS India"

SASKEN BUSINESS DISCLAIMER
This message may contain confidential, proprietary or legally Privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email

#5 lore raw

Re: Memory allocation Failure problem with kmalloc.

Quoted 8 lines · Subbu

Hi,

I am working on 2.4.20 kernel.

I need to allocate memory with kmalloc.

Quoted 8 lines

kmalloc fails because i want to allocate more than 128kb. How to handle
this issue.

Please help me in this regard.

How i can allocate memory of size equal to 1Mb with kmalloc or any other
function (2.4 kernel)

kmalloc() allocates physically contiguous pages. 1M is a hell of a lot of contig pages to ask for. I doubt you can get that much except at early boot. But, if the pages don't actually need to be physically contiguous, then you can use vmalloc() - it'll give you a virtually contiguous range but the pages are not nessesarily physically contiguous.

Why do you need this much btw?

Signature · 3 lines
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
#6 lore raw

Re: Memory allocation Failure problem with kmalloc.

In reply to Subbu
Quoted 3 lines

Hi,

I am working on 2.4.20 kernel.

Old.

Quoted 3 lines

I need to allocate memory with kmalloc.

kmalloc fails because i want to allocate more than 128kb.

http://lwn.net/Kernel/LDD3/
vmalloc, get_free_pages, ...

Quoted 1 line

How to handle this issue.

Error: Missing '?'

Quoted 2 lines

"SASKEN RATED Among THE Top 3 BEST COMPANIES TO WORK FOR IN INDIA - SURVEY 2005 conducted by the BUSINESS TODAY - Mercer - TNS India"

Self overrating.

Quoted 1 line

SASKEN BUSINESS DISCLAIMER

See another thread ;)

Jan Engelhardt