linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: "Oliver Neukum" <oliver@neukum.org>
Cc: "Arjan van de Ven" <arjan@infradead.org>,
	"Matthew Wilcox" <matthew@wil.cx>,
	viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH]use kzalloc in vfs where appropriate
Date: Mon, 20 Mar 2006 09:25:06 +0200	[thread overview]
Message-ID: <84144f020603192325h54fd3212l1f4846fd40b9f074@mail.gmail.com> (raw)
In-Reply-To: <200603192150.23444.oliver@neukum.org>

Hi Oliver,

On 3/19/06, Oliver Neukum <oliver@neukum.org> wrote:
> Yes it is. The generated code is identical. But on second thought this is still
> not optimal. A full division is generated:
>
>         xorl    %edx, %edx
>         movl    $2147483647, %eax
>         movq    $0, 40(%rsp)
>         divq    %rcx
>         movl    $8, %edx
>         cmpq    %rax, %rdx
>         ja      .L313
>
> Rewriting the test as:
> n!=0 && n > INT_MAX / size
> saves the division because size is much likelier to be a constant, and indeed
> the code is better:
>
>         cmpq    $268435455, %rax
>         movq    $0, 40(%rsp)
>         ja      .L313
>
> Is there anything I am missing?

Did you check allyesconfig vmlinux size before and after? If it helps,
like it probably does, post a patch!

                                   Pekka

  reply	other threads:[~2006-03-20  7:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-17 20:58 [PATCH]use kzalloc in vfs where appropriate Oliver Neukum
2006-03-17 21:08 ` Matthew Wilcox
2006-03-18 10:44   ` Oliver Neukum
2006-03-18 10:55     ` Arjan van de Ven
2006-03-19 13:29       ` Oliver Neukum
2006-03-19 16:09         ` Arjan van de Ven
2006-03-19 20:50           ` Oliver Neukum
2006-03-20  7:25             ` Pekka Enberg [this message]
2006-03-20 12:52               ` Oliver Neukum
2006-03-20 13:08               ` Denis Vlasenko
2006-03-20 13:14                 ` Oliver Neukum
2006-03-20 13:23                   ` Pekka J Enberg
2006-03-20 13:16                 ` Pekka J Enberg

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=84144f020603192325h54fd3212l1f4846fd40b9f074@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=arjan@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=oliver@neukum.org \
    --cc=viro@zeniv.linux.org.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;
as well as URLs for NNTP newsgroup(s).