From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.195]) by ozlabs.org (Postfix) with ESMTP id 98F3A67A03 for ; Tue, 24 Oct 2006 19:37:58 +1000 (EST) Received: by nz-out-0102.google.com with SMTP id z31so609587nzd for ; Tue, 24 Oct 2006 02:37:57 -0700 (PDT) Message-ID: Date: Tue, 24 Oct 2006 15:07:56 +0530 From: Rahul To: "Fawad Lateef" Subject: Re: help in block drivers In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4986_10520927.1161682676527" References: <1e62d1370610192213g7502709ufcc2bce6903040d8@mail.gmail.com> Cc: kernelnewbies@nl.linux.org, Shakthi Kannan , linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_4986_10520927.1161682676527 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/22/06, Rahul wrote: > > > > On 10/20/06, Fawad Lateef 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 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 > > > > ------=_Part_4986_10520927.1161682676527 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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


------=_Part_4986_10520927.1161682676527--