mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mala Anand" <manand@us.ibm.com>
To: Andrew Morton <akpm@zip.com.au>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	lse-tech@lists.sourceforge.net, "Mala Anand" <manand@us.ibm.com>
Subject: Re: efficient copy_to_user and copy_from_user routines in Linux Kernel
Date: Fri, 28 Jun 2002 07:35:54 -0500	[thread overview]
Message-ID: <OF3E9638CE.0F77CDD0-ON85256BE6.00442CC8@raleigh.ibm.com> (raw)

Andrew Morton wrote..

>>This came up about a year back when zerocopy networking was merged.
>>Intel boxes started running more slowly purely because of the 8+8
>>alignment thing.

>>I changed tcp to use a different copy if either source or dest were
>>not eight-byte aligned, and found that the resulting improvement
>>across a mixed networking load was only 1%.  Your numbers are higher,
>>so perhaps there are different alignments in the mix...

>I will test on other workloads when I return back to work after OLS
>and vacation.  However we tested an earlier version of this patch on
>Netbench using sendfile and gained around 3% improvement. The baseline
>profiling showed that Netbench was spending 10% in generic_copy_to_user.
>The tcp options are aligned on an 4-byte boundary, so depending on the
>options used the address to the data (source address to the
>generic_copy_to_user) should fall on an 4 or 8 byte boundary. I agree
>with you more test is needed.

One correction to the above statement...
Due to the tcp options alignment on an 4-byte boundary the source
address to the generic_copy_to_user should fall on an 4, 8, 12
and 16 etc., byte boundary. However,I have seen that 4 and 12 byte
alignment using unrolled loop performed better than the string copy.


>>One question:  have you tested on other CPU types?  This problem is
>>very specific to Intel hardware.  On AMD, the eight-byte alignement
>>artifact does not exist at all.  It could be that your patch is not
>>desirable on such CPUs?

>I tested only on Pentium II and III. I will test it on Pentium IV.
>When I said 8-byte alignment, it is 8 and greater.  I will
>try to check out AMD also.

Same correction here, 8-byte alignment means 8, 16 or greater.

Regards,
    Mala


   Mala Anand
   E-mail:manand@us.ibm.com
   Linux Technology Center - Performance
   Phone:838-8088; Tie-line:678-8088




             reply	other threads:[~2002-06-28 12:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-28 12:35 Mala Anand [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-28 11:50 Mala Anand
2002-06-24 19:34 Mala Anand
2002-06-24 19:33 ` David S. Miller
2002-06-25 17:03 ` Andrew Morton
2002-06-25 17:43   ` kuznet
2002-06-25 19:47     ` Andrew Morton
2002-06-25 21:46       ` Chris Friesen
2002-06-26 13:54     ` Hirokazu Takahashi

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=OF3E9638CE.0F77CDD0-ON85256BE6.00442CC8@raleigh.ibm.com \
    --to=manand@us.ibm.com \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    /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®