From: Dave Hansen <dave.hansen@intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Yin Fengwei <fengwei.yin@intel.com>,
syzbot <syzbot+55cc72f8cc3a549119df@syzkaller.appspotmail.com>,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [mm?] BUG: Bad page map (7)
Date: Tue, 12 Sep 2023 11:01:13 -0700 [thread overview]
Message-ID: <e3a16a25-46bf-e38f-142f-ab620d24eb4d@intel.com> (raw)
In-Reply-To: <ZP/wLVg1JCvhaEKm@casper.infradead.org>
On 9/11/23 21:59, Matthew Wilcox wrote:
> On Mon, Sep 11, 2023 at 01:22:51PM -0700, Dave Hansen wrote:
>> On 9/11/23 12:12, Matthew Wilcox wrote:
>>> On Mon, Sep 11, 2023 at 09:55:37AM -0700, Dave Hansen wrote:
>>>> On 9/11/23 09:44, Matthew Wilcox wrote:
>>>>> After fixing your two typos, this assembles to 176 bytes more code than
>>>>> my version. Not sure that's great.
>>>> Maybe I'm a fool, but 176 bytes of text bloat isn't scaring me off too
>>>> much. I'd much rather have that than another window into x86 goofiness
>>>> to maintain.
>>>>
>>>> Does that 176 bytes translate into meaningful performance, or is it just
>>>> a bunch of register bit twiddling that the CPU will sail through?
>>> I'm ... not sure how to tell. It's 1120 bytes vs 944 bytes and crawling
>>> through that much x86 assembly isn't my idea of a great time. I can
>>> send you objdump -dr for all three options if you like? Maybe there's
>>> a quick way to compare them that I've never known about.
>> Working patches would be great if you're got 'em handy, plus your
>> .config and generally what compiler you're on.
> gcc (Debian 13.2.0-2) 13.2.0
>
> I don't think there's anything particularly strange about my .config
>
> If you compile this patch as-is, you'll get your preferred code.
> Remove the #define DH and you get mine.
>
> I would say that 176 bytes is 3 cachelines of I$, which isn't free,
> even if all the insns in it can be executed while the CPU is waiting
> for cache misses. This ought to be a pretty tight loop anyway; we're
> just filling in adjacent PTEs. There may not be many spare cycles
> for "free" uops to execute.
Thanks for that!
I went poking at it a bit. One remarkable thing is how many pv_ops
calls there are. Those are definitely keeping the compiler from helping
is out here too much.
Your version has 9 pv_ops calls while mine has 6. So mine may have more
instructions in _this_ function, but it could easily be made up for by
call overhead and extra instructions in the pv_ops.
Also, I went looking for a way to poke at set_ptes() and profile it a
bit and get some actual numbers. It seems like in most cases it would
be limited to use via fault around. Is there some other way to poke at
it easily?
So, in the end, I see code which is not (as far as I can see) in a hot
path, and (again, to me) there's no compelling performance argument one
way or another.
I still like my version. *Known* simplicity and uniformity win out in
my book over unknown performance benefits.
But, fixing the bug is the most important thing. I don't feel strongly
about it to NAK your version either.
next prev parent reply other threads:[~2023-09-12 18:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-09 17:12 syzbot
2023-09-10 3:02 ` Matthew Wilcox
2023-09-10 3:29 ` syzbot
2023-09-10 3:40 ` Yin, Fengwei
2023-09-11 7:24 ` Yin Fengwei
2023-09-11 7:32 ` Yin Fengwei
2023-09-11 7:12 ` Yin Fengwei
2023-09-11 7:48 ` syzbot
2023-09-11 13:26 ` Matthew Wilcox
2023-09-11 14:00 ` syzbot
2023-09-11 15:34 ` Dave Hansen
2023-09-11 16:44 ` Matthew Wilcox
2023-09-11 16:55 ` Dave Hansen
2023-09-11 19:12 ` Matthew Wilcox
2023-09-11 20:22 ` Dave Hansen
2023-09-12 4:59 ` Matthew Wilcox
2023-09-12 16:07 ` Dave Hansen
2023-09-12 18:01 ` Dave Hansen [this message]
2023-09-14 7:33 ` Yin Fengwei
2023-09-14 8:37 ` Yin Fengwei
2023-09-19 1:11 ` Yin Fengwei
2023-09-19 16:11 ` Dave Hansen
2023-09-20 1:29 ` Yin Fengwei
2023-09-20 1:47 ` Matthew Wilcox
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=e3a16a25-46bf-e38f-142f-ab620d24eb4d@intel.com \
--to=dave.hansen@intel.com \
--cc=akpm@linux-foundation.org \
--cc=fengwei.yin@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=syzbot+55cc72f8cc3a549119df@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=willy@infradead.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