linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* misc questions about kernel 2.4.x internals
@ 2001-08-20 14:52 Christian Widmer
  2001-08-20 17:49 ` Daniel Phillips
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Christian Widmer @ 2001-08-20 14:52 UTC (permalink / raw)
  To: linux-kernel

hi,

1) when using any functions that can block i need to do this in the context 
of a process. so a can't read, write to sockets in a bottom-half of a 
interrupt handler. thats why i need to use a kernel thread (i don't what to
use a user level process). my question now is - how long does it take until 
my kernel thread starts running? do i have a way to give it very high 
priority and force my thread to be scheduled so that i can be 'sure' to run 
just after softirq's, tasklets, ...?

2) for module writers there is documented and easy to use api how to use 
tasklets to schedule it's buttom-half for later (very soon) execution. 
are tasklets like tq_immedate in 2.2.x or tq_schedule? i mean is there a
current process or do they runn at interrupt time?
and am i right when i say: to add a new softirq i need to patch kernel 
sources?

3) i had a look at the ll_rw_block and realised that it can block when there 
are to many buffers locked. when i use generic_make_request can i be 
shure that i wont block so that i can call it in a tasklet and don't need to
switch to a kernel thread? i think that also needs that clustering function 
__make_request may not block. does it or does it not?

4) i was looking at the networking code in 2.4 because it is possible that
i need to write a new thin network protocoll which is optimised for disk-i/o.
i didn't find any documentation how to implement a new one in 2.4. does
anybody have some pointers to doc's or can give me some comments?

thanks for any help or pointers to further information
chris

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: misc questions about kernel 2.4.x internals
  2001-08-20 14:52 misc questions about kernel 2.4.x internals Christian Widmer
@ 2001-08-20 17:49 ` Daniel Phillips
  2001-08-20 18:57 ` george anzinger
  2001-08-20 20:52 ` Anders Peter Fugmann
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Phillips @ 2001-08-20 17:49 UTC (permalink / raw)
  To: llx, linux-kernel

On August 20, 2001 04:52 pm, Christian Widmer wrote:
> 3) i had a look at the ll_rw_block and realised that it can block when there 
> are to many buffers locked. when i use generic_make_request can i be 
> shure that i wont block so that i can call it in a tasklet and don't need to
> switch to a kernel thread? i think that also needs that clustering function 
> __make_request may not block. does it or does it not?

It blocks on the availability of a struct request, look at __get_request_wait.
This is how we do IO throttling in 2.4.8/9.

--
Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: misc questions about kernel 2.4.x internals
  2001-08-20 14:52 misc questions about kernel 2.4.x internals Christian Widmer
  2001-08-20 17:49 ` Daniel Phillips
@ 2001-08-20 18:57 ` george anzinger
  2001-08-20 19:46   ` Christian Widmer
  2001-08-20 20:52 ` Anders Peter Fugmann
  2 siblings, 1 reply; 6+ messages in thread
From: george anzinger @ 2001-08-20 18:57 UTC (permalink / raw)
  To: llx; +Cc: linux-kernel

Christian Widmer wrote:
> 
> hi,
> 
> 1) when using any functions that can block i need to do this in the context
> of a process. so a can't read, write to sockets in a bottom-half of a
> interrupt handler. thats why i need to use a kernel thread (i don't what to
> use a user level process). my question now is - how long does it take until
> my kernel thread starts running? do i have a way to give it very high
> priority and force my thread to be scheduled so that i can be 'sure' to run
> just after softirq's, tasklets, ...?

You would/ could assign it a real time priority and make it SCHED_FIFO
or SCHED_RR.  If you do this, it is a good idea to make the priority
used available to be "tuned".  Not every one will agree that _your_
handler is as important as you think it is.
> 
> 2) for module writers there is documented and easy to use api how to use
> tasklets to schedule it's buttom-half for later (very soon) execution.
> are tasklets like tq_immedate in 2.2.x or tq_schedule? i mean is there a
> current process or do they runn at interrupt time?
> and am i right when i say: to add a new softirq i need to patch kernel
> sources?
> 
> 3) i had a look at the ll_rw_block and realised that it can block when there
> are to many buffers locked. when i use generic_make_request can i be
> shure that i wont block so that i can call it in a tasklet and don't need to
> switch to a kernel thread? i think that also needs that clustering function
> __make_request may not block. does it or does it not?
> 
> 4) i was looking at the networking code in 2.4 because it is possible that
> i need to write a new thin network protocoll which is optimised for disk-i/o.
> i didn't find any documentation how to implement a new one in 2.4. does
> anybody have some pointers to doc's or can give me some comments?
> 
> thanks for any help or pointers to further information
> chris
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: misc questions about kernel 2.4.x internals
  2001-08-20 18:57 ` george anzinger
@ 2001-08-20 19:46   ` Christian Widmer
  2001-08-20 20:49     ` george anzinger
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Widmer @ 2001-08-20 19:46 UTC (permalink / raw)
  To: george anzinger; +Cc: linux-kernel

thanks 

> You would/ could assign it a real time priority and make it SCHED_FIFO
> or SCHED_RR.  

do you have references to an example how to to it?

> If you do this, it is a good idea to make the priority
> used available to be "tuned".  Not every one will agree that _your_
> handler is as important as you think it is.

ye i think so - in our cluster it's just fine at the moment :)

chris

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: misc questions about kernel 2.4.x internals
  2001-08-20 19:46   ` Christian Widmer
@ 2001-08-20 20:49     ` george anzinger
  0 siblings, 0 replies; 6+ messages in thread
From: george anzinger @ 2001-08-20 20:49 UTC (permalink / raw)
  To: llx; +Cc: linux-kernel

Christian Widmer wrote:
> 
> thanks
> 
> > You would/ could assign it a real time priority and make it SCHED_FIFO
> > or SCHED_RR.
> 
> do you have references to an example how to to it?
> 
> > If you do this, it is a good idea to make the priority
> > used available to be "tuned".  Not every one will agree that _your_
> > handler is as important as you think it is.
> 
> ye i think so - in our cluster it's just fine at the moment :)
> 
> chris
Read the man page on sched_setscheduler(2).  If in the kernel, you would
need to make a system call.  I am afraid I don't know exactly how this
is done, but it is possible.  By the way, some scheduler patches allow
the real time priority to go well above 99, thus if you need this:

#ifndef MAX_PRI
#define MAX_PRI 99
#endif

if you want the maximum priority.

George

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: misc questions about kernel 2.4.x internals
  2001-08-20 14:52 misc questions about kernel 2.4.x internals Christian Widmer
  2001-08-20 17:49 ` Daniel Phillips
  2001-08-20 18:57 ` george anzinger
@ 2001-08-20 20:52 ` Anders Peter Fugmann
  2 siblings, 0 replies; 6+ messages in thread
From: Anders Peter Fugmann @ 2001-08-20 20:52 UTC (permalink / raw)
  To: llx; +Cc: linux-kernel



Christian Widmer wrote:
> hi,
> 
> 1) when using any functions that can block i need to do this in the context 
> of a process. so a can't read, write to sockets in a bottom-half of a 
> interrupt handler. thats why i need to use a kernel thread (i don't what to
> use a user level process). my question now is - how long does it take until 
> my kernel thread starts running? do i have a way to give it very high 
> priority and force my thread to be scheduled so that i can be 'sure' to run 
> just after softirq's, tasklets, ...?
> 
> 2) for module writers there is documented and easy to use api how to use 
> tasklets to schedule it's buttom-half for later (very soon) execution. 
> are tasklets like tq_immedate in 2.2.x or tq_schedule? i mean is there a
> current process or do they runn at interrupt time?
> and am i right when i say: to add a new softirq i need to patch kernel 
> source

Tasklets are startet by a softirq, so there is no current process (there 
is, but is random.) I'm not sure that softirq's alwarys run in 
interrupttime.
Do thins of tasklets like BH's that are much more fair to others (not 
blocking all other processes.)

To add a new sorftirq, yes you need to patch kernel source and therfore 
not reccomended (I believe that there are max. 16 softirq's, so its a 
sparse resource.)

> 3) i had a look at the ll_rw_block and realised that it can block when there 
> are to many buffers locked. when i use generic_make_request can i be 
> shure that i wont block so that i can call it in a tasklet and don't need to
> switch to a kernel thread? i think that also needs that clustering function 
> __make_request may not block. does it or does it not?
> 
> 4) i was looking at the networking code in 2.4 because it is possible that
> i need to write a new thin network protocoll which is optimised for disk-i/o.
> i didn't find any documentation how to implement a new one in 2.4. does
> anybody have some pointers to doc's or can give me some comments?
> 
> thanks for any help or pointers to further information
> chris
> -

Regards
Anders Fugmann



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-08-20 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-20 14:52 misc questions about kernel 2.4.x internals Christian Widmer
2001-08-20 17:49 ` Daniel Phillips
2001-08-20 18:57 ` george anzinger
2001-08-20 19:46   ` Christian Widmer
2001-08-20 20:49     ` george anzinger
2001-08-20 20:52 ` Anders Peter Fugmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).