From: "Jan Beulich" <JBeulich@suse.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: <tglx@linutronix.de>, "Andrew Morton" <akpm@linux-foundation.org>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
<linux-kernel@vger.kernel.org>, <hpa@zytor.com>
Subject: Re: [PATCH] x86-64: fix memset() to support sizes of 4Gb and above
Date: Fri, 06 Jan 2012 12:31:38 +0000 [thread overview]
Message-ID: <4F06F7BA020000780006ACEB@nat28.tlf.novell.com> (raw)
In-Reply-To: <20120106110519.GA32673@elte.hu>
>>> On 06.01.12 at 12:05, Ingo Molnar <mingo@elte.hu> wrote:
> * Jan Beulich <JBeulich@suse.com> wrote:
>
>> While currently there doesn't appear to be any reachable
>> in-tree case where such large memory blocks may be passed to
>> memset() (alloc_bootmem() being the primary non-reachable one,
>> as it gets called with suitably large sizes in FLATMEM
>> configurations), we have recently hit the problem a second
>> time in our Xen kernels. Rather than working around it a
>> second time, prevent others from falling into the same trap by
>> fixing this long standing limitation.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> Have you checked the before/after size of the hotpath?
>
> The patch suggests that it got shorter by 3 instructions:
>
>> - movl %edx,%r8d
>> - andl $7,%r8d
>> - movl %edx,%ecx
>> - shrl $3,%ecx
>> + movq %rdx,%rcx
>> + andl $7,%edx
>> + shrq $3,%rcx
>
> [...]
>
>> movq %rdi,%r10
>> - movq %rdx,%r11
>>
>
> [...]
>
>> - movl %r11d,%ecx
>> - andl $7,%ecx
>> + andl $7,%edx
>
> Is that quick impression correct? I have not tried building or
> measuring it.
Yes, that's correct.
As the bodies of the individual flavors didn't change, I see no risk in
this change causing any performance degradation.
> Would be nice to add support for arch/x86/lib/memset_64.S as
> well, and look at the before/after performance of it. In
> userspace we can do a lot more accurate measurements of this
> kind:
I'll see whether I can get this done, but I admit that I'm entirely
unfamiliar with this tool and its infrastructure. I hope doing this is
not going to be a requirement for acceptance of the patch.
Jan
next prev parent reply other threads:[~2012-01-06 12:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 16:10 [PATCH] x86-64: fix memset() to support sizes of 4Gb and above Jan Beulich
2012-01-06 11:05 ` Ingo Molnar
2012-01-06 12:31 ` Jan Beulich [this message]
2012-01-06 19:01 ` Ingo Molnar
2012-01-18 10:40 ` Jan Beulich
2012-01-18 11:14 ` Ingo Molnar
2012-01-18 13:33 ` Jan Beulich
2012-01-18 18:16 ` Linus Torvalds
2012-01-19 7:48 ` Jan Beulich
2012-01-19 12:18 ` Ingo Molnar
2012-01-26 13:40 ` [tip:x86/asm] x86-64: Fix " tip-bot for Jan Beulich
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=4F06F7BA020000780006ACEB@nat28.tlf.novell.com \
--to=jbeulich@suse.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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