lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Dec 2021 09:57:08 +0000
From:   Catalin Marinas <catalin.marinas@....com>
To:     David Hildenbrand <david@...hat.com>
Cc:     Jianyong Wu <Jianyong.Wu@....com>,
        Anshuman Khandual <Anshuman.Khandual@....com>,
        "will@...nel.org" <will@...nel.org>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "ardb@...nel.org" <ardb@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "gshan@...hat.com" <gshan@...hat.com>,
        Justin He <Justin.He@....com>, nd <nd@....com>
Subject: Re: [PATCH v2] arm64/mm: avoid fixmap race condition when create pud
 mapping

On Mon, Dec 13, 2021 at 08:37:04AM +0100, David Hildenbrand wrote:
> On 13.12.21 08:27, Jianyong Wu wrote:
> >>> @@ -359,6 +365,7 @@ static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
> >>>  	} while (pudp++, addr = next, addr != end);
> >>>
> >>>  	pud_clear_fixmap();
> >>> +	spin_unlock(&fixmap_lock);
> >>>  }
> >>>
> >>>  static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
> >>>
> >>
> >> As the race could only happen with memory hotplug being enabled, could
> >> not we wrap this around with CONFIG_MEMORY_HOTPLUG, just to narrow
> >> its scope possibly speed up other non-hotplug cases ?

Assuming you can quantify the speed-up...

> > I think it's better.
> 
> We better avoid using ifdef if not really necessary, it just uglifies
> the code. We could add
> 
> if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
> 	...
> 
> But should we really try to micto-optimize this code and make it harder
> to read for the purpose of an unproven performance gain? (if there is no
> contention, we'll most probably not even recognize that we're taking a lock)

I agree, I don't see the point of this optimisation.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ