kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: fser@code-libre.org (François)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Help understanding block layer sample in LDD3
Date: Fri, 29 Jul 2016 15:16:19 +0200	[thread overview]
Message-ID: <20160729131617.xfmis2zj2j2mu5js@sith> (raw)
In-Reply-To: <CA+aCy1H44k8gaTpYO9P1m9N89Fz_6WYmRkqp-kZVKC_71+rwgg@mail.gmail.com>

On Fri, Jul 29, 2016 at 04:26:41PM +0530, Pranay Srivastava wrote:
> On Fri, Jul 29, 2016 at 4:15 PM, Fran?ois <fser@code-libre.org> wrote:
> > On Fri, Jul 29, 2016 at 03:58:28PM +0530, Pranay Srivastava wrote:
> >>
> >> I don't see req->buffer. Which version you are using?
> >
> > You're absolutely right. Both [1] and [2] seems to be outdated.
> > I'm currently compiling and testing most of my code on a 3.19 on a 14.04 LTS ubuntu in a VM,
> > rather than the actual kernel. It's simpler for me to work that way.
> >
> > [1] https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c#L119
> > [2] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/block/biodoc.txt
> >
> > [...]
> >>
> >> If this is a memory backed block driver, then perhaps you can handle
> >> multiple requests[?]. I don't think you need
> >> to actually break up the same request into multiple requests.
> >
> > Actually, it is a shared memory based. Hence, a request might larger than the available room in
> > the shared memory. This case has to be handled.
> 
> So basically you hold on to some pages[?] and use that as your disk right?

Well those shared pages are used to exchange chunks of data with another party, which will itself
get those data, produce bio, submit bio, and put response on the shared region.

> I guess setcapacity should take care of this [no?]

The set_capacity() value is the one reported by the other party which queries an actual block device.
Eventhough request size could be resized, if the other party takes time to respond, very few memory
might be available, but large request can be enqueued. So limiting the capacity does not seem to be an option here.

> I think if you just take care of the proper mapping of sector(s) to
> your driver then
> it should be alright.
> 
> Too large request shouldn't reach your driver even when you
> have the device opened as raw and not mounted it.
> 
> >
> > Thanks for your input!
> >
> > --
> > Fran?ois
> 
> 
> 
> -- 
>         ---P.K.S

-- 
Fran?ois

      reply	other threads:[~2016-07-29 13:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  9:44 Help understanding block layer sample in LDD3 François
2016-07-29 10:28 ` Pranay Srivastava
2016-07-29 10:45   ` François
2016-07-29 10:56     ` Pranay Srivastava
2016-07-29 13:16       ` François [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160729131617.xfmis2zj2j2mu5js@sith \
    --to=fser@code-libre.org \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).