[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fb936bdb-6473-a956-8431-fe95f5940acc@intel.com>
Date: Mon, 11 Sep 2023 09:55:37 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Yin Fengwei <fengwei.yin@...el.com>,
syzbot <syzbot+55cc72f8cc3a549119df@...kaller.appspotmail.com>,
akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [mm?] BUG: Bad page map (7)
On 9/11/23 09:44, Matthew Wilcox wrote:
>> static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
>> pte_t *ptep, pte_t pte, unsigned int nr)
>> {
>> pgprot_t prot = pte_pgprot(x);
>> unsigned long pfn = pte_pfn(pte);
>>
>> page_table_check_ptes_set(mm, ptep, pte, nr);
>>
>> arch_enter_lazy_mmu_mode();
>> for (;;) {
>> set_pte(ptep, pte);
>> if (--nr == 0)
>> break;
>> ptep++;
>> pfn++;
>> pte = pfn_pte(pfn, pgprot);
>> }
>> arch_leave_lazy_mmu_mode();
>> }
>>
>> Obviously completely untested. 😄
> After fixing your two typos, this assembles to 176 bytes more code than
> my version. Not sure that's great.
Heh, only two? ;)
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?
Powered by blists - more mailing lists