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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87aedec7-3890-4a35-9f72-b4edb8e1c390@suse.cz>
Date: Wed, 30 Oct 2024 18:42:53 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: John Hubbard <jhubbard@...dia.com>, Christoph Hellwig <hch@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
 LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org,
 linux-stable@...r.kernel.org, Vivek Kasireddy <vivek.kasireddy@...el.com>,
 David Hildenbrand <david@...hat.com>, Dave Airlie <airlied@...hat.com>,
 Gerd Hoffmann <kraxel@...hat.com>, Matthew Wilcox <willy@...radead.org>,
 Jason Gunthorpe <jgg@...dia.com>, Peter Xu <peterx@...hat.com>,
 Arnd Bergmann <arnd@...db.de>, Daniel Vetter <daniel.vetter@...ll.ch>,
 Dongwon Kim <dongwon.kim@...el.com>, Hugh Dickins <hughd@...gle.com>,
 Junxiao Chang <junxiao.chang@...el.com>,
 Mike Kravetz <mike.kravetz@...cle.com>, Oscar Salvador <osalvador@...e.de>
Subject: Re: [PATCH] mm/gup: restore the ability to pin more than 2GB at a
 time

On 10/30/24 18:29, John Hubbard wrote:
> On 10/30/24 4:03 AM, Vlastimil Babka wrote:
>> On 10/30/24 05:39, John Hubbard wrote:
>>> On 10/29/24 9:33 PM, Christoph Hellwig wrote:
>>>> On Tue, Oct 29, 2024 at 09:30:41PM -0700, John Hubbard wrote:
> ...
>> It might be a regression even if you don't try to pin over 2GB. high-order
>> (>costly order) allocations can fail and/or cause disruptive
>> reclaim/compaction cycles even below MAX_PAGE_ORDER and it's better to use
>> kvmalloc if physical contiguity is not needed, it will attempt the physical
>> kmalloc() allocation with __GFP_NORETRY (little disruption) and fallback to
>> vmalloc() quickly.
>> 
>> Of course if there's a way to avoid the allocation completely, even beter.
> 
> Why not both? I'm going to ask our driver team to batch the pinning calls,
> as recommended nearby, just to be sure that we are following best
> practices.
> 
> But it also seems good to use kvmalloc() here, and avoid any other
> regressions. That's also a best practice.

By "avoid the allocation completely" I meant David's proof of concept
elsewhere in this thread, that seems to replace that kmalloc_array() with no
allocation :)

> thanks,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ