mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tech Yes <techoyes@yahoo.com>
To: Kernel Linux <linux-kernel@vger.kernel.org>
Cc: mbroz@redhat.com, agk@redhat.com
Subject: dm_io_async_bvec API in 2.6.26
Date: Fri, 15 Aug 2008 17:16:37 -0700 (PDT)	[thread overview]
Message-ID: <980080.67586.qm@web59704.mail.ac4.yahoo.com> (raw)

Hi All



I am in the process of porting a driver written for 2.6.21 that uses 
dm_io_async_bvec and dm_io_sync_vm. Looks like in the latest kernel
both these API s have been removed.

After looking at the patch I created 2 wrapper functions as follows. 

static int  _my_dm_io_async_bvec(unsigned int num_regions, struct io_region
*where, int rw, struct bio_vec *bvec, io_notify_fn fn, void *context)

{
    struct io_job *job=(struct io_job *)context;
    struct io_job_owner *cctx= job->owner;
    struct dm_io_request iorq;

    iorq.bi_rw = (rw | (1 << BIO_RW_SYNC));
    iorq.mem.type = DM_IO_BVEC;
    iorq.mem.ptr.bvec = bvec;
    iorq.notify.fn = fn;
    iorq.notify.context = context;
    iorq.client = cctx->dm_ioclnt; 
    return dm_io(&iorq,num_regions,where,NULL);
}



static int _my_dm_io_sync_vm(unsigned int num_regions, struct io_region *where, int rw, void *data, unsigned long *error_bits, struct io_job_owner *cctx)

{
    struct dm_io_request iorq;
    iorq.bi_rw= (rw | (1 << BIO_RW_SYNC));

    iorq.mem.type=DM_IO_VMA;
    iorq.mem.ptr.vma=data;
    iorq.notify.fn=NULL;
    iorq.notify.context=NULL;
    iorq.client=cctx->mdx_ioclnt;
    return dm_io(&iorq,num_regions,where,NULL);
}


Except
passing in the owner of the io job in dm_io_sync_vm the calling
convention is the same as what we had in 2.6.21. I create the dm io
clients in the constructor of the dm.

Here is the question. As advised in the comment in dm_io if I use the BIO_RW_SYNC flag my performance tanks. If I don't use it  I get  data corruption within my dm.  How do  I  get around this?  Is there an example  I could follow that previously used  these API s and now using dm-io that you can direct me to? 

My porting was based on the dm-raid1 port.

Interestingly they dont use the flag BIO_RW_SYNC and I cannot find a place
where they call blk_unplug() with regards to dm-io in that code. 

Some suggestions are very welcome

Thanks in advance

Yes2Tech


      


                 reply	other threads:[~2008-08-16  0:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=980080.67586.qm@web59704.mail.ac4.yahoo.com \
    --to=techoyes@yahoo.com \
    --cc=agk@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbroz@redhat.com \
    /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

all inboxes | Powered by JetHome®