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: <ZHDh4Jeb/vKY+nGU@casper.infradead.org>
Date:   Fri, 26 May 2023 17:44:16 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Khalid Aziz <khalid.aziz@...cle.com>
Cc:     Steven Sistare <steven.sistare@...cle.com>,
        akpm@...ux-foundation.org, david@...hat.com, ying.huang@...el.com,
        mgorman@...hsingularity.net, baolin.wang@...ux.alibaba.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Khalid Aziz <khalid@...nel.org>
Subject: Re: [PATCH v4] mm, compaction: Skip all non-migratable pages during
 scan

On Fri, May 26, 2023 at 09:44:34AM -0600, Khalid Aziz wrote:
> > Oh, I think I found it!  pin_user_pages_remote() is called by
> > vaddr_get_pfns().  If these are the pages you're concerned about,
> > then the efficient way to do what you want is simply to call
> > folio_maybe_dma_pinned().  Far more efficient than the current mess
> > of total_mapcount().
> 
> vfio pinned pages triggered this change. Wouldn't checking refcounts against
> mapcount provide a more generalized way of detecting non-migratable pages?

Well, you changed the comment to say that we were concerned about
long-term pins.  If we are, than folio_maybe_dma_pinned() is how to test
for long-term pins.  If we want to skip pages which are short-term pinned,
then we need to not change the comment, and keep using mapcount/refcount
differences.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ