linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: help in block drivers
       [not found] ` <d16b1c80610190808y17c516dl35cfc8ca4a7a42ad@mail.gmail.com>
@ 2006-10-19 16:23   ` Rahul Theraja
  2006-10-20  5:13     ` Fawad Lateef
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Theraja @ 2006-10-19 16:23 UTC (permalink / raw)
  To: Shakthi Kannan; +Cc: kernelnewbies, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

Hello Shakthi Kannan,

Thanks for the reply .

> driver. I could not understand why the "sbd_request " is called even
> though
> > i have given only one read call from user space file.
>
> Block device I/O transfer is done in blocks.
>
> >  And also in the driver, in the function sbd_request() how does the
> driver
> > get the parameters  like sector, current_nr_sectors and buffer.
>
> VFS <-> SCSI <-> Block device?
>
> > i could move
> > furhter fastly.
>
> Fastly? IMHO, learning kernel development involves lot of patience.
>
> SK



Is it necessary to use kernel_thread() in block drivers. In  drivers/block
loop.c i could see  kernel_thread() being used but in floopy.c it is not
used. When is this kernel_thread() function is supposed to be used ?  In the
sbd_device also the kernel_thread() is not used.

Anyone please kindly clarify my doubts.

Thanks in Advance

-Rahul

[-- Attachment #2: Type: text/html, Size: 1237 bytes --]

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

* Re: help in block drivers
  2006-10-19 16:23   ` help in block drivers Rahul Theraja
@ 2006-10-20  5:13     ` Fawad Lateef
  2006-10-22  9:02       ` Rahul
  0 siblings, 1 reply; 5+ messages in thread
From: Fawad Lateef @ 2006-10-20  5:13 UTC (permalink / raw)
  To: Rahul Theraja; +Cc: kernelnewbies, Shakthi Kannan, linuxppc-embedded

Hello Rahul,

First of all please don't do top-posting rather do bottom-posting. For
more information search google.

On 10/19/06, Rahul Theraja <rahul.theraja@gmail.com> wrote:
> Hello Shakthi Kannan,
>
>  Thanks for the reply .
>
>
> > > driver. I could not understand why the "sbd_request " is called even
> though
> > > i have given only one read call from user space file.
> >
> > Block device I/O transfer is done in blocks.
> >
> > >  And also in the driver, in the function sbd_request() how does the
> driver
> > > get the parameters  like sector, current_nr_sectors and buffer.
> >
> > VFS <-> SCSI <-> Block device?
> >

I think its VFS<->Buffer-Cache<->Block-Device and if drive is mounted
then VFS<->FS<->Buffer-Cache<->Block-Device

> > > i could move
> > > furhter fastly.
> >
> > Fastly? IMHO, learning kernel development involves lot of patience.
> >
> > SK
>
>
>  Is it necessary to use kernel_thread() in block drivers. In  drivers/block
> loop.c i could see  kernel_thread() being used but in floopy.c it is not
> used. When is this kernel_thread() function is supposed to be used ?  In the
> sbd_device also the kernel_thread() is not used.
>

First in kernel-2.6.x its better to use kthread_*() rather than
kernel_thread if threading is needed.

Threading isn't necessary in any device until unless you need it. For
example if your driver is emulating a device or performing IO directly
then you don't need it, but if your driver is sending request to a
device which generates interrupts after completing IO and you want to
do some extra work after getting IO completion interrupt then you must
use thread. As threads work in process-context, hence can do sleep and
lengthy processing but interrupt-context shouldn't sleep or nor do
long processing.

For getting more understanding about different contexts like process,
interrupt, softirqs contexts do search google.

>  Anyone please kindly clarify my doubts.
>

I hope you doubts are not clear.

>  Thanks in Advance
>
>  -Rahul
>

-- 
Fawad Lateef

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

* Re: help in block drivers
  2006-10-20  5:13     ` Fawad Lateef
@ 2006-10-22  9:02       ` Rahul
  2006-10-24  9:37         ` Rahul
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul @ 2006-10-22  9:02 UTC (permalink / raw)
  To: Fawad Lateef; +Cc: kernelnewbies, Shakthi Kannan, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 2266 bytes --]

On 10/20/06, Fawad Lateef <fawadlateef@gmail.com> wrote:
>
> Hello Rahul,
>
> First of all please don't do top-posting rather do bottom-posting. For
> more information search google.


oh sorry for that

On 10/19/06, Rahul Theraja <rahul.theraja@gmail.com> wrote:
> > Hello Shakthi Kannan,
> >
> >  Thanks for the reply .
> >
> >
> > > > driver. I could not understand why the "sbd_request " is called even
> > though
> > > > i have given only one read call from user space file.
> > >
> > > Block device I/O transfer is done in blocks.
> > >
> > > >  And also in the driver, in the function sbd_request() how does the
> > driver
> > > > get the parameters  like sector, current_nr_sectors and buffer.
> > >
> > > VFS <-> SCSI <-> Block device?
> > >
>
> I think its VFS<->Buffer-Cache<->Block-Device and if drive is mounted
> then VFS<->FS<->Buffer-Cache<->Block-Device
>
> > > > i could move
> > > > furhter fastly.
> > >
> > > Fastly? IMHO, learning kernel development involves lot of patience.
> > >
> > > SK
> >
> >
> >  Is it necessary to use kernel_thread() in block drivers.
> In  drivers/block
> > loop.c i could see  kernel_thread() being used but in floopy.c it is not
> > used. When is this kernel_thread() function is supposed to be used ?  In
> the
> > sbd_device also the kernel_thread() is not used.
> >
>
> First in kernel-2.6.x its better to use kthread_*() rather than
> kernel_thread if threading is needed.
>
> Threading isn't necessary in any device until unless you need it. For
> example if your driver is emulating a device or performing IO directly
> then you don't need it, but if your driver is sending request to a
> device which generates interrupts after completing IO and you want to
> do some extra work after getting IO completion interrupt then you must
> use thread. As threads work in process-context, hence can do sleep and
> lengthy processing but interrupt-context shouldn't sleep or nor do
> long processing.
>
> For getting more understanding about different contexts like process,
> interrupt, softirqs contexts do search google.
>
> >  Anyone please kindly clarify my doubts.
> >
>
> I hope you doubts are not clear.


thank you very much for all the help

>  Thanks in Advance
> >
> >  -Rahul
> >
>
> --
> Fawad Lateef
>

[-- Attachment #2: Type: text/html, Size: 3324 bytes --]

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

* Re: help in block drivers
  2006-10-22  9:02       ` Rahul
@ 2006-10-24  9:37         ` Rahul
  2006-10-24 12:14           ` Fawad Lateef
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul @ 2006-10-24  9:37 UTC (permalink / raw)
  To: Fawad Lateef; +Cc: kernelnewbies, Shakthi Kannan, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 2708 bytes --]

On 10/22/06, Rahul <rahul.theraja@gmail.com> wrote:
>
>
>
> On 10/20/06, Fawad Lateef <fawadlateef@gmail.com> wrote:
> >
> > Hello Rahul,
> >
> > First of all please don't do top-posting rather do bottom-posting. For
> > more information search google.
>
>
> oh sorry for that
>
> On 10/19/06, Rahul Theraja <rahul.theraja@gmail.com > wrote:
> > > Hello Shakthi Kannan,
> > >
> > >  Thanks for the reply .
> > >
> > >
> > > > > driver. I could not understand why the "sbd_request " is called
> > even
> > > though
> > > > > i have given only one read call from user space file.
> > > >
> > > > Block device I/O transfer is done in blocks.
> > > >
> > > > >  And also in the driver, in the function sbd_request() how does
> > the
> > > driver
> > > > > get the parameters  like sector, current_nr_sectors and buffer.
> > > >
> > > > VFS <-> SCSI <-> Block device?
> > > >
> >
> > I think its VFS<->Buffer-Cache<->Block-Device and if drive is mounted
> > then VFS<->FS<->Buffer-Cache<->Block-Device
> >
> > > > > i could move
> > > > > furhter fastly.
> > > >
> > > > Fastly? IMHO, learning kernel development involves lot of patience.
> > > >
> > > > SK
> > >
> > >
> > >  Is it necessary to use kernel_thread() in block drivers.
> > In  drivers/block
> > > loop.c i could see  kernel_thread() being used but in floopy.c it is
> > not
> > > used. When is this kernel_thread() function is supposed to be used
> > ?  In the
> > > sbd_device also the kernel_thread() is not used.
> > >
> >
> > First in kernel-2.6.x its better to use kthread_*() rather than
> > kernel_thread if threading is needed.
> >
> > Threading isn't necessary in any device until unless you need it. For
> > example if your driver is emulating a device or performing IO directly
> > then you don't need it, but if your driver is sending request to a
> > device which generates interrupts after completing IO and you want to
> > do some extra work after getting IO completion interrupt then you must
> > use thread. As threads work in process-context, hence can do sleep and
> > lengthy processing but interrupt-context shouldn't sleep or nor do
> > long processing.
> >
> > For getting more understanding about different contexts like process,
> > interrupt, softirqs contexts do search google.
> >
> > >  Anyone please kindly clarify my doubts.
> > >
> >
> > I hope you doubts are not clear.
>
>
Can anyone tell me or send me some links that tells about the following
functions:
daemonize, siginitsetinv , recalc_sigpending . Though i googled, i coildnt
get much information on them.

Thanks in adavance
Rahul



thank you very much for all the help
>
> >  Thanks in Advance
> > >
> > >  -Rahul
> > >
> >
> > --
> > Fawad Lateef
> >
>
>

[-- Attachment #2: Type: text/html, Size: 4317 bytes --]

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

* Re: help in block drivers
  2006-10-24  9:37         ` Rahul
@ 2006-10-24 12:14           ` Fawad Lateef
  0 siblings, 0 replies; 5+ messages in thread
From: Fawad Lateef @ 2006-10-24 12:14 UTC (permalink / raw)
  To: Rahul; +Cc: kernelnewbies, Shakthi Kannan, linuxppc-embedded

On 10/24/06, Rahul <rahul.theraja@gmail.com> wrote:
>
>  Can anyone tell me or send me some links that tells about the following
> functions:
>  daemonize, siginitsetinv , recalc_sigpending . Though i googled, i coildnt
> get much information on them.
>

daemonize() -----> is used to make kernel thread without any
user-space resources and in the last it makes thread/process child of
init. see comments above function definition
(http://lxr.free-electrons.com/source/kernel/exit.c#373)


For understanding these sort of functions, just look for kernel_thread
documents on google and there you will find details. You can also get
information in comments above these functions definition. OR do search
for their usage in other places in kernel's code and you will get the
information related to that required function.


>  Thanks in adavance
>  Rahul
>
>


-- 
Fawad Lateef

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

end of thread, other threads:[~2006-10-24 12:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <ff9652ca0610190314u32a620b5qd0bd27a1b2700a22@mail.gmail.com>
     [not found] ` <d16b1c80610190808y17c516dl35cfc8ca4a7a42ad@mail.gmail.com>
2006-10-19 16:23   ` help in block drivers Rahul Theraja
2006-10-20  5:13     ` Fawad Lateef
2006-10-22  9:02       ` Rahul
2006-10-24  9:37         ` Rahul
2006-10-24 12:14           ` Fawad Lateef

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).