From: Sebastian Heidl <heidl@zib.de>
To: Matthew Clark <matt@eee.nott.ac.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: dev driver / pci throughput
Date: Fri, 9 Nov 2001 13:32:15 +0100 [thread overview]
Message-ID: <20011109133215.A792@csr-pc1.zib.de> (raw)
In-Reply-To: <Pine.OSF.4.31.0111091022010.26869-100000@perry>
In-Reply-To: <Pine.OSF.4.31.0111091022010.26869-100000@perry>; from matt@eee.nott.ac.uk on Fri, Nov 09, 2001 at 10:48:58AM +0000
On Fri, Nov 09, 2001 at 10:48:58AM +0000, Matthew Clark wrote:
> #define CHUNK 512->4096 depending on implementation
>
> static ssize_t BSL_write(..., const char *buf, size_t count..){
> char chunk[CHUNK];
> int i,pos,
> for(i=0,pos=0;i<amount of data;i++,pos+=CHUNK){
> copy_from_user(buff,buf+pos,CHUNK);
> /* reorder data */
> /* not significant in throughput */
> for(k=0;k<CHUNK;k++){
> chunk[k]=buff[B_SM(j+k)];
> }
> memcpy_toio(MEM_reg+pos+i*CHUNK+j,chunk,CHUNK);
> }
> return count;
> }
> + lots of not important details-----
>
> MEM_reg=ioremap(pci_resource_start(dev,B_SM_MEM)&PCI_BASE_ADDRESS_MEM_MASK,REG_SIZE);
Don't know if this will improve the performance much but if you checked the
area you are copying from with access_ok you can replace copy_from_user by
__copy_from_user. The second version does not check the area and so saves some
cycles.
regards,
_sh_
next prev parent reply other threads:[~2001-11-09 12:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-09 10:48 Matthew Clark
2001-11-09 12:32 ` Sebastian Heidl [this message]
2001-11-09 18:07 ` Russell King
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=20011109133215.A792@csr-pc1.zib.de \
--to=heidl@zib.de \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@eee.nott.ac.uk \
/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®